[p1][p2] vs. [p1 and p2]
"Richard Haven" <[email protected]> Tue, 8 Jun 2004 11:38:39 -0700
| Newsgroups | gmane.text.xml.xpath.general |
|---|---|
| Message-ID | <[email protected]> |
I think that //e[p1][3] describes the third of the list of "e" elements = in the document that satisfy [p1]; is this correct? In other words: //e[p1][p2] !=3D //e[p2][p1] The W3 specification (http://www.w3.org/TR/1999/REC-xpath-19991116) is = VERY ambiguous about this point: in 2.5 Abbreviated Syntax, it gives = these examples: para[@type=3D"warning"][5] selects the fifth para child of the context = node that has a type attribute with value warning=20 para[5][@type=3D"warning"] selects the fifth para child of the context = node if that child has a type attribute with value warning=20 However in 2 Location Paths, it gives these examples: child::para[attribute::type=3D'warning'][position()=3D5] selects the = fifth para child of the context node that [child] has a type attribute = with value warning=20 child::para[position()=3D5][attribute::type=3D"warning"] selects the = fifth para child of the context node if that child has a type attribute = with value warning=20 Given the typo in this latter pair of examples, I prefer the first pair. = Thank you for your attention