Project

Profile

Help

How to connect?
Download (7.66 KB) Statistics
| Branch: | Revision:

he / src / viewer_appJS / xsl / jdp-body.xsl @ 66bb272d

1
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2
    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0"
3
    xmlns:ixsl="http://saxonica.com/ns/interactiveXSLT" 
4
    xmlns:f="urn:viewerapp.function"
5
    extension-element-prefixes="ixsl">
6
    
7
    <xsl:mode name="jdp" on-no-match="shallow-copy"/>
8

    
9
    <xsl:template match="a" mode="jdp">
10
        <xsl:copy>
11
            <xsl:attribute name="target" select="'_blank'"/>
12
            <xsl:apply-templates mode="jdp" select="node()|@* except @target"/>
13
        </xsl:copy>
14
    </xsl:template>
15

    
16
    <xsl:template match="a[@class = 'javalink']" mode="jdp">
17
        <span class="javalink" data-href="{@href}">
18
            <xsl:value-of select="f:last-substring-after(. , 46)"/>
19
        </span>
20
    </xsl:template>
21
    
22
    <xsl:template match="section" mode="jdp">
23
        <xsl:apply-templates mode="jdp"/>
24
    </xsl:template>
25

    
26
    <xsl:template match="section" mode="pkg-header">
27
        <h1>
28
            <xsl:value-of select="@id"/>
29
        </h1>
30
        <xsl:apply-templates mode="jdp" select="child::div/p[1]"/>
31
        <xsl:if test="count(child::div/p) gt 1">
32
            <p>
33
                <em>(More details at foot of page)</em>
34
            </p>
35
        </xsl:if>
36
    </xsl:template>
37

    
38
    <xsl:variable name="s-titles" select="('Interface','Class', 'Enum','Exception')" as="xs:string+"/>
39

    
40
    <xsl:template match="document-node()" mode="summarise-pkg">
41
        <xsl:variable name="package" select="package"/>
42
        <xsl:variable name="classes" select="$package/class"/>
43
        <xsl:for-each select="1 to 4">
44
            <xsl:variable name="i" select="." as="xs:integer"/>
45
            <xsl:variable name="f-classes"
46
                select="if ($i eq 1) then ($package/interface | $classes[@interface='true'])
47
                        else if ($i eq 2) then
48
                            $classes[not(
49
                                @interface='true'
50
                                or @superclass='Enum'
51
                                or ends-with(@superclass,'Exception'))]
52
                        else if ($i eq 3) then ($package/enum | $classes[@superclass='Enum'])
53
                        else $classes[ends-with(@superclass,'Exception')]"/>
54
            <xsl:if test="exists($f-classes)">
55
                <table border="1" style="width:100%">
56
                    <thead>
57
                        <tr>
58
                            <td colspan="2" style="text-align:center">
59
                                <h3>
60
                                    <xsl:value-of select="concat($s-titles[$i],' Summary')"/>
61
                                </h3>
62
                            </td>
63
                        </tr>
64
                        <tr>
65
                            <td>
66
                                <p>Name</p>
67
                            </td>
68
                            <td>
69
                                <p>Description</p>
70
                            </td>
71
                        </tr>
72
                    </thead>
73
                    <tbody>
74
                        <xsl:for-each select="$f-classes">
75
                            <tr>
76
                                <td>
77
                                    <xsl:sequence select="f:showType(., true(), true())"/>
78
                                </td>
79
                                <td>
80
                                    <p>
81
                                        <xsl:apply-templates select="(comment/attribute[@name='@deprecated'],
82
                                            comment/sentence)[1]" mode="jdc"/>
83
                                    </p>
84
                                </td>
85
                            </tr>
86
                        </xsl:for-each>
87
                    </tbody>
88
                </table>
89

    
90
                <p>&#160;</p>
91
            </xsl:if>
92
        </xsl:for-each>
93
    </xsl:template>
94
    
95
    <xsl:template match="article[@id='javadoc-packages']" mode="jdp">
96
        <h1>Saxon Java API Documentation</h1>
97
        <xsl:variable name="art" select="."/>
98
        <xsl:variable name="titles"
99
            select="('s9api Interface','Other Interfaces','External Interfaces','Other Packages')"
100
            as="xs:string+"/>
101

    
102
        <xsl:variable name="p1" select="'net.sf.saxon.s9api'"/>
103
        <xsl:variable name="p2"
104
            select="'com.saxonica.config','com.saxonica.jaxp','com.saxonica.schema',
105
'net.sf.saxon','net.sf.saxon.lib', 'net.sf.saxon.om',
106
'net.sf.saxon.query','net.sf.saxon.sxpath','net.sf.saxon.type',
107
'net.sf.saxon.type','net.sf.saxon.value','net.sf.saxon.xpath',
108
'net.sf.saxon.xqj'" />
109
        <xsl:variable name="p3" select="'javax.xml.xquery'"/>
110
        <xsl:variable name="p4" select="$art/section[not(@id = ($p1, $p2, $p3))]/@id"/>
111

    
112

    
113
        <xsl:for-each select="1 to 4">
114
            <xsl:variable name="i" select="." as="xs:integer"/>
115
            <table border="1" style="width:100%">
116
                <thead>
117
                    <tr>
118
                        <td colspan="2" style="text-align:center">
119
                            <h3>
120
                                <xsl:value-of select="$titles[$i]"/>
121
                            </h3>
122
                        </td>
123
                    </tr>
124
                    <tr>
125
                        <td>
126
                            <p>Package</p>
127
                        </td>
128
                        <td>
129
                            <p>Description</p>
130
                        </td>
131
                    </tr>
132
                </thead>
133
                <tbody>
134
                    <xsl:for-each
135
                        select="$art/section[@id = 
136
                        (if ($i eq 1) then $p1
137
                        else if ($i eq 2) then $p2
138
                        else if ($i eq 3) then $p3
139
                        else $p4)]">
140
                        <xsl:sort select="@id"/>
141
                        <tr>
142
                            <td>
143
                                <span class="javalink" data-href="{@id}">
144
                                    <xsl:value-of select="@id"/>
145
                                </span>
146
                            </td>
147

    
148
                            <td>
149
                                <xsl:apply-templates select="child::div/p[1]" mode="jdp"/>
150
                            </td>
151
                        </tr>
152
                    </xsl:for-each>
153
                </tbody>
154
            </table>
155

    
156
            <p>&#160;</p>
157
        </xsl:for-each>
158

    
159
    </xsl:template>
160
    
161
    <xsl:template match="article[@id='dotnetdoc-packages']" mode="jdp">
162
        <h1>Saxon .NET API Documentation</h1>
163
 
164
            <table border="1" style="width:100%">
165
                <thead>
166
                    <tr>
167
                        <td colspan="2" style="text-align:center">
168
                            <h3>Saxon.Api</h3>
169
                        </td>
170
                    </tr>
171
                    <tr>
172
                        <td>
173
                            <p>Package</p>
174
                        </td>
175
                        <td>
176
                            <p>Description</p>
177
                        </td>
178
                    </tr>
179
                </thead>
180
                <tbody>
181
                    <xsl:for-each select="section">
182
                        <tr>
183
                            <td>
184
                                <span class="javalink" data-href="{@id}">
185
                                    <xsl:value-of select="@id"/>
186
                                </span>
187
                            </td>
188
                            
189
                            <td>
190
                                <xsl:apply-templates select="child::div/p" mode="jdp"/>
191
                            </td>
192
                        </tr>
193
                    </xsl:for-each>
194
                </tbody>
195
            </table>
196
            
197
            <p>&#160;</p>
198
        
199
    </xsl:template>
200

    
201
</xsl:transform>
(10-10/12)