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: servlet to xsl


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


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