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

RE: Passing a variable number of parameters or rather

Subject: RE: Passing a variable number of parameters or rather an array
From: "kent" <kent@xxxxxxxxxxxxxxxxx>
Date: Wed, 20 Apr 2005 15:38:52 +0100
variable in xsd
Good idea, but couldn't I simply do this:

<xsl:param name="fruits">Apple Orange Guava</</xsl:param>

and then tokenize? tokenize(<xsl:value-of select="$category"/>, "\s+")

With tokenize, how do I iterate over the results?

Thanks for the help.


-----Original Message-----
From: Ramkumar Menon [mailto:ramkumar.menon@xxxxxxxxx]
Sent: Wednesday, April 20, 2005 3:12 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Passing a variable number of parameters or rather an
array

Kent,
wouldnt passing a xml schema list help ?

e,g,

<xsd:simpleType name="fruitType">
  <xsd:list type="xsd:string"/>
</xsd:simpleType>
<xsd:element name="fruits" type="fruitType"/>


<fruits>Apple Orange Guava</fruits>

Within your stylesheet, you could tokkenize it [use the XPath Function
tokenize() and use whitespace as the delimiter]  and use each item
within the list.
  e.g. somethng like tokenize($fruits,' ')



HTH

On 4/20/05, kent <kent@xxxxxxxxxxxxxxxxx> wrote:
> I have had a trawl on this subject, but I the best answer I can get is
'You
> can pass a nodeset, which can be treated as the XML equivalent of an
Array'.
> However I am not sure how to create the nodeset, pass it, and then deal
with
> it in the stylesheet.
>
> I would like to pass an array of strings to the stylesheet. Does anyone
have
> an example of doing this, or know where one is. I looked at xalan examples
> and none of the examples seem to fit, plus I can't find one anywhere else.
>
> Any help would be grand.
>
> Thanks.
>
> Kent
>
>


--
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!

-Ramkumar Menon
 A typical Macroprocessor

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.