[7e7554]: xsl / add_indexterm.xml Maximize Restore History

Download this file

add_indexterm.xml    67 lines (59 with data), 1.8 kB

 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a="http://docbook.org/ns/docbook"
exclude-result-prefixes="a"
version="1.0">
<xsl:output encoding="utf-8"/>
<!-- By default copy the whole document -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="a:refsynopsisdiv">
<xsl:for-each select=".//a:symbol">
<xsl:element name="indexterm">
<xsl:attribute name="type">cl</xsl:attribute>
<primary><xsl:value-of select="."/></primary>
</xsl:element>
</xsl:for-each>
<xsl:for-each select=".//a:funcsynopsis//a:function|
.//a:synopsys//a:type|
.//a:synopsys//a:variable|
.//a:synopsys//a:constant">
<xsl:if test="string-length(attribute::role)=0">
<xsl:element name="indexterm">
<xsl:attribute name="type">c</xsl:attribute>
<primary><xsl:value-of select="."/></primary>
</xsl:element>
</xsl:if>
</xsl:for-each>
<xsl:copy-of select="."/>
</xsl:template>
<!--
<xsl:template match="a:symbol" mode="automatic">
<xsl:copy-of select="."/>
<indexterm type="cl">
<primary><xsl:value-of select="."/></primary>
</indexterm>
</xsl:template>
<xsl:template match="a:function" mode="automatic">
<xsl:copy-of select="."/>
<indexterm type="c">
<primary><xsl:value-of select="."/></primary>
</indexterm>
</xsl:template>
<xsl:template match="a:variable" mode="automatic">
<xsl:copy-of select="."/>
<indexterm type="c">
<primary><xsl:value-of select="."/></primary>
</indexterm>
</xsl:template>
<xsl:template match="a:type" mode="automatic">
<xsl:copy-of select="."/>
<indexterm type="c">
<primary><xsl:value-of select="."/></primary>
</indexterm>
</xsl:template>
-->
</xsl:stylesheet>