need clarifications on XPath vs pattern match
msf at mds.rmit.edu.au
Mon Dec 13 22:57:22 GMT 1999
Didier PH Martin wrote [re. XSLT patterns vs XPath expressions]:
> so, it seems that it is not the full set but it is a subset of XPath as
> long as the expression points to an object of type "node-set".
Not quite. See XSLT, section 5.2:
"A pattern must match the grammar for Pattern. A Pattern is a set of
location path patterns separated by |. A location path pattern is a
location path whose steps all use only the child or attribute axes.
Although patterns must not use the descendant-or-self axis, patterns
may use the // operator as well as the / operator. Location path
patterns can also start with an id or key function call with a literal
argument. Predicates in a pattern can use arbitrary expressions just
like predicates in a location path."
This paragraph is followed by a grammar spelling out the above.
See also XPath, section 2 "Location Paths".
> I guess that node-set will be defined in the information set specification.
> Are they, Will they? OK now I have a new problem: where a node-set is defined?
"Node-sets" are defined in XPath, section 3.3:
"A location path can be used as an expression. The expression returns
the set of nodes selected by the path."
> Yop, I was feeling better in bed this morning :-))
Bottom line: you can't fully understand the XSLT spec. w/o first
understanding XPath. (Arguably, the reverse is true also. ;-)
Multimedia Databases Group, RMIT, Australia.
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev