xsl-list
[Top] [All Lists]

Re: How to assign a sequence to a variable?

2005-08-09 07:04:05

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
________________________________________________________________________

--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>