wood burning stoves 2.0*
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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "parameter to xsl from java" Watch "parameter to xsl from java" New topic
Author

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
Bartender

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: http://aspose.com/file-tools
 
subject: parameter to xsl from java