-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddvn.xsl
29 lines (25 loc) · 900 Bytes
/
addvn.xsl
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Insert an empty "query variants" placeholder into every topic
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="yes" />
<xsl:template match="top">
<xsl:copy>
<xsl:apply-templates select="@*" />
<!--apply templates to children -->
<xsl:apply-templates select="node()" />
<!--Only add variants node if non-existent-->
<xsl:if test="not(variants)">
<variants />
</xsl:if>
</xsl:copy>
</xsl:template>
<!--standard identity template, which copies all content forward-->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:strip-space elements="*"/>
</xsl:stylesheet>