Subject: Re: [xsl] Context node traversal inside predicates (was: Nodes and Strings) From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Tue, 26 Jul 2005 15:51:13 +0200 |
The 'context()' function would be similar to the 'current()' fuction. It would recall previous context nodes.
'context(n)' would recall the n-th context node (as found when propagating upwards in the predicates of the expression)
e.g.: 'context(0)' is equal to '.' 'context(1)' is equal to the context node as constructed by the immmediately outer predicate. ... 'context(-1)' would be equal to the context node as found in the outermost predicate.
Something like this was in an early draft of XPath 1.0, and was implemented
(IIRC) in WD-xsl, though I've rarely seen it used in practice.
I think the idea of manually addressing the stack of context variables is
very error-prone and counter-intuitive. The proper way to do this is to
declare a range variable. In XQuery you can do this using the "let" clause
of the FLWOR expression; XPath 2.0 has a poor man's version in the "for"
expression
kind regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) "NN= N?N/N4N1 OON9 N?ON4N-N= N?N/N4N1" - N#O N:ON1ON7O
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] skeleton1-5.xsl for XSLT , Aron Bock | Thread | Re: [xsl] Context node traversal in, Dimitre Novatchev |
RE: [xsl] Context node traversal in, Michael Kay | Date | Re: [xsl] skeleton1-5.xsl for XSLT , Colin Paul Adams |
Month |