ID: 30617
User updated by: sveta at microbecal dot com
Reported By: sveta at microbecal dot com
Status: Bogus
Bug Type: SimpleXML related
Operating System: Windows XP
PHP Version: 5CVS-2004-10-29 (dev)
New Comment:
$xml_file = 'test.xml';
$xml = simplexml_load_file($xml_file);
foreach($xml->Worksheet->attributes('urn:schemas-microsoft-com:office:spreadsheet')
as $a => $b) {
echo $a,'="',$b,"\"\n";
}
Thank you for pointing me to my mistakes
Previous Comments:
------------------------------------------------------------------------
[2004-10-30 00:56:57] [EMAIL PROTECTED]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
You need to take care of the namespaces.
------------------------------------------------------------------------
[2004-10-29 21:58:57] sveta at microbecal dot com
Real result:
nothing :)
------------------------------------------------------------------------
[2004-10-29 21:55:53] sveta at microbecal dot com
Description:
------------
When I use XML document with namespace definitions, I can't get
attributes of nodes
Reproduce code:
---------------
$xml_file = 'test.xml';
$xml = simplexml_load_file($xml_file);
foreach($xml->Worksheet->attributes() as $a => $b) {
echo $a,'="',$b,"\"\n";
}
test.xml:
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="English">
</Worksheet>
</Workbook>
Expected result:
----------------
Name="English"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30617&edit=1