stylesheets erklaert
[cxml-rng.git] / doc / paginate.xsl
blob84cd98ba789d3aed7d0760cdff53219d0a9ab487
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}doc.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 name="header">
101 <xsl:param name="base"/>
102 <div id="header">
103 <table cellspacing="0" cellpadding="0" width="100%">
104 <tr>
105 <td width="176">
106 <a id="headerlink" href="{$base}../index.html">
107 <img src="{$base}logo.png" border="0"/>
108 </a>
109 </td>
110 <td valign="center">
111 &#x2014;
112 <b> Relax NG for Closure XML</b>
113 </td>
114 <td valign="center" align="right">
115 <b>API documentation</b>
116 </td>
117 </tr>
118 </table>
119 </div>
120 </xsl:template>
121 </xsl:stylesheet>