[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to assign a sequence to a variable?
Hi David, yes, with both as="item()*" and <xsl:sequence it works fine. Thanks, Manfred On 8/9/05, David Carlisle <davidc@xxxxxxxxx> wrote: > > If you go > > <xsl:variable name="tempb"> > <xsl:value-of select="'b1','b2','b3'"/> > </xsl:variable> > > Then you generate a sequence of length 1 consisting of a document node, > this document node has a single text node child consisting of teh result > of applying value-of. > > So don't do that, either use a select attribute as in tempa or use as="item()*" > also (as in xslt1) xsl:value-of always generates a text node, and here > you want a sequence so use xsl:sequence instead: > > <xsl:variable name="tempb" as="item()*"> > <xsl:sequence select="'b1','b2','b3'"/> > </xsl:variable> > > same in teh call-template case: > > <xsl:message select="$tempb[1]"/> > <xsl:variable name="tempc" as="item()*"> > <xsl:call-template name="processName"> > </xsl:call-template> > </xsl:variable> > <xsl:message select="$tempc[1]"/> > </xsl:template> > <xsl:template name="processName"> > <xsl:sequence select="'c1','c2','c3'"/> > </xsl:template> > > David > > ________________________________________________________________________ > This e-mail has been scanned for all viruses by Star. The > service is powered by MessageLabs. For more information on a proactive > anti-virus service working around the clock, around the globe, visit: > http://www.star.net.uk > ________________________________________________________________________
|
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
|