status 1896 : resolved later
Mainly testing scmbug... Andrew reports this not working
This commit is contained in:
parent
30260bd69e
commit
5d25331d7b
|
@ -7,7 +7,7 @@
|
|||
|
||||
<!--
|
||||
Application Description Language framework
|
||||
i18n-en-GB-include.xsl
|
||||
i18n-en-GB-include.xslt
|
||||
|
||||
(c) 2007 Cygnet Solutions Ltd
|
||||
|
||||
|
@ -22,8 +22,8 @@
|
|||
Templates are listed in alphabetical order.
|
||||
|
||||
$Author: sb $
|
||||
$Revision: 1.2 $
|
||||
$Date: 2008-05-27 16:27:32 $
|
||||
$Revision: 1.3 $
|
||||
$Date: 2008-05-29 10:26:47 $
|
||||
-->
|
||||
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
|
|
51
transforms01/localise-transform.xslt
Executable file
51
transforms01/localise-transform.xslt
Executable file
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xslo="http://www.w3.org/1999/XSL/TransformAlias"
|
||||
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
|
||||
<!--
|
||||
Application Description Language framework
|
||||
localise-transform.xslt
|
||||
|
||||
(c) 2007 Cygnet Solutions Ltd
|
||||
|
||||
Highly experiemental.
|
||||
It is not possible in XSLT to do conditional includes, so you can't do, for example
|
||||
<xsl:include href="concat( 'i18n-', $locale, '-include.xslt')"/>
|
||||
The object of this file is to take an xslt transform and rewrite the localisation
|
||||
for the specified locale, passing everything else through unaltered.
|
||||
|
||||
$Author: sb $
|
||||
$Revision: 1.1 $
|
||||
$Date: 2008-05-29 10:26:47 $
|
||||
-->
|
||||
<xsl:namespace-alias stylesheet-prefix="xslo" result-prefix="xsl"/>
|
||||
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
|
||||
<!-- The locale for which the localised transforms are generated. -->
|
||||
<xsl:param name="locale" select="en-GB"/>
|
||||
|
||||
<!-- in practice, en-GB is our default locale for now -->
|
||||
<xsl:template match="xsl:include[href='i18n-en-GB-include.xslt']">
|
||||
<xslo:include>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat( 'i18n-', $locale, '-include.xslt')"/>
|
||||
</xsl:attribute>
|
||||
</xslo:include>
|
||||
</xsl:template>
|
||||
|
||||
<!-- if this works, we may use a magic token in the master file(s) -->
|
||||
<xsl:template match="xsl:include[href='replace-with-localisation-include-name']">
|
||||
<xslo:include>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="concat( 'i18n-', $locale, '-include.xslt')"/>
|
||||
</xsl:attribute>
|
||||
</xslo:include>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="@* | node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@* | node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
Loading…
Reference in a new issue