aboutsummaryrefslogtreecommitdiff
path: root/docs/xslt/directive.xslt
blob: 0bff2f49c9faad98da06fdcab552f7aabaaa7b21 (plain)
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
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

   <xsl:template match="directive">

      <hr/>

      <a name="{@name}"/>
        <!-- <center><h4><xsl:value-of select="@name"/> </h4></center> -->

      <xsl:apply-templates select="syntax"/>

      <xsl:apply-templates select="default"/>

      <xsl:apply-templates select="context"/>

      <xsl:if test="(@appeared-in)">

         <strong>appeared in version</strong>:
         <xsl:value-of select="@appeared-in"/>
      </xsl:if>

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

   <xsl:template match="syntax">
      <xsl:choose>

         <xsl:when test="position() = 1">

            <strong>syntax</strong>:
         </xsl:when>

         <xsl:otherwise>

            <code>       </code>
         </xsl:otherwise>
      </xsl:choose>

      <code>

         <xsl:apply-templates/> 
      </code>
      <br/>
   </xsl:template>

   <xsl:template match="default">

      <strong>default</strong>:
      <xsl:choose>

         <xsl:when test="count(text()) = 0">

            <strong>none</strong>
         </xsl:when>

         <xsl:otherwise>

            <code>
               <xsl:apply-templates/>
            </code>
         </xsl:otherwise>
      </xsl:choose>

      <br/>
   </xsl:template>

   <xsl:template match="context">

      <xsl:if test="position() = 1">

         <strong>context</strong>:
      </xsl:if>
      <xsl:choose>

         <xsl:when test="count(text()) = 0">

            <strong>any</strong>
         </xsl:when>

         <xsl:otherwise>

            <code>
               <xsl:apply-templates/>
            </code>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:choose>

         <xsl:when test="position() != last()">

            <xsl:text>, </xsl:text>
         </xsl:when>

         <xsl:otherwise>

            <br/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:template>

</xsl:stylesheet>