[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?

Subject: Re: How to assign a sequence to a variable?
From: Manfred Staudinger <manfred.staudinger@xxxxxxxxx>
Date: Tue, 9 Aug 2005 16:20:09 +0200
assign sequence to 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
> ________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.