?
Solved

Java/XSL: Return array to XSL

Posted on 2006-06-27
13
Medium Priority
?
614 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

762 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