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]
Other format: [Raw text]

Re: passing parameters to XSL file


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


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