xref: /Universal-ctags/Units/parser-xslt.r/xslt-simple.d/input.xsl (revision 2376579355043c06cc4e6fcf01de36bf9c4a0eed)
1<?xml version="1.0" encoding="utf-8"?>
2
3<!-- packagedoc.xsl
4     Copyright (C) 2003 Free Software Foundation, Inc.
5
6     This file is part of GNU Classpath.
7
8     GNU Classpath is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2, or (at your option)
11     any later version.
12
13     GNU Classpath is distributed in the hope that it will be useful, but
14     WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16     General Public License for more details.
17
18     You should have received a copy of the GNU General Public License
19     along with GNU Classpath; see the file COPYING.  If not, write to the
20     Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21     02111-1307 USA.
22     -->
23
24<!-- Creates the package descriptor files for HTML documentation.
25     -->
26
27<xsl:stylesheet version="1.0"
28  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
29  xmlns:gjdoc="http://www.gnu.org/software/cp-tools/gjdocxml"
30  xmlns:html="http://www.w3.org/TR/REC-html40"
31  xmlns="http://www.w3.org/TR/REC-html40">
32
33  <xsl:include href="html_common.xsl"/>
34
35  <xsl:output method="xml"
36    encoding="utf-8"
37    indent="no"/>
38
39  <xsl:strip-space elements="*"/>
40
41  <xsl:template match="/">
42
43    <html>
44      <head>
45        <xsl:call-template name="output_title">
46          <xsl:with-param name="p_pagetitle" select="$gjdoc.outputfile.info"/>
47        </xsl:call-template>
48        <xsl:call-template name="include_common"/>
49      </head>
50      <body class="classdoc" onload="if(parent.contentPageLoaded)parent.contentPageLoaded(getTitle())">
51
52        <!-- Top Navigation Bar -->
53        <xsl:call-template name="output_navbar">
54          <xsl:with-param name="p_show_package" select="0"/>
55          <xsl:with-param name="p_curr_package" select="1"/>
56          <xsl:with-param name="p_show_package_tree" select="1"/>
57          <xsl:with-param name="p_top" select="1"/>
58        </xsl:call-template>
59
60        <div class="pagebody">
61
62        <h1 class="classdoc-title">Package <xsl:value-of select="$gjdoc.outputfile.info"/></h1>
63
64        <div class="classdoc-package-comment-body">
65          <xsl:apply-templates select="/gjdoc:rootdoc/gjdoc:packagedoc[@name=$gjdoc.outputfile.info]/gjdoc:firstSentenceTags/node()"/>
66        </div>
67
68        <xsl:if test="/gjdoc:rootdoc/gjdoc:classdoc[gjdoc:containingPackage/@name=$gjdoc.outputfile.info][gjdoc:isInterface]">
69          <table border="1" cellspacing="0" width="100%" class="classdoc-table">
70            <tr><td colspan="2" class="section-header"><div class="section-header">Interface Summary</div></td></tr>
71            <xsl:for-each select="/gjdoc:rootdoc/gjdoc:classdoc[gjdoc:containingPackage/@name=$gjdoc.outputfile.info][gjdoc:isInterface]">
72              <xsl:sort select="@name" order="ascending"/>
73              <xsl:call-template name="output-classes-summary"/>
74            </xsl:for-each>
75          </table>
76        </xsl:if>
77
78        <xsl:if test="/gjdoc:rootdoc/gjdoc:classdoc[gjdoc:containingPackage/@name=$gjdoc.outputfile.info][gjdoc:isOrdinaryClass]">
79          <table border="1" cellspacing="0" width="100%" class="classdoc-table">
80            <tr><td colspan="2" class="section-header"><div class="section-header">Class Summary</div></td></tr>
81            <xsl:for-each select="/gjdoc:rootdoc/gjdoc:classdoc[gjdoc:containingPackage/@name=$gjdoc.outputfile.info][gjdoc:isOrdinaryClass]">
82              <xsl:sort select="@name" order="ascending"/>
83              <xsl:call-template name="output-classes-summary"/>
84            </xsl:for-each>
85          </table>
86        </xsl:if>
87
88        <xsl:if test="/gjdoc:rootdoc/gjdoc:classdoc[gjdoc:containingPackage/@name=$gjdoc.outputfile.info][gjdoc:isException]">
89          <table border="1" cellspacing="0" width="100%" class="classdoc-table">
90            <tr><td colspan="2" class="section-header"><div class="section-header">Exception Summary</div></td></tr>
91            <xsl:for-each select="/gjdoc:rootdoc/gjdoc:classdoc[gjdoc:containingPackage/@name=$gjdoc.outputfile.info][gjdoc:isException]">
92              <xsl:sort select="@name" order="ascending"/>
93              <xsl:call-template name="output-classes-summary"/>
94            </xsl:for-each>
95          </table>
96        </xsl:if>
97
98        <xsl:if test="/gjdoc:rootdoc/gjdoc:classdoc[gjdoc:containingPackage/@name=$gjdoc.outputfile.info][gjdoc:isError]">
99          <table border="1" cellspacing="0" width="100%" class="classdoc-table">
100            <tr><td colspan="2" class="section-header"><div class="section-header">Error Summary</div></td></tr>
101            <xsl:for-each select="/gjdoc:rootdoc/gjdoc:classdoc[gjdoc:containingPackage/@name=$gjdoc.outputfile.info][gjdoc:isError]">
102              <xsl:sort select="@name" order="ascending"/>
103              <xsl:call-template name="output-classes-summary"/>
104            </xsl:for-each>
105          </table>
106        </xsl:if>
107
108        <a name="description"><p> </p></a>
109        <h1 class="classdoc-sub-title package-description">Package <xsl:value-of select="$gjdoc.outputfile.info"/> Description</h1>
110
111        <div class="classdoc-package-comment-body">
112          <xsl:apply-templates select="/gjdoc:rootdoc/gjdoc:packagedoc[@name=$gjdoc.outputfile.info]/gjdoc:inlineTags/node()"/>
113        </div>
114
115      </div>
116
117        <!-- Bottom Navigation Bar -->
118        <xsl:call-template name="output_navbar">
119          <xsl:with-param name="p_show_package" select="0"/>
120          <xsl:with-param name="p_curr_package" select="1"/>
121          <xsl:with-param name="p_show_package_tree" select="1"/>
122          <xsl:with-param name="p_top" select="0"/>
123        </xsl:call-template>
124      </body>
125    </html>
126
127  </xsl:template>
128
129  <xsl:template name="output-classes-summary">
130    <xsl:variable name="v_currentclass" select="@qualifiedtypename"/>
131    <xsl:variable name="v_sub_xml_filename" select="concat(@qualifiedtypename,'.xml')"/>
132    <tr>
133      <td class="class-link">
134        <a href="{concat(@name, '.html')}" class="package-link">
135          <xsl:value-of select="@name"/>
136        </a>
137      </td>
138      <td class="class-summary-description">
139        <xsl:variable name="v_docstring" select="document($v_sub_xml_filename,/gjdoc:rootdoc)/gjdoc:classdoc[@qualifiedtypename=$v_currentclass]/gjdoc:firstSentenceTags/node()"/>
140        <xsl:choose>
141          <xsl:when test="$v_docstring">
142            <xsl:for-each select="$v_docstring">
143              <xsl:value-of select="." disable-output-escaping="yes"/>
144            </xsl:for-each>
145          </xsl:when>
146          <xsl:otherwise>
147            <i>No description available.</i>
148          </xsl:otherwise>
149        </xsl:choose>
150      </td>
151    </tr>
152  </xsl:template>
153</xsl:stylesheet>
154