Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes XML and Related Technologies and the fly likes parameter to xsl from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "parameter to xsl from java" Watch "parameter to xsl from java" New topic

parameter to xsl from java

Thomas Greene
Ranch Hand

Joined: Aug 09, 2004
Posts: 126
I am sending a parameter to my xsl file from a java class using.
xformer.setParameter("lang", Language.getLocale().getLanguage());

This is my xml file

and this is my xsl file

But this xsl file does not display the param value.
Please help
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
The codelogic looks ok.
Did you tried to print and see the value from java before passing to xsl

also did you tried to see the value of <xsl:value-of select="$lang"/> in the beginning ?

There is also one sample program in Xalan pacakge called "XSLTWithParams" , check it for sample.

Spritle Software Blogs
Thomas Greene
Ranch Hand

Joined: Aug 09, 2004
Posts: 126
the problem was param should be before template.
I agree. Here's the link:
subject: parameter to xsl from java