-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsort.xslt
42 lines (29 loc) · 1.06 KB
/
sort.xslt
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- The following statements make the xslt always encapsulate specific elements as CDATA.
We have to do this because these elements always use CDATA in the source XML, but the "copy-of"
statement ignores CDATA tags and just copies the raw text to the XML output. -->
<xsl:output cdata-section-elements="title"/>
<xsl:output cdata-section-elements="name"/>
<xsl:output cdata-section-elements="body"/>
<xsl:output cdata-section-elements="attachments"/>
<xsl:template match="/">
<quicktext version="2">
<filetype>templates</filetype>
<xsl:for-each select="quicktext/menu">
<menu>
<xsl:for-each select="title">
<xsl:copy-of select="."/>
</xsl:for-each>
<texts>
<xsl:for-each select="texts/text">
<xsl:sort select="name"/>
<xsl:copy-of select="."/>
</xsl:for-each>
</texts>
</menu>
</xsl:for-each>
</quicktext>
</xsl:template>
</xsl:stylesheet>