Solved

Java/XSL: Return array to XSL

Posted on 2006-06-27
13
596 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
 

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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 55
Updating Java 9 87
wordcount challenge 11 74
advertisement module in core php 4 81
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now