Closed GoogleCodeExporter closed 9 years ago
Your understanding is incorrect.
Quoting XML XPath recommendation examples, section 2.5 Abbreviated Syntax:
//para selects all the para descendants of the document root and thus selects
all para elements in the same document as the context node
.//para selects the para element descendants of the context node
In this case, context node is the one you're using select_nodes on, so your
query should scan the entire document.
"Current" node from w3schools likely means the case when // is used in the
middle of a path, i.e. keyword[@name='get']//item. In this query only item
descendants of the get keyword will be found; the case where the XPath query
begins with // is special in XPath grammar.
You can change the query to ".//keywords/keyword" to get the expected results.
Original comment by arseny.k...@gmail.com
on 4 Jul 2011 at 6:47
thank you very much! It's my fault~~
Original comment by xinlin...@gmail.com
on 4 Jul 2011 at 7:11
Original issue reported on code.google.com by
xinlin...@gmail.com
on 4 Jul 2011 at 6:38Attachments: