*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 125
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: 125
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
 
Similar Threads
xmlns and xsl
Hyper links Using XSL?
is it possible?
Using XSL to display XML
use Locale to display information from XML