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]

Re: [newbie] Conditional Include


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

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