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


Cool!
  Solution is simple if you are using lets say xalan - so all you need to do
is to use ->

setStylesheetParam(String, String) - Method in class
org.apache.xalan.client.XSLTProcessorApplet
Submit a stylesheet parameter.

XSLTProcessor processor =XSLTProcessorFactory.getProcessor();
processor.setStylesheetParam("newvar","\""+styleParam+"\"");
processor.process(xmlSource, xslSource,htmlOutput);

and declare global param in stlyesheet (use same name).

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:strip-space elements="*"/>
<xsl:output method= "html"/>
<xsl:paramname="newvar">Hello</xsl:param>
<xsl:template match="/">
................................


C'ya
Sumev

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Katie McNally
Sent: Monday, August 06, 2001 5:04 PM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] 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?  Our XSLT template is converting XML to HTML.
The first and last names are not in the XML. What is the best way to display
this data?

Thanks,
Katie

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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]