Solved

Java/XSL: Return array to XSL

Posted on 2006-06-27
13
610 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

729 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