From:             greg dot steffensen at richmond dot edu
Operating system: Windows XP Service Pack 1
PHP version:      5.0.0b4 (beta4)
PHP Bug Type:     XML related
Bug description:  dom_import_simplexml innaccurate

Description:
------------
dom_import_simplexml(), when given a simplexml_element that is part of a
larger simplexml nesting, will import the parent of the element provided,
not the element itself.  

Reproduce code:
---------------
<?

$dom = new domdocument;

$s = simplexml_load_string('<a>Foo<b>Bar<c/></b></a>');

$el = dom_import_simplexml($s->b->c);

$el = $dom->importNode($el, TRUE);

$dom->appendChild($el);

print $dom->saveXML();

?>



Expected result:
----------------
<?xml version="1.0"?>

<c/>

Actual result:
--------------
<?xml version="1.0"?>

<b>Bar<c/></b>



-- 
Edit bug report at http://bugs.php.net/?id=27436&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27436&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27436&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27436&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27436&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27436&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27436&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27436&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27436&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27436&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27436&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27436&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27436&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27436&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27436&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27436&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27436&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27436&r=float

Reply via email to