File: settings2document.xsl

package info (click to toggle)
libxerces2-java 2.8.1-1%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 11,056 kB
  • ctags: 15,838
  • sloc: java: 117,816; xml: 12,454; sh: 37; makefile: 10
file content (144 lines) | stat: -rw-r--r-- 3,556 bytes parent folder | download | duplicates (4)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>

 <!-- Top-Level Templates -->

 <xsl:template match='/features'>
  <s1 title='Features'>
   <xsl:apply-templates select='desc' mode='header'/>
   <xsl:apply-templates select='fcategory'/>
  </s1>
 </xsl:template>
 
 <xsl:template match='/properties'>
  <s1 title='Properties'>
   <xsl:apply-templates select='desc' mode='header'/>
   <xsl:apply-templates select='pcategory'/>
  </s1>
 </xsl:template>
 
 <xsl:template match='fcategory|pcategory'>
  <s2 title='{@name}'>
   <xsl:apply-templates select='desc'/>
   <xsl:apply-templates/>
  </s2>
 </xsl:template>

 <xsl:template match='feature'>
  <anchor name='{@id}'/>
  <s3 title='{@name}'>
   <table>
    <xsl:apply-templates select='desc' mode='table'/>
    <tr>
     <th>True:</th>
     <td><xsl:apply-templates select='true'/></td>
    </tr>
    <tr>
     <th>False:</th>
     <td><xsl:apply-templates select='false'/></td>
    </tr>
    <xsl:apply-templates select='default' mode='table'/>
    <xsl:apply-templates select='access' mode='table'/>
    <xsl:apply-templates select='since' mode='table'/>
    <xsl:apply-templates select='note' mode='table'/>
    <xsl:apply-templates select='see' mode='table'/>
   </table>
  </s3>
 </xsl:template>

 <xsl:template match='property'>
  <anchor name='{@id}'/>
  <s3 title='{@name}'>
   <table>
    <xsl:apply-templates select='desc' mode='table'/>
    <tr>
     <th>Type:</th>
     <td><xsl:value-of select='type'/></td>
    </tr>
    <xsl:apply-templates select='default' mode='table'/>
    <xsl:apply-templates select='access' mode='table'/>
    <xsl:apply-templates select='since' mode='table'/>
    <xsl:apply-templates select='note' mode='table'/>
    <xsl:apply-templates select='see' mode='table'/>
   </table>
  </s3>
 </xsl:template>
 
 <!-- Table Contents Templates -->
 
 <xsl:template match='desc' mode='table'>
  <tr>
   <th>Desc:</th>
   <td><xsl:apply-templates/></td>
  </tr>
 </xsl:template>

 <xsl:template match='access' mode='table'>
  <tr>
   <th>Access:</th>
   <td>
    <xsl:choose>
     <xsl:when test='@general'>
      <xsl:value-of select='@general'/>
     </xsl:when>
     <xsl:otherwise>
      <xsl:if test='@parsing'>
       (parsing) <xsl:value-of select='@parsing'/>;
      </xsl:if>
      <xsl:if test='@not-parsing'>
       (not parsing) <xsl:value-of select='@not-parsing'/>;
      </xsl:if>
     </xsl:otherwise>
    </xsl:choose>
   </td>
  </tr>
 </xsl:template>

 <xsl:template match='default' mode='table'>
  <tr>
   <th>Default:</th>
   <td><xsl:value-of select='@value'/></td>
  </tr>
 </xsl:template>
 
 <xsl:template match='since' mode='table'>
  <tr>
   <th>Since:</th>
   <td><xsl:value-of select='@value'/></td>
  </tr>
 </xsl:template>
 
 <xsl:template match='note' mode='table'>
  <tr>
   <th>Note:</th>
   <td><xsl:call-template name='markup'/></td>
  </tr>
 </xsl:template>

 <xsl:template match='see' mode='table'>
  <tr>
   <th>See:</th>
   <td>
    <xsl:variable name='idref'><xsl:value-of select='@idref'/></xsl:variable>
    <jump href='#{$idref}'><xsl:value-of select='//*[@id=$idref]/@name'/></jump>
   </td>
  </tr>
 </xsl:template>

 <!-- General Templates -->

 <xsl:template match='desc'>
  <xsl:call-template name='markup'/>
 </xsl:template>

 <xsl:template match='desc' mode='header'>
  <s2 title='{@name}'>
   <xsl:call-template name='markup'/>
  </s2>
 </xsl:template>

 <xsl:template name='markup'>
  <xsl:copy-of select='*|text()'/>
 </xsl:template>

</xsl:stylesheet>