This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: parametrized xsl
- To: Evgenii Bazarov <evgeniibazarov at usa dot net>
- Subject: Re: parametrized xsl
- From: Jeni Tennison <Jeni dot Tennison at epistemics dot co dot uk>
- Date: Tue, 23 May 2000 10:44:20 +0100
- Cc: <xsl-list at mulberrytech dot com>
- Reply-To: xsl-list at mulberrytech dot com
Evg,
>and I would like somehow to output only one chapter (e.g. "c4").
>The chapter number is based on the input from client.
>The xsl is more or less static, does it mean that I will
>have to deal with DOM representation
>of the XSL sheet, change it each time and run processor. Or
>maybe there is way to do this without touching Java?
If you can pass parameters to the stylesheet, then the following will work:
<xsl:param name="chapter" />
<xsl:template match="chapter">
<xsl:if test="@no = $chapter">
<xsl:copy-of select="." />
</xsl:if>
</xsl:template>
How you pass parameters to the stylesheet will depend on the XSLT processor
you're using and how you're using it.
Hope that helps,
Jeni
Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 • Fax 0115 9061304 • Email
jeni.tennison@epistemics.co.uk
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list