Subject: Re: [xsl] building a mental model for the "current node" behavior From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 5 Nov 2020 22:04:27 -0000 |
On Thu, 5 Nov 2020 at 14:46, Martin Honnen martin.honnen@xxxxxx <mailto:martin.honnen@xxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx <mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>> wrote:
Am 05.11.2020 um 15:11 schrieb Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx <mailto:christopher.papademetrious@xxxxxxxxxxxx>:
grasp:> As a novice, I get confused remembering when the current node > does/doesnbt change. Therebs also this, which Ibm trying to
> > https://www.w3.org/TR/xslt-30/#func-current <https://www.w3.org/TR/xslt-30/#func-current> > > Whatbs a good mental model for remembering this? > > 2. Inside an <xsl:template> block, is there a function that returns the > current **template-matched** node?
That is what the B B current() function does, I am currently not sure why you first cite it and then seem to ask for another function doing the job of the current() function.
No Christopher was correct, there is no function that does what he asks, and you need to use a variable. current() is theB node at the beginning of the xpath not the surrounding template.
Given
<xsl:template match="wibble">
<xsl:for-each select=".//zzz">
<xsl:value-of select=" something with current()"/>
then current() is the zzz node, and wibble is not accessible unless you saved it in a variable before the for-each.
That's true, guess my only excuse is that I did eliminate pull processing from my mental model long before Gerrit punished it with his score :)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] building a mental model f, David Carlisle d.p.c | Thread | [xsl] Random UUID in pure XSLT?, Piez, Wendell A. (Fe |
Re: [xsl] building a mental model f, David Carlisle d.p.c | Date | Re: [xsl] HTML5 and MathML and name, Chris Papademetrious |
Month |