#37763 [NEW]: cloneNode doesn't clone namespaces of attributes
| From: | storm at rustex dot ru | Date: | Fri, 09 Jun 2006 13:22:40 +0000 |
| Subject: | #37763 [NEW]: cloneNode doesn't clone namespaces of attributes | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-98232@lists.php.net to get a copy of this message | ||
From: storm at rustex dot ru
Operating system: Windows 2003, FreeBSD 5.4
PHP version: 5.1.4
PHP Bug Type: DOM XML related
Bug description: cloneNode doesn't clone namespaces of attributes
Description:
------------
Try to work with Microsoft XML SpreadSheet. When I try clone "Column"
element and insert it, namespaces of its attributes doesn't save. But if I
rewrite attributes with setAttributeNS(getAttributeNS), this attribute save
normal.
Sorry for bad english, see example below.
Reproduce code:
---------------
xls.xml
------------------------
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="xxx">
<Table>
<Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="46.5"/>
</Table>
</Worksheet>
</Workbook>
------------------------
code:
------------------------
$xls = new DOMDocument();
$xls->load("xls.xml");
$column = $xls->getElementsByTagName('Column')->item(0);
$column2 = $column->parentNode->insertBefore($column->cloneNode(),
$column);
echo $xls->save("xls2.xml");
Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="xxx">
<Table>
<Column StyleID="s21" AutoFitWidth="0" Width="46.5"/><Column
ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="46.5"/>
</Table>
</Worksheet>
</Workbook>
--
Edit bug report at http://bugs.php.net/?id=37763&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37763&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37763&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37763&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37763&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37763&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37763&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37763&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37763&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37763&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37763&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37763&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37763&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37763&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37763&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37763&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37763&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37763&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37763&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37763&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37763&r=mysqlcfg