pr0blems / phpquery

Automatically exported from code.google.com/p/phpquery
0 stars 0 forks source link

Unable to query node with namespace:attribute pattern #131

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm trying to select a node ussing this selector:
table:table[@table:name="Sheet1"]

I've tested it with a php XPath code, it works (registering namespaces
required). But it doesn't work with phpquery. Any clues?

debug messages show:

<pre>Array
(
    [0] => FIND
    [1] => table:table[table:name="Sheet1"]
    [2] => Array
        (
            [0] => Array
                (
                    [0] =>  
                    [1] => table
                    [2] => :table
                    [3] => [table:name="Sheet1"]
                )

        )

)
</pre>
<pre>XPATH: //*[local-name()='table']</pre>
<pre>QUERY FETCHED</pre>
<pre>Matched 3: table:table, table:table, table:table</pre>
<pre>Unknown pseudoclass 'table', skipping...</pre>
<pre>XPATH:
/*[local-name()='office:document-content'][1]/*[local-name()='office:body'][1]/*
[local-name()='office:spreadsheet'][1]/*[local-name()='table:table'][1][@table:n
ame='Sheet1']</pre>
<pre>QUERY FETCHED</pre>
<pre>Nothing found</pre>
<pre>Matched 0: </pre>
<pre>XPATH:
/*[local-name()='office:document-content'][1]/*[local-name()='office:body'][1]/*
[local-name()='office:spreadsheet'][1]/*[local-name()='table:table'][2][@table:n
ame='Sheet1']</pre>
<pre>QUERY FETCHED</pre>
<pre>Nothing found</pre>
<pre>Matched 0: </pre>
<pre>XPATH:
/*[local-name()='office:document-content'][1]/*[local-name()='office:body'][1]/*
[local-name()='office:spreadsheet'][1]/*[local-name()='table:table'][3][@table:n
ame='Sheet1']</pre>
<pre>QUERY FETCHED</pre>
<pre>Nothing found</pre>
<pre>Matched 0: </pre>

Original issue reported on code.google.com by akhm...@gmail.com on 27 Aug 2009 at 8:48

Attachments:

GoogleCodeExporter commented 8 years ago
That's because phpQuery support CSS3 selectors, not XPath.

Check issue 25 for more information about XML namespaces implementation.

Original comment by tobiasz....@gmail.com on 27 Aug 2009 at 8:53