W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2002

Re: loosening restrictions on top-level conditionals/expressions

From: Werner Donné <werner.donne@re.be>
Date: Wed, 13 Mar 2002 10:43:37 +0100
Message-ID: <3C8F1F49.9050101@re.be>
To: "Dunning, John" <JDunning@goSPS.com>
CC: "'xsl-editors@w3.org'" <xsl-editors@w3.org>
I am very much in favour of this proposal. Conditional inclusion is a must.
Such functionality also exists in LaTeX for example.

I would go for solutions 1 and 2 though, not 3. xsl:element is used in the
construction of the result tree, while our goal is to assemble the style sheets
which will be used to construct the result tree.

Werner.

Dunning, John wrote:

> Greetings,
> In relation to a previous topic here ("conditionals not allowed at top
> level", 26 April 2001),  I would also like to request this (or equivalent)
> functionality, in the form of allowing expressions within
> xsl:include/import, or allowing <xsl:element> to be used as a top-level
> element.
> 
> Given the case where stylesheets are compiled from numerous modules, and
> particularly my case, where the language of the modules differ, it would be
> desirable to dynamically import/include stylesheet modules for that
> language.
> 
> Here is a brief example of what I would like to accomplish:
> 
> <!-- example document -->
> <document language="en">...</document>
> 
> <!-- solution 1, previously proposed -->
> <xsl:if test="language='en'">
> 	<xsl:include href="stylesheetModule_en.xsl"/>
> </xsl:if>
> 
> The next example could be accomplished by relaxing the restrictions on the
> import/include elements (allowing expressions to be evaluated).
> 
> <!-- solution 2 -->
> <xsl:include href="concat('stylesheetModule_',{@language},'.xsl')"/>
> <!-- or, $lang supplied at run-time (e.g., command-line) -->
> <xsl:include href="concat('stylesheetModule_',{$lang},'.xsl')"/>
> 
> This final example could be accomplished by allowing <xsl:element> to be
> used as a direct child of <xsl:stylesheet/transform>:
> 
> <!-- solution 3 -->
> <xsl:element name="xsl:include">
> 	<xsl:attribute name="href">
> 		<xsl:value-of select="concat('stylesheetModule_',
> @language,'.xsl'"/>
> 	</xsl:attribute>
> </xsl:element>
> <!-- or, $lang supplied at run-time (e.g., command-line) --><xsl:element
> name="xsl:include">
> 	<xsl:attribute name="href">
> 		<xsl:value-of select="concat('stylesheetModule_',
> $lang,'.xsl'"/>
> 	</xsl:attribute>
> </xsl:element>
> 
> Thanks for your consideration,
> John Dunning
> 
> 
> 
> 
> 


-- 
Werner Donné  --  Re BVBA
Engelbeekstraat 8
B-3300 Tienen
tel: (+32) 486 425803	e-mail: werner.donne@re.be
Received on Wednesday, 13 March 2002 06:40:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:52 GMT