[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

building a mental model for the "current node" behavio

Subject: building a mental model for the "current node" behavior
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Nov 2020 14:11:21 -0000
 building a mental model for the "current node" behavio
I'm trying to better my understanding of "current node" behavior in XSLT, and
I have a couple questions.


1. Which stylesheet elements select the current node "."?

"How XPath Context Is Initialized" at

https://www.lenzconsulting.com/how-xslt-works/

states that aside from template matches, only <for-each> (and
<foreach-in-group>) change the current node ".". However, other XSLT
stylesheet elements provide a @select attribute:

<xsl:copy select="...">
  ...
</xsl:copy>
<xsl:message select="...">
  ...
</xsl:message>

As a novice, I get confused remembering when the current node does/doesn't
change. There's also this, which I'm trying to grasp:

https://www.w3.org/TR/xslt-30/#func-current

What's a good mental model for remembering this?


2. Inside an <xsl:template> block, is there a function that returns the
current *template-matched* node?

For example, let's say I'm looping through the contents of a variable and I
want to <xsl:copy> my current template node in each iteration. Is there a
function to reference it without having to stuff it in a variable at the
beginning of the template? I don't see such a function in the spec, but it
could be eluding me.


Thanks!

-----
Chris Papademetrious
Tech Writer, Implementation Group
(610) 628-9718 home office
(570) 460-6078 cell

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.