File: pod.xsl

package info (click to toggle)
libembperl-perl 2.5.0-4%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 6,200 kB
  • ctags: 3,072
  • sloc: ansic: 21,387; perl: 14,496; cpp: 467; xml: 49; makefile: 32; sh: 24
file content (111 lines) | stat: -rw-r--r-- 3,094 bytes parent folder | download | duplicates (11)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version='1.0'?>


<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/TR/xhtml1/strict">


<xsl:output
   method="xml"
   indent="yes"
   encoding="iso-8859-1"
/>


    <xsl:template match="/">                         
        <html><head><title><xsl:value-of select="/pod/head/title"/></title></head><body>
        

        <xsl:apply-templates select="/pod"/> 
        </body></html>
    </xsl:template>


    <xsl:template match="sect1/title">                         
            <h1><xsl:value-of select="."/></h1>
    </xsl:template>

    <xsl:template match="sect2/title">                         
            <h2><xsl:value-of select="."/></h2>
    </xsl:template>

    <xsl:template match="sect3/title">                         
            <h2><xsl:value-of select="."/></h2>
    </xsl:template>

    <xsl:template match="sect1">                         
        <xsl:apply-templates/> 
    </xsl:template>

    <xsl:template match="sect2">                         
        <xsl:apply-templates/> 
    </xsl:template>

    <xsl:template match="para">                         
        <p><xsl:apply-templates/></p>
    </xsl:template>

    <xsl:template match="verbatim">                         
        <pre><xsl:apply-templates/>
        </pre>
    </xsl:template>

    <xsl:template match="code">                         
            <code><xsl:value-of select="."/></code>
    </xsl:template>

    <xsl:template match="underline">                         
            <u><xsl:value-of select="."/></u>
    </xsl:template>

    <xsl:template match="emphasis">                         
            <i><xsl:value-of select="."/></i>
    </xsl:template>

    <xsl:template match="strong">                         
            <b><xsl:value-of select="."/></b>
    </xsl:template>

    <xsl:template match="list">                         
            <ul>
                <xsl:apply-templates/> 
            </ul>
    </xsl:template>


    <xsl:template match="item">                         
            <li><b><xsl:apply-templates/></b></li><br/>
    </xsl:template>



    <xsl:template name="link">
        <xsl:param name="txt"/>
        <xsl:param name="uri"/>
        <a href="{$uri}"><xsl:value-of select="$txt"/></a>
    </xsl:template>



    <xsl:template match="xlink">                         
            <xsl:choose>
                <xsl:when test="@uri">
                    <xsl:call-template name="link">
                        <xsl:with-param name="uri" select="@uri"/>
                        <xsl:with-param name="txt" select="."/>
                    </xsl:call-template>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:call-template name="link">
                        <xsl:with-param name="uri" select="."/>
                        <xsl:with-param name="txt" select="."/>
                    </xsl:call-template>
                </xsl:otherwise>
            </xsl:choose>
                 
    </xsl:template>



</xsl:stylesheet>