This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: servlet to xsl
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: shaik <shaik_xml at yahoo dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 13 Jun 2002 09:05:46 +0100
- Subject: Re: [xsl] servlet to xsl
- Organization: Jeni Tennison Consulting Ltd
- References: <20020613035610.31703.qmail@web14804.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Shaik,
> Could you please tell me how could i get the set Parameter in .xsl ?
First, you have to declare a stylesheet parameter of the same name
using an xsl:param element at the top level of the stylesheet (as a
child of xsl:stylesheet):
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="xslSpec" />
...
</xsl:stylesheet>
You can use a select attribute, or the content of the xsl:param
element, to specify a default value for the parameter when the
stylesheet's used without fixing it (e.g. using .setParameter()).
Then, throughout the rest of the stylesheet, you can access the value
of that parameter like you do variable values, using the variable
reference $xslSpec. For example:
<xsl:template match="rating-and-specification">
<xsl:value-of select="$xslSpec" />
</xsl:template>
The ability to declare and use stylesheet parameters is built in to
XSLT -- you don't have to use extension functions to do it.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list