summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-05-27 10:07:37 +1000
committerSergey Udaltsov <sergey.udaltsov@gmail.com>2020-06-02 20:04:48 +0000
commitaf262b777e20b653bad9bbed869ffdbd09dfff76 (patch)
tree544dc7102453573e36ed5c75435f5f5b57829a8d /tests
parentd2a8950b42fb07b26a4377bf5bf00c442327dcd7 (diff)
xslt: move the reg2ll.xsl to the test dir where it is used
It's not used anywhere other than in a test, so let's update that and move the script there.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/genLists4Comparizon.sh4
-rw-r--r--tests/reg2ll.xsl23
2 files changed, 25 insertions, 2 deletions
diff --git a/tests/genLists4Comparizon.sh b/tests/genLists4Comparizon.sh
index 7b1330d5..d7c92421 100755
--- a/tests/genLists4Comparizon.sh
+++ b/tests/genLists4Comparizon.sh
@@ -12,8 +12,8 @@ F2=gn2ll.lst
F1b=${F1}base
F1e=${F1}extras
-xsltproc $ROOT/xslt/reg2ll.xsl $ROOT/rules/base.xml > $F1b
-xsltproc $ROOT/xslt/reg2ll.xsl $ROOT/rules/base.extras.xml | \
+xsltproc reg2ll.xsl $ROOT/rules/base.xml > $F1b
+xsltproc reg2ll.xsl $ROOT/rules/base.extras.xml | \
grep -v "sun_type" > $F1e
cat $F1b $F1e | sort | uniq > $F1
diff --git a/tests/reg2ll.xsl b/tests/reg2ll.xsl
new file mode 100644
index 00000000..598eb0fc
--- /dev/null
+++ b/tests/reg2ll.xsl
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ >
+<xsl:output method="text"
+ encoding="UTF-8"
+ doctype-system="xkb.dtd"
+ indent="no"/>
+
+<xsl:template match="modelList|optionList|name|description|shortDescription|configItem"/>
+<xsl:strip-space elements="*"/>
+
+<xsl:template match="layoutList"><xsl:apply-templates select="./layout"/></xsl:template>
+
+<xsl:template match="variantList"><xsl:apply-templates select="./variant"/></xsl:template>
+
+<xsl:template match="layout"><xsl:text>
+</xsl:text><xsl:value-of select="./configItem/name"/>:"<xsl:value-of select="./configItem/description"/>"<xsl:apply-templates match="./variantList/variant"/></xsl:template>
+
+<xsl:template match="variant"><xsl:text>
+</xsl:text><xsl:value-of select="../../configItem/name"/>(<xsl:value-of select="./configItem/name"/>):"<xsl:value-of select="./configItem/description"/>"</xsl:template>
+
+</xsl:stylesheet>