forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcat2tax.xsl
More file actions
25 lines (22 loc) · 667 Bytes
/
cat2tax.xsl
File metadata and controls
25 lines (22 loc) · 667 Bytes
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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="category">
<item>
<name><xsl:value-of select="@name"/></name>
<slug><xsl:value-of select="@slug"/></slug>
<xsl:if test="desc/child::node()">
<description><xsl:copy-of select="desc/text()|desc/*"/></description>
</xsl:if>
<xsl:if test="category">
<children>
<xsl:apply-templates select="category"/>
</children>
</xsl:if>
</item>
</xsl:template>
<xsl:template match="categories">
<category>
<xsl:apply-templates select="node()"/>
</category>
</xsl:template>
</xsl:stylesheet>