Solved

Java/XSL: Return array to XSL

Posted on 2006-06-27
13
603 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
Independent Software Vendors: 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat startup error 5 136
Tomcat: Unable to run tomcat service. 2 30
ejb example issues 3 55
Java: The Public Class Main 4 46
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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

730 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