Passing arguments to XSLT

A

ashuvashi

Hi Friends,

I m using XSLT. I would like to pass some value as arguments to that and
that should be used in future usage.

Please help me.

Thanks in Advandce.
Ashesh Vashi
 
M

Martin Honnen

ashuvashi wrote:

I m using XSLT. I would like to pass some value as arguments to that and
that should be used in future usage.

Within the XSLT stylesheet declare global parameters e.g.
<xsl:param name="arg1" />
or if you want a defaut value e.g.
<xsl:param name="arg1" select="'value 1'" />
Then in your Java code you can use the setParameter method e.g.
transformerInstance.setParameter(
"arg1",
"value 2"
);
to set the parameter before you do the transformation.

Within the stylesheet code you can then use $arg1 to access the
parameter value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top