This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: RE: Using a java variable inside XSLT


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]