PHP4, domxml and xpath with Namespaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I haven't yet worked with namespaces in XML before when it comes to DOM
related methods. My source is an Office 2003 Excel XML and it contains
XML like:

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<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";>
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"/>
 <Worksheet ss:Name="Sheet1">
  <Table ss:ExpandedColumnCount="256" ss:ExpandedRowCount="670"
x:FullColumns="1"
   x:FullRows="1" ss:DefaultColumnWidth="60">
   <Column ss:StyleID="s22" ss:AutoFitWidth="0" ss:Width="284.25"/>
   <Row>

How can I use an xpath expression to find e.g. all rows in Worksheet
"Sheet1" ?

My problem here is that the name of the Worksheet is in a namespace
attribute and I don't know how to express this as an xpath expression.

The following doesn't work, always returns an empty nodeset to me:
Worksheet[@ss:Name='Sheet1']

Can someone give me a push into the right direction?

thanks,
- Markus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux