Given an XML file, it is possible to retrieving elements by tagname.
$elements = $dom->get_elements_by_tagname("Cell");
This seems to work fine untill I actually wanted to use the code on an XML file generated by Microsoft Excel; something that looks like this:
<?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="Sheet1">
etc.
But nothing worked. As soon as I removed the XML namespace declarations in the Workbook tag, the get_elements_by_tagname() seemed to work fine again.
- Is this a bug in the domxml implementation - and a reason not to use domxml yet?
- Is there a workaround?
I would like to use domxml since it costs me less time than coding sax handlers.
thnx