This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: passing parameters to XSL file
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 20 Jun 2002 02:20:06 -0600 (MDT)
- Subject: Re: [xsl] passing parameters to XSL file
- Reply-to: xsl-list at lists dot mulberrytech dot com
Krishnam Raju wrote:
> How to pass parameters to XSL file from servlets?
This ultimately depends on the API of the XSLT processor that you are using;
check the docs for it. If it supports JAXP (it should), then you should be
able to pass stylesheet parameters using the setParameter method on the
Transformer object.
> How to read that parameter in XSL file.
For example:
<xsl:param name="p1"/>
<xsl:param name="p2" select="'default value if none passed in'"/>
at the top level (after xsl:stylesheet, usually before the first xsl:template)
Thereafter in any template you can reference $p1 and $p2.
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list