473,486 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

[XSL] : how to get the value of a variable defined in a program ?

MC
HI to all,

First excuse me but i'm xsl beginner.

I'm using XSL to transform an xml file into another. I'm using a Java
program for the transformation (TraX API).

I would like to recover in the xsl stylesheet the value of a variable
defined in my Java program. Is it possible ?

Thanks a lot for yours answers

Marie
Jul 20 '05 #1
2 2078


MC wrote:
I'm using XSL to transform an xml file into another. I'm using a Java
program for the transformation (TraX API).

I would like to recover in the xsl stylesheet the value of a variable
defined in my Java program. Is it possible ?


You can pass in parameters to the processor before running a
transformation, see
<http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/Transformer.html#setParameter(java.lang.String,%20 java.lang.Object)>
That parameter needs to be declared in the XSLT stylesheet e.g.
<xsl:param name="paramName" />
and then the stylesheet elsewhere uses
$paramName
in expressions.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
MC
Thanks a lot. It works very well ;-)

Marie
Martin Honnen a écrit :


MC wrote:
I'm using XSL to transform an xml file into another. I'm using a Java
program for the transformation (TraX API).

I would like to recover in the xsl stylesheet the value of a variable
defined in my Java program. Is it possible ?

You can pass in parameters to the processor before running a
transformation, see
<http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/Transformer.html#setParameter(java.lang.String,%20 java.lang.Object)>

That parameter needs to be declared in the XSLT stylesheet e.g.
<xsl:param name="paramName" />
and then the stylesheet elsewhere uses
$paramName
in expressions.

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2544
by: Simon Harvey | last post by:
Hi everyone, I am fairly new to learning about xsl and xml, but one thing I have noticed is that anyone offering a tutorial or lesson on it seems to think that its the most incredible invention...
8
2326
by: Sebastian Kerekes | last post by:
Greetings, I'm developing an application that supports multiple languages. In my XSL I use variables to place the text where it belongs to. At the top of the document I include those variables -...
1
3072
by: MC | last post by:
Hi to all, I would like to use in a XSL stylesheet an array variable which is defined in a Java program. For example, in my program, i defined a tab variable String tab = {"first", "second",...
3
3120
by: Blaise Garant | last post by:
Hi I've made a stylesheet to transform my data into XSL-FO. This stylesheet used to work with MSXSL 4.0 but I've got some issues in ..NET. First, I changed removed all the "node-set()" function...
4
1564
by: Piper707 | last post by:
I need help with using a general template which would process all tags other than the ones for which specific templates have been written. My XML looks like this: <ITEMS>...
0
1297
by: Piper707 | last post by:
I need help with using a general template which would process all tags other than the ones for which specific templates have been written. My XML looks like this: <ITEMS>...
0
1064
by: Patrick.O.Ige | last post by:
I have a xml file and i want to format it using XSL I needed to do a distinct which is ok on the first node "Code" But when it gets to the "programDescription" node it prints out values for both...
6
14145
by: Jody Gelowitz | last post by:
I have run into an issue with variable scope within an XSLT document that is translated in VS.NET 2.0. Under VS.NET 1.1 (XslTransform), this code works fine. However, when using VS.NET 2.0...
11
4921
by: coflo | last post by:
Hello I would like to replace an a href link that is provided in the RSS below with my own link. The link that I am looking to replace is defined in the <description> tag within the RSS. Im...
0
7100
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7126
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5434
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4865
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.