multilanguage.xsl 1000 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
<?xml version="1.0" encoding="iso8859-1" ?>

<!-- VideoLAN - Stylesheet for multilanguage -->
<!-- Written by Alexis de Lattre <alexis@videolan.org> -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml"
            encoding="iso8859-1"
10
            doctype-public="-//OASIS//DTD DocBook XML V4.1//EN"
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
            doctype-system="/usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd"
            indent="yes"
/>

<!-- <xsl:param name="lang">en</xsl:param>  -->

<!-- delete the span that are not of the good language -->

<xsl:template match="span[not(lang($lang))]"></xsl:template>

<!-- take the right language and copy it without the span tag  -->

<xsl:template match="span[lang($lang)]">
   <xsl:copy-of select="attribute[name()!='lang']|node()"/>
</xsl:template>

<!-- copy the docbook tags -->

<xsl:template match="@*|node()">
   <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>