This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: RE: Using a java variable inside XSLT
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] RE: Using a java variable inside XSLT
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Tue, 7 Aug 2001 10:08:59 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> We are attempting to display a first and last name in HTML
> using XSLT. We
> obtained the first and last name from the session object and
> put the values
> into a java variable. How can we display the value of our
> java variable in
> HTML using an XSLT template?
Just pass the values into the transformation as global parameters.
In the stylesheet, write
<xsl:param name="firstname"/>
etc
In the application, assuming you are using a Java processor with the JAXP
1.1 API,
write
Transformer transformer = templates.newTransformer();
transformer.setParameter('firstname', value);
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list