1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 <xsl:output method="xml"
7 doctype-system="xkb.dtd"
10 <!-- Transform all "simple" elements as they are -->
11 <xsl:template match="@*|xkbConfigRegistry|layout|layoutList|model|modelList|group|option|optionList|variant|variantList">
13 <xsl:apply-templates select="@*|*"/>
17 <!-- Tricky business: configItem -->
18 <xsl:template match="configItem">
19 <configItem xsl:space="preserve">
20 <name><xsl:value-of select="./name"/></name>
21 <!-- If there are some shortDescriptions -->
22 <xsl:if test="count(./shortDescription)!=0">
23 <!-- First, put the non-translated version -->
24 <shortDescription><xsl:value-of select="./shortDescription[not(@xml:lang)]"/></shortDescription>
25 <!-- For all translated versions ... -->
26 <xsl:for-each select="./shortDescription[@xml:lang]">
27 <!-- ... which are different from non-translated one ... -->
28 <xsl:if test="../shortDescription[not(@xml:lang)]/text() != ./text()">
29 <!-- ... - output! -->
30 <shortDescription xml:lang="{./@xml:lang}"><xsl:value-of select="./text()"/></shortDescription>
34 <!-- If there are some descriptions -->
35 <xsl:if test="count(./description)!=0">
36 <!-- First, put the non-translated version -->
37 <description><xsl:value-of select="./description[not(@xml:lang)]"/></description>
38 <!-- For all translated versions ... -->
39 <xsl:for-each select="./description[@xml:lang]">
40 <!-- ... which are different from non-translated one ... -->
41 <xsl:if test="../description[not(@xml:lang)]/text() != ./text()">
42 <!-- ... - output! -->
43 <description xml:lang="{./@xml:lang}"><xsl:value-of select="./text()"/></description>