RE: [xsl] Parsing an array as a parameter

Subject: RE: [xsl] Parsing an array as a parameter
From: "Jim Fuller" <jim.fuller@xxxxxxxxxxxxxx>
Date: Mon, 22 Dec 2003 11:02:33 -0000
Hello,

>From the java side you will need to marshal data from your Array object
to xml, then you will need to inject xml as an xslt parameter. 

To achieve the first step you could hand code up some marshalling code
or use any of the high quality libraries that exist today; castor or
Apache's  xmlbeans effort comes to mind. Alternately, you could leave it
up to the XSLT processor to do this if you are using JAXP/TRAX to call
the transform.

This depends on what XSLT processor you intend to invoke from your java
code...I would suggest reading up Elliotte Rusty Harold's
http://cafeconleche.org/books/xmljava/ to see how you generically invoke
an XSLT process in java. 

Generally you should be able to setParameter(String name, Object value),
whereby the Object value is marshaled into a type that makes sense for
XSLT.

GL, Jim Fuller



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