Subject: Re: [xsl] Nicer way to change context-node than xsl:for-each ? From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx> Date: Sat, 5 Dec 2009 16:22:57 +0530 |
On Sat, Dec 5, 2009 at 3:55 PM, David Carlisle <davidc@xxxxxxxxx> wrote: >> <xsl:template match="foo"> >> B <xsl:variable name="x" select="*[1]" /> >> B <xsl:value-of select="$x" /> >> B <!-- 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Nicer way to change conte, David Carlisle | Thread | Re: [xsl] Nicer way to change conte, David Carlisle |
RE: [xsl] Generic stylesheet to fla, Michael Kay | Date | Re: [xsl] Nicer way to change conte, David Carlisle |
Month |