S
Simon Brooke
I'm trying to do internationalisation by using xsl:include to include
a different file depending on the locale setting, and I'm completely
failing.
I've tried several different approaches:
<xsl:include href="concat( 'i18n-', $locale, '-include.xslt)"/>
fails with XSLT compile error: FileNotFoundException
---------------------
Could not find file 'C:\Projects\ADL\transforms01\concat( 'i18n-',
$locale, '-include.xslt)'.
<xsl:include>
<xsl:attribute name="href">
<xsl:value-of select="concat( 'i18n-', $locale, '-include.xslt)"/>
</xsl:attribute>
</xsl:include>
fails with 'Missing mandatory attribute'
<xslaram name="i18n-include" select="i18n-en-GB-include.xslt"/>
<xsl:include href="$i18n-include"/>
fails with XSLT compile error:.FileNotFoundException
---------------------
Could not find file 'C:\Projects\ADL\transforms01\$i18n-include'.
xsl:choose is not a valid child of xsl:stylesheet, so I can't do at
top level
<xsl:choose>
<xsl:when test="$lang='en-GB'">
<xsl:include href='i18n-en-GB-include.xslt'/>
</xsl:when>
</xsl:choose>
I'm running out of ideas. If anyone has successful recipes for
conditional include in XSL I'd love to hear them.
a different file depending on the locale setting, and I'm completely
failing.
I've tried several different approaches:
<xsl:include href="concat( 'i18n-', $locale, '-include.xslt)"/>
fails with XSLT compile error: FileNotFoundException
---------------------
Could not find file 'C:\Projects\ADL\transforms01\concat( 'i18n-',
$locale, '-include.xslt)'.
<xsl:include>
<xsl:attribute name="href">
<xsl:value-of select="concat( 'i18n-', $locale, '-include.xslt)"/>
</xsl:attribute>
</xsl:include>
fails with 'Missing mandatory attribute'
<xslaram name="i18n-include" select="i18n-en-GB-include.xslt"/>
<xsl:include href="$i18n-include"/>
fails with XSLT compile error:.FileNotFoundException
---------------------
Could not find file 'C:\Projects\ADL\transforms01\$i18n-include'.
xsl:choose is not a valid child of xsl:stylesheet, so I can't do at
top level
<xsl:choose>
<xsl:when test="$lang='en-GB'">
<xsl:include href='i18n-en-GB-include.xslt'/>
</xsl:when>
</xsl:choose>
I'm running out of ideas. If anyone has successful recipes for
conditional include in XSL I'd love to hear them.