On Sat, 23 Aug 2003, Dimitre Novatchev wrote:
"Robert P. J. Day" <rpjday(_at_)mindspring(_dot_)com> wrote in message
boning up on my predicates and patterns, i'm reading
kay, p. 443, which states:
"(chapter//footnote) is not a valid pattern. (Why not?
No good reason, it's just that the spec doesn't allow it."
It cannot be derived from the syntax of "Patterns" as specified in
If you remove the brackets you'll get a valid match pattern.
but on p. 408, there is an explanation of the (apparently
acceptable) path expression "(chapter/para)".
so is it just the difference between using the child axis
and the descendant-or-self axis? it's not obvious to me
why the first should be illegal while the second is legal.
Because the first is illegal *pattern* (it is a legal XPath expression).
Patterns are a strict subset of XPath expressions.
Patterns were introduced (in my opinion) to allow for some optimization
opportunities as well as for sanity in the template matching and
i can see why, *technically*, the above holds. i guess my confusion
is more that it's just non-intuitive, particularly since (according to
kay, p. 355), the expression "($chapters//diagram)" is legal.
so, we have
while i'm sure all of this holds according to the acceptable rules
of patterns, it sure doesn't do any favors for those looking for
obviously intuitive rules for what's legal and what isn't.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list