1 <?xml version="1.0" encoding="UTF-8"?>
3 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6 <xsl:import href="../wrapper.xsl"/>
7 <xsl:template match="/"> <xsl:apply-imports/> </xsl:template>
8 <xsl:template name="content"><xsl:apply-templates/></xsl:template>
10 <!-- Where am I relative to the root. Lets mirrors host this in subfolders -->
11 <xsl:variable name="docroot" select="'../../../..'"/>
14 <xsl:variable name="html.head.title" select="/book/bookinfo/title"/>
16 <xsl:variable name="html.head.append">
19 <link rel="stylesheet" type="text/css" href="{$docroot}/doc/index.css"/>
22 <link rel="canonical" href="{/book/canonical_url}"/>
27 <xsl:variable name="html.body.append">
28 <script type="text/javascript" src="{$docroot}/doc/index.js"/>
32 <xsl:template match="/book">
34 <xsl:apply-templates select="bookinfo"/>
36 <div id="options" class="hidden">
37 <img src="{$docroot}/doc/plus-12x12.png" width="12" height="12" class="expand"/>
38 <img src="{$docroot}/doc/minus-12x12.png" width="12" height="12" class="collapse"/>
39 <xsl:text>Expand/Collapse all Chapters</xsl:text>
43 <xsl:apply-templates select="chapter"/>
49 <xsl:template match="/book/bookinfo">
51 <xsl:apply-templates select="title"/>
54 <xsl:text>Copyright</xsl:text>
55 <xsl:value-of select="concat(' © ',copyright/year)"/>
56 <xsl:text> </xsl:text>
57 <xsl:apply-templates select="copyright/holder"/><br/>
58 <xsl:text>Revision </xsl:text>
59 <xsl:apply-templates select="revhistory/revision/revnumber"/>
60 <xsl:text> - </xsl:text>
61 <xsl:apply-templates select="revhistory/revision/date"/>
66 <xsl:template match="/book/chapter">
68 <!-- Calculate the URL to the chapter. Store in $chapter_url -->
69 <xsl:variable name="chapter_url">
71 <xsl:when test="position()<10">
72 <xsl:value-of select="concat(/book/prepend_chapter,'ch',0,position(),'.html')"/>
75 <xsl:value-of select="concat(/book/prepend_chapter,'ch',position(),'.html')"/>
82 <xsl:if test="section">
86 <span class="chapter_title">
87 <xsl:if test="not(section)">
88 <xsl:attribute name="class">chapter_title nosub</xsl:attribute>
90 <xsl:value-of select="concat(position(),'. ')"/>
91 <a href="{$chapter_url}">
92 <xsl:apply-templates select="title"/>
96 <xsl:if test="section">
98 <xsl:apply-templates select="section">
99 <xsl:with-param name="chapter_url" select="$chapter_url"/>
100 </xsl:apply-templates>
107 <xsl:template match="/book/chapter/section">
108 <xsl:param name="chapter_url"/>
110 <xsl:value-of select="concat(position(),'. ')"/>
111 <a class="section_title" href="{$chapter_url}#{@id}">
112 <xsl:apply-templates select="title"/>
117 <!-- Chapter/Section Title -->
118 <xsl:template match="title|chapter/title|section/title">
119 <xsl:apply-templates/>