2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
4 <xsl:strip-space elements="doc chapter section"/>
5 <xsl:output method="xml" indent="yes" encoding="iso-8859-1"
6 doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"
7 doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"/>
9 <xsl:template match="doc">
10 <xsl:element name="html" namespace="http://www.w3.org/1999/xhtml">
13 <xsl:attribute name="rel">stylesheet</xsl:attribute>
14 <xsl:attribute name="type">text/css</xsl:attribute>
15 <xsl:attribute name="href"><xsl:value-of select="@style"/></xsl:attribute>
18 <xsl:value-of select="*/titlepage/title"/>
20 <style type="text/css">
29 border-style : solid ;
33 border-style : solid ;
43 padding-bottom : 1em ;
117 <xsl:apply-templates/>
119 <xsl:apply-templates select="//footnote" mode="footnotes"/>
124 <xsl:template match="titlepage">
126 <xsl:attribute name="class">titlepage</xsl:attribute>
127 <xsl:apply-templates/>
131 <xsl:template match="title">
133 <xsl:attribute name="class">titlepage</xsl:attribute>
134 <xsl:apply-templates/>
138 <xsl:template match="subtitle">
140 <xsl:attribute name="class">titlepage</xsl:attribute>
141 <xsl:apply-templates/>
145 <xsl:template match="author">
146 <xsl:apply-templates/><br/>
149 <xsl:template match="date">
150 <p><xsl:apply-templates/></p>
153 <xsl:template match="docinfo">
154 <table class="docinfo">
155 <tr><th colspan="2">Document Information</th></tr>
156 <xsl:apply-templates/>
160 <xsl:template match="infoitem">
162 <td><xsl:value-of select="@label"/></td>
163 <td><xsl:apply-templates/></td>
167 <xsl:template match="abstract">
169 <p><b>Abstract:</b></p>
171 <xsl:apply-templates/>
176 <!-- A template to create the section number for a node -->
178 <xsl:template name="section-number" mode="section-number" match="node()">
179 <xsl:number count="chapter|section" level="multiple" format="1.1 "/>
182 <!-- Create a table of contents -->
184 <xsl:template match="toc">
185 <h1>Table Of Contents</h1>
186 <xsl:for-each select="../chapter">
188 <xsl:number count="chapter"/>
189 <xsl:text> </xsl:text>
191 <xsl:attribute name="href">#CH<xsl:number count="chapter"/></xsl:attribute>
192 <xsl:value-of select="heading"/>
195 <xsl:for-each select="section">
197 <xsl:number count="chapter|section" level="multiple" format="1.1 "/>
199 <xsl:attribute name="href">#SEC<xsl:number count="chapter|section" level="multiple" format="1.1"/></xsl:attribute>
200 <xsl:value-of select="heading"/>
208 <!-- Chapter and section headings are all automatically numbered -->
210 <xsl:template match="chapter/heading">
212 <xsl:number count="chapter"/>
213 <xsl:text> </xsl:text>
215 <xsl:attribute name="id">CH<xsl:number count="chapter"/></xsl:attribute>
217 <xsl:apply-templates/>
221 <xsl:template match="section/heading">
223 <xsl:number count="chapter|section" level="multiple" format="1.1 "/>
225 <xsl:attribute name="id">SEC<xsl:number count="chapter|section" level="multiple" format="1.1"/></xsl:attribute>
227 <xsl:apply-templates/>
231 <xsl:template match="subsection/heading">
233 <xsl:number count="chapter|section|subsection" level="multiple" format="1.1.1 "/>
234 <xsl:apply-templates/>
238 <xsl:template match="subsubsection/heading">
240 <xsl:number count="chapter|section|subsection|subsubsection" level="multiple"
242 <xsl:apply-templates/>
246 <xsl:template match="paragraph/heading">
248 <xsl:number count="chapter|section|subsection|subsubsection|paragraph"
250 format="1.1.1.1.1 "/>
251 <xsl:apply-templates/>
255 <xsl:template match="subparagraph/heading">
257 <xsl:number count="chapter|section|subsection|subsubsection|paragraph|subparagraph"
259 format="1.1.1.1.1.1 "/>
260 <xsl:apply-templates/>
264 <!-- Trivial elements are convreted directly -->
266 <xsl:template match="para">
268 <xsl:apply-templates/>
272 <xsl:template match="quote">
274 <xsl:apply-templates/>
278 <xsl:template match="verbatim">
280 <xsl:apply-templates/>
284 <xsl:template match="example">
285 <pre class='example'>
286 <xsl:apply-templates/>
290 <xsl:template match="itemize">
292 <xsl:apply-templates/>
296 <xsl:template match="enumerate">
298 <xsl:apply-templates/>
302 <xsl:template match="description">
304 <xsl:apply-templates/>
308 <xsl:template match="itemize/item">
310 <xsl:apply-templates/>
314 <xsl:template match="enumerate/item">
316 <xsl:apply-templates/>
320 <xsl:template match="description/item">
321 <dt><xsl:value-of select='@tag'/></dt>
323 <xsl:apply-templates/>
327 <xsl:template match="footnote">
329 <xsl:attribute name='href'>#footnote<xsl:number level='any'/></xsl:attribute>
330 <xsl:number level='any'/>
334 <xsl:template match="footnote" mode="footnotes">
336 <sup><a><xsl:attribute name='id'>footnote<xsl:number level='any'/></xsl:attribute>
337 <xsl:number level='any'/></a></sup> <xsl:apply-templates/>
341 <xsl:template match="emph">
342 <em><xsl:apply-templates/></em>
345 <xsl:template match="strong">
346 <strong><xsl:apply-templates/></strong>
349 <xsl:template match="code">
350 <code><xsl:apply-templates/></code>
353 <xsl:template match="remark">
354 <span><xsl:attribute name="class">remark</xsl:attribute><xsl:apply-templates/></span>
357 <xsl:template match="sub">
358 <sub><xsl:apply-templates/></sub>
361 <xsl:template match="sup">
362 <sup><xsl:apply-templates/></sup>
365 <xsl:template match="color">
366 <span><xsl:attribute name="class"><xsl:value-of select="@colorname"/></xsl:attribute><xsl:apply-templates/></span>
369 <xsl:template match="big">
370 <big><xsl:apply-templates/></big>
373 <xsl:template match="small">
374 <small><xsl:apply-templates/></small>
377 <xsl:template match="table">
379 <xsl:apply-templates/>
383 <xsl:template match="newline"><br/></xsl:template>
385 <xsl:template match="row">
386 <tr><xsl:apply-templates/></tr>
389 <xsl:template match="thead">
390 <tr><xsl:apply-templates/></tr>
393 <xsl:template match="thead/col">
394 <th><xsl:apply-templates/></th>
397 <xsl:template match="row/col">
398 <td><xsl:apply-templates/></td>
401 <xsl:template match="picture">
402 <img><xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
406 <xsl:template match="label">
407 <a><xsl:attribute name='id'>
408 <xsl:value-of select="@name"/>
412 <xsl:template match="index"></xsl:template>
414 <xsl:template match="ref">
415 <a><xsl:attribute name='href'>#<xsl:value-of select="@to"/></xsl:attribute>
416 <xsl:apply-templates/>
417 <!--<xsl:apply-templates select="id(@to)" mode="section-number"/>-->
421 <xsl:template match="page"></xsl:template>
423 <xsl:template match="reference">
425 <xsl:attribute name="href">
426 <xsl:value-of select="@href"/>
428 <xsl:apply-templates/>
432 <xsl:template match="math">
433 <xsl:element name="math" namespace="http://www.w3.org/1998/Math/MathML">
434 <xsl:copy-of select='./*'/>
438 <xsl:template match="svg">
440 <xsl:copy-of select="document(@src)"/>
442 <xsl:if test='not(@src)'>
443 <xsl:element name="svg" namespace="http://www.w3.org/2000/svg">
444 <xsl:copy-of select='./*'/>