loosening restrictions on top-level conditionals/expressions

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

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

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"/>

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_',
<!-- or, $lang supplied at run-time (e.g., command-line) --><xsl:element
	<xsl:attribute name="href">
		<xsl:value-of select="concat('stylesheetModule_',

Thanks for your consideration,
John Dunning

Received on Tuesday, 12 March 2002 14:55:37 UTC