This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: [newbie] Conditional Include
- To: xsl-list at mulberrytech dot com
- Subject: Re: [newbie] Conditional Include
- From: Richard Light <richard at light dot demon dot co dot uk>
- Date: Mon, 24 Jul 2000 12:14:51 +0100
- References: <004001bff55b$ecb1af40$01000000@karte76>
- Reply-To: xsl-list at mulberrytech dot com
In message <004001bff55b$ecb1af40$01000000@karte76>, Jean de Lavarene
<breux@online.fr> writes
>Good morning you'all,
>
>I am trying to do conditional include, like this :
>
><xsl:choose>
> <xsl:when test="$country='GUFRA'">
> <xsl:include href="GUFRA.xsl"/>
> </xsl:when>
> <xsl:otherwise>
> <!--Define here what to do if no country specified.-->
> </xsl:otherwise>
></xsl:choose>
>
>But this won't work because 'choose' are not allowed outside a template.
Even if choose were allowed outside a template, this approach wouldn't
work because xsl:include is a top-level element, i.e. it must be a child
of xsl:stylesheet.
You'll have to find some other way of expressing your conditional logic,
e.g. using a distinct mode for each country.
Richard Light.
Richard Light
SGML/XML and Museum Information Consultancy
richard@light.demon.co.uk
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list