added eMachines m68xx notebooks keyboards, closed #4000
[xorg/xkeyboard-config] / xslt / xfree86.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" 
3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4   >
5 <xsl:output method="xml"
6             encoding="UTF-8"
7             doctype-system="xkb.dtd"
8             indent="yes"/>
9   
10   <!-- Transform all "simple" elements as they are -->
11   <xsl:template match="@*|xkbConfigRegistry|layout|layoutList|model|modelList|group|option|optionList|variant|variantList">
12     <xsl:copy>
13       <xsl:apply-templates select="@*|*"/>
14     </xsl:copy>
15   </xsl:template>
16
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>
31           </xsl:if>
32         </xsl:for-each>
33       </xsl:if>
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>
44           </xsl:if>
45         </xsl:for-each>
46       </xsl:if>
47     </configItem>
48   </xsl:template>
49   
50 </xsl:stylesheet>