blue.css
[cxml-rng.git] / doc / paginate.xsl
blob1d3e36c84e533429a375e2d8132200673ea26fbe
1 <!--
2 The final stylesheet for HTML generation.
4 This file splits up the XML document and its <page> elements into
5 individual HTML files.
7 A few formatting elements like <columns> are resolved here.
8 -->
9 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
10 <xsl:output method="html"
11 indent="yes"
12 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
13 doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
15 <xsl:template match="@*|node()">
16 <xsl:copy>
17 <xsl:apply-templates select="@*|node()"/>
18 </xsl:copy>
19 </xsl:template>
21 <xsl:template match="/">
22 <xsl:apply-templates/>
23 </xsl:template>
25 <xsl:template match="pages">
26 <xsl:apply-templates/>
27 </xsl:template>
29 <xsl:template match="main-page">
30 <xsl:call-template name="page"/>
31 </xsl:template>
33 <xsl:template match="page">
34 <xsl:document href="{@pathname}"
35 method="html"
36 indent="yes"
37 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
38 doctype-system="http://www.w3.org/TR/html4/loose.dtd">
39 <xsl:call-template name="page"/>
40 </xsl:document>
41 </xsl:template>
43 <xsl:template name="page">
44 <html>
45 <head>
46 <title>
47 <xsl:value-of select="@title"/>
48 </title>
49 <link rel="stylesheet" type="text/css" href="{@base}{/pages/@css}"/>
50 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
51 </head>
52 <body>
53 <xsl:call-template name="header">
54 <xsl:with-param name="base" select="@base"/>
55 </xsl:call-template>
56 <div class="main">
57 <xsl:apply-templates/>
58 </div>
59 </body>
60 </html>
61 </xsl:template>
63 <xsl:template match="columns">
64 <table cellspacing="0" cellpadding="0">
65 <xsl:apply-templates select="@*"/>
66 <tr>
67 <xsl:apply-templates/>
68 </tr>
69 </table>
70 </xsl:template>
72 <xsl:template match="column">
73 <td valign="top">
74 <xsl:apply-templates select="@*"/>
75 <xsl:apply-templates/>
76 </td>
77 </xsl:template>
79 <xsl:template match="simple-table">
80 <table cellspacing="0" cellpadding="0">
81 <xsl:apply-templates select="@*"/>
82 <xsl:apply-templates/>
83 </table>
84 </xsl:template>
86 <xsl:template match="row">
87 <tr>
88 <xsl:apply-templates select="@*"/>
89 <xsl:apply-templates/>
90 </tr>
91 </xsl:template>
93 <xsl:template match="cell">
94 <td valign="top">
95 <xsl:apply-templates select="@*"/>
96 <xsl:apply-templates/>
97 </td>
98 </xsl:template>
100 <xsl:template match="padded">
101 <div class="padded">
102 <xsl:apply-templates/>
103 </div>
104 </xsl:template>
106 <xsl:template name="header">
107 <xsl:param name="base"/>
108 <div id="header">
109 <table cellspacing="0" cellpadding="0" width="100%">
110 <tr>
111 <xsl:if test="/pages/@logo">
112 <td width="176">
113 <a id="headerlink" href="{$base}../index.html">
114 <img src="{$base}{/pages/@logo}" border="0"/>
115 </a>
116 </td>
117 </xsl:if>
118 <td valign="center">
119 <xsl:choose>
120 <xsl:when test="/pages/@logo">
121 &#x2014;
122 </xsl:when>
123 <xsl:otherwise>
124 &#160;&#160;
125 </xsl:otherwise>
126 </xsl:choose>
128 <xsl:text> </xsl:text>
129 <xsl:value-of select="/pages/@heading"/>
130 </b>
131 </td>
132 <td valign="center" align="right">
133 <b>API documentation</b>
134 </td>
135 </tr>
136 </table>
137 </div>
138 </xsl:template>
139 </xsl:stylesheet>