[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: <xsl:for-each select="$myvar">

Subject: Re: <xsl:for-each select="$myvar">
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 19 Jun 2002 16:02:39 +0100
xsl for each select
> <xsl:param name="myvar"/>

That is special cased to set myvar to be an empty string.

the on the command line you probably go myvar=DEC and that (in most XSLT
systems) sets myvar to be the string 'DEC'

so going 

<xsl:for-each  select="$myvar"
is equivalent to going
<xsl:for-each select="'DEC'"

and gets the same error message as you can't for-each over a string.

Some XSLT systems let you pass in node sets as parameters, in which case
you'd want to set the default value to be
<xsl:param name="myvar" select="/.."/>
which is an empty node set, not an empty string
and do whatever sytem specific  calls you need to set the parameter to a
node set outside the stylesheet.

<xsl:for-each  select="$myvar"
would work.

If you want to pass in a string though, do something lik

<xsl:key name=manufacturer" match="item" use="manufacturer"/>

<xsl:for-each select="key('manufacturer',$myvar)">

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.