xsl-list
[Top] [All Lists]

Re: [xsl] Nicer way to change context-node than xsl:for-each ?

2009-12-05 05:53:41
On Sat, Dec 5, 2009 at 3:55 PM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:
<xsl:template match="foo">
 <xsl:variable name="x" select="*[1]" />
 <xsl:value-of select="$x" />
 <!-- can do other things, on "x" -->
</xsl:template>

the for-each wasn't needed for value-of but it is needed to change the
context for call-template, which the original post indicated was also
required.

seems, I misunderstood the requirements.

If a change in context was required for call-template, I might have
modeled this, by having another parameter for *[1] on call-template
(which might be a better design decision, as it encourages loose
coupling!), instead of modeling this requirement as a loop.



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--