aboutsummaryrefslogtreecommitdiff
path: root/sort.xsl
blob: bc7552475708077790e8372233f43a95ac7b2553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.tei-c.org/ns/1.0">

    <xsl:output encoding="UTF-8" indent="yes" />
    <xsl:strip-space elements="*"/>

    <xsl:template match="text()[not(string-length(normalize-space()))]"/>

    <xsl:template match="*[local-name() = 'text']/*[local-name() = 'lexicon']">
        <body>
            <xsl:apply-templates select="*[local-name() = 'ar']">
                <xsl:sort select="*[local-name() = 'k']"/>
            </xsl:apply-templates>
        </body>
    </xsl:template>

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

</xsl:stylesheet>