Re: [xsl] building a mental model for the "current node" behavior

Subject: Re: [xsl] building a mental model for the "current node" behavior
From: "Dave Pawson dave.pawson@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Nov 2020 16:50:18 -0000
On Thu, 5 Nov 2020 at 14:46, Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Am 05.11.2020 um 15:11 schrieb Chris Papademetrious

> > As a novice, I get confused remembering when the current node
> > does/doesnbt change. Therebs also this, which Ibm trying to grasp:
> >
> > 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
>    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.

I think:
  This relates to understanding the mental model?

My view:
  'here' (.) is the current node / position in the input document tree
that is being processed.

View the 'tree' in your head, and you may see the parents, siblings,
children of this node (point in the document tree).
Ken Holman has (had?) a good picture of this which may help.
  Then decide what you want to do next?
  When you have this model in your head comfortably, you may be happy using
xsl:apply-templates to process the children of the current-node, using
the xsl 'model'.


HTH



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.

Current Thread