RE: [xsl] Parsing an array as a parameter

Subject: RE: [xsl] Parsing an array as a parameter
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 22 Dec 2003 11:09:51 -0000
The mappings from Java classes to XPath types aren't defined in any
standard, they depend on the product you are using.

Saxon 7.x, which implements XSLT 2.0 and XPath 2.0, will map an array of
strings to an XPath sequence of strings. But XPath 1.0 doesn't support
sequences of strings in its type system, so it's unlikely that an XSLT
1.0 processor will do the same. Your best bet would be to construct an
XML document in which the strings are represented as elements, and then
pass the root node of the document as a parameter.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> kelsonho@xxxxxxxx
> Sent: 22 December 2003 05:56
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Parsing an array as a parameter
> 
> 
> Hi
> I am new to XSLT...so I am not sure if this is possible..
> 
> I use JSP to invoke XSLT...and I want to achieve the following:
> 
> Given an array in Java, I want to parse the array as A XSLT 
> parameter and then transform it using for-each..
> 
> Eg. I have a parameter call "students"..which would contain a 
> list of names of students...
> 
> ie: String [] students;
> 
> Can I do something like: 
> studentTransformer.setParameter("students",students
> []);???
> 
> Anyways, thanks for reading..
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


Current Thread