|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Interpretation of (preceding::foo)[1]
The XPath spec, Sec. 3.3.(Node-sets) contains this note: The meaning of a Predicate depends crucially on which axis applies. For example, preceding::foo[1] returns the first foo element in reverse document order, because the axis that applies to the [1] predicate is the preceding axis; by contrast, (preceding::foo)[1] returns the first foo element in document order, because the axis that applies to the [1] predicate is the child axis. The note seems to be ambiguous in that it doesn't say whether the two specifiers are being considered as expressions or as location paths, but there are problems of interpretation either way. If they are considered as expressions, then preceding::foo[1] is a location path treated as an expression while (preceding::foo)[1] is directly an expression consisting of the parenthesized expr (preceding::foo) narrowed by the predicate[1], and the child axis isn't applied, despite what the note says. But if they are considered as location paths, then the location path (preceding::foo)[1] seems to be an abbreviation of the location path child::(preceding::foo)[1], and the selected nodes, order aside, are the children of foo nodes rather than the foo nodes themselves. In this case the two node-sets to which the [1] predicate is applied are quite different. Am I misunderstanding this note or is there really something wrong with it? Paul Abrahams XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








