need clarifications on XPath vs pattern match
Lisa Rein
lisarein at finetuning.com
Tue Dec 14 01:09:23 GMT 1999
okay so is the conclusion of all of this is that:
1) XSLT's patterns MUST be XPath expressions
and also
2) I was WRONG when I said that was not the case earlier because:
Even when the value of a simple match pattern is nothing more than an
element name, that in itself is an XPath expression (being evaluated
from the root element, by default -- unless another context is
explicitly stated somewhere in the stylesheet).
I just want to make sure that this is a done deal. It's a pretty big
issue for there to be confusion about, if ya think about it. When I
realized I couldn't say "yes" or "no" without thinking for a minute, I
was a bit surprised. It should be a simple question with a simple yes
or no answer. This isn't one of those gray areas, is it?
With all that in mind, I ask again to the group:
Are we all in agreement here? (with the above statements 1 & 2 above)
Just checking :-)
thanks,
lisa
Michael Fuller wrote:
>
> 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 :-))
>
> Me too.
>
> Bottom line: you can't fully understand the XSLT spec. w/o first
> understanding XPath. (Arguably, the reverse is true also. ;-)
>
> Michael
> --
> http://www.mds.rmit.edu.au/~msf/
> 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;
> unsubscribe xml-dev
> To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
> subscribe xml-dev-digest
> List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
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;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list