Re: Context node/Predicates in Expressions

Subject: Re: Context node/Predicates in Expressions
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 26 May 2000 12:08:01 +0100 (BST)
> The match attribute on xsl:template, unlike the select attribute on other
> instructions, is a pattern does not have a context node; it is the 'foo'
> in hrrrm::foo, where hrrrm is an axis (whose name I just made up) that
> contains only the nodes that are in the current node list: the nodes that
> have been identified for processing by an xsl:apply-templates instruction.
> At least, that's one way of looking at it.
> So match="body" will match any element named body in the null namespace,
> from the set of nodes in the current node list, and should not be
> interpreted as child::body relative to one node in particular.

While it is probably simpler to think of match patterns in that way
that is not actually how they are defined.


_does_ have an implied child axis, just as in a select attribute.
"body" matches 
node in the current node list that
  has name body and is in the null namespace and for which there exists
  some node, N, anywhere in the source tree such that the body element is a
  child of N.

Since all elements are the child of some node, this last clause doesn't
make any extra restriction in this case.

In general a node, x, is matched by a pattern match="p" if there exists a
node, N, in the source tree, such that if you took N as the context node
then x would be in the node set returned by select="p".


 XSL-List info and archive:

Current Thread