[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|