[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Nicer way to change context-node than xsl:for-each
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
|
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
|