Java/XSL: Return array to XSL

We need to return a resulting array to XSL. How to do in XSL?
go4javaAsked:
Who is Participating?
 
CetusMODCommented:
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0
 
girionisCommented:
Not sure what you are trying to do, but you will need to start here: http://xml.apache.org/xalan-j/index.html
0
 
go4javaAuthor Commented:
Yes, that is known. Xalan is a Java XSLT engine.
My question is on how to RETURN a Java ARRAY to XSL script.
I've a Java method and the resulting array should be transferred to XSL...
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
girionisCommented:
When you say script you mean the xsl file that will do the transformation?
0
 
go4javaAuthor Commented:
YES
0
 
girionisCommented:
How do you create the script? Do you do it via Java? If yes then you will need to loop through the array and write the proper values into the script.
0
 
go4javaAuthor Commented:
The XSL script is been created with Stylus Studio, the Java servlet with NetBeans.
We need an XSL script on how to process the array returned by Java.
0
 
girionisCommented:
Sorry, I am lost again. You have an XSL script with some rules on how to turn XML into some content. Now you want to pass information from a Java array in there? Is this correct?
0
 
go4javaAuthor Commented:
Basically, yes.
In XSL, you have the possibility to store data to 'variables' or 'parameters'.
I need to loop over the array which has to be imported from Java method.
0
 
girionisCommented:
You will have to recreate the XSL file and assign the values of the java array wherever you want them.
0
 
jkmyoungCommented:
Are you treating the array as a single xml file for the xsl to parse through?
Then serialize the array, and pass the memory to an xsl processor as input.

Also, it may be simpler to have your xsl call java extension functions instead of the other way around.
0
 
go4javaAuthor Commented:
We solved the problem as follows:
- Call a Java method to fill an array with file names
- Tokenize file list with a seperator, e.g. semicolon and store to String
- Return String to XSL and loop recursively through the file string
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.