Solved

Java/XSL: Return array to XSL

Posted on 2006-06-27
13
598 Views
Last Modified: 2008-02-01
We need to return a resulting array to XSL. How to do in XSL?
0
Comment
Question by:go4java
13 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 16999322
Not sure what you are trying to do, but you will need to start here: http://xml.apache.org/xalan-j/index.html
0
 

Author Comment

by:go4java
ID: 16999429
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
 
LVL 35

Expert Comment

by:girionis
ID: 16999465
When you say script you mean the xsl file that will do the transformation?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:go4java
ID: 16999515
YES
0
 
LVL 35

Expert Comment

by:girionis
ID: 16999556
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
 

Author Comment

by:go4java
ID: 16999620
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
 
LVL 35

Expert Comment

by:girionis
ID: 16999703
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
 

Author Comment

by:go4java
ID: 17000004
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
 
LVL 35

Expert Comment

by:girionis
ID: 17000067
You will have to recreate the XSL file and assign the values of the java array wherever you want them.
0
 
LVL 12

Expert Comment

by:jkmyoung
ID: 17004315
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
 

Author Comment

by:go4java
ID: 17062014
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
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17258220
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 115
eclipse shortcuts 9 55
Error trying to install RTMT Win7 5 60
why cannot we forward request once the response is committed 2 42
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question