[65b2904] | 1 | <?xml version='1.0' encoding='ISO-8859-1'?>
|
---|
| 2 |
|
---|
| 3 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 4 | xmlns="http://www.w3.org/1999/xhtml"
|
---|
| 5 | version="1.0">
|
---|
| 6 |
|
---|
| 7 | <!-- This stylesheet controls how preface, chapter, and sections are handled -->
|
---|
| 8 |
|
---|
| 9 | <!-- Chunk the first top-level section? 1 = yes, 0 = no
|
---|
| 10 | If preface and chapters TOC are generated, this must be 1. -->
|
---|
| 11 | <xsl:param name="chunk.first.sections" select="1"/>
|
---|
| 12 |
|
---|
| 13 | <!-- preface:
|
---|
| 14 | Output non sect1 child elements before the TOC -->
|
---|
| 15 | <!-- The original template is in {docbook-xsl}/xhtml/components.xsl -->
|
---|
| 16 | <xsl:template match="preface">
|
---|
| 17 | <xsl:call-template name="id.warning"/>
|
---|
| 18 | <div>
|
---|
| 19 | <xsl:apply-templates select="." mode="class.attribute"/>
|
---|
| 20 | <xsl:call-template name="dir">
|
---|
| 21 | <xsl:with-param name="inherit" select="1"/>
|
---|
| 22 | </xsl:call-template>
|
---|
| 23 | <xsl:call-template name="language.attribute"/>
|
---|
| 24 | <xsl:if test="$generate.id.attributes != 0">
|
---|
| 25 | <xsl:attribute name="id">
|
---|
| 26 | <xsl:call-template name="object.id"/>
|
---|
| 27 | </xsl:attribute>
|
---|
| 28 | </xsl:if>
|
---|
| 29 | <xsl:call-template name="component.separator"/>
|
---|
| 30 | <xsl:call-template name="preface.titlepage"/>
|
---|
| 31 | <xsl:apply-templates/>
|
---|
| 32 | <xsl:variable name="toc.params">
|
---|
| 33 | <xsl:call-template name="find.path.params">
|
---|
| 34 | <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
|
---|
| 35 | </xsl:call-template>
|
---|
| 36 | </xsl:variable>
|
---|
| 37 | <xsl:if test="contains($toc.params, 'toc')">
|
---|
| 38 | <xsl:call-template name="component.toc">
|
---|
| 39 | <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
|
---|
| 40 | </xsl:call-template>
|
---|
| 41 | <xsl:call-template name="component.toc.separator"/>
|
---|
| 42 | </xsl:if>
|
---|
| 43 | <xsl:call-template name="process.footnotes"/>
|
---|
| 44 | </div>
|
---|
| 45 | </xsl:template>
|
---|
| 46 |
|
---|
| 47 | <!-- chapter:
|
---|
| 48 | Output non sect1 child elements before the TOC -->
|
---|
| 49 | <!-- The original template is in {docbook-xsl}/xhtml/components.xsl -->
|
---|
| 50 | <xsl:template match="chapter">
|
---|
| 51 | <xsl:call-template name="id.warning"/>
|
---|
| 52 | <div>
|
---|
| 53 | <xsl:apply-templates select="." mode="class.attribute"/>
|
---|
| 54 | <xsl:call-template name="dir">
|
---|
| 55 | <xsl:with-param name="inherit" select="1"/>
|
---|
| 56 | </xsl:call-template>
|
---|
| 57 | <xsl:call-template name="language.attribute"/>
|
---|
| 58 | <xsl:if test="$generate.id.attributes != 0">
|
---|
| 59 | <xsl:attribute name="id">
|
---|
| 60 | <xsl:call-template name="object.id"/>
|
---|
| 61 | </xsl:attribute>
|
---|
| 62 | </xsl:if>
|
---|
| 63 | <xsl:call-template name="component.separator"/>
|
---|
| 64 | <xsl:call-template name="chapter.titlepage"/>
|
---|
| 65 | <xsl:apply-templates/>
|
---|
| 66 | <xsl:variable name="toc.params">
|
---|
| 67 | <xsl:call-template name="find.path.params">
|
---|
| 68 | <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
|
---|
| 69 | </xsl:call-template>
|
---|
| 70 | </xsl:variable>
|
---|
| 71 | <xsl:if test="contains($toc.params, 'toc')">
|
---|
| 72 | <xsl:call-template name="component.toc">
|
---|
| 73 | <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
|
---|
| 74 | </xsl:call-template>
|
---|
| 75 | <xsl:call-template name="component.toc.separator"/>
|
---|
| 76 | </xsl:if>
|
---|
| 77 | <xsl:call-template name="process.footnotes"/>
|
---|
| 78 | </div>
|
---|
| 79 | </xsl:template>
|
---|
| 80 |
|
---|
| 81 | <!-- sect1:
|
---|
| 82 | When there is a role attibute, use it as the class value.
|
---|
| 83 | Process the SVN keywords found in sect1info as a footnote.
|
---|
| 84 | Removed unused code. -->
|
---|
| 85 | <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
|
---|
| 86 | <xsl:template match="sect1">
|
---|
| 87 | <div>
|
---|
| 88 | <xsl:choose>
|
---|
| 89 | <xsl:when test="@role">
|
---|
| 90 | <xsl:attribute name="class">
|
---|
| 91 | <xsl:value-of select="@role"/>
|
---|
| 92 | </xsl:attribute>
|
---|
| 93 | </xsl:when>
|
---|
| 94 | <xsl:otherwise>
|
---|
| 95 | <xsl:apply-templates select="." mode="class.attribute"/>
|
---|
| 96 | </xsl:otherwise>
|
---|
| 97 | </xsl:choose>
|
---|
| 98 | <xsl:call-template name="language.attribute"/>
|
---|
| 99 | <xsl:call-template name="sect1.titlepage"/>
|
---|
| 100 | <xsl:apply-templates/>
|
---|
| 101 | <xsl:apply-templates select="sect1info" mode="svn-keys"/>
|
---|
| 102 | </div>
|
---|
| 103 | </xsl:template>
|
---|
| 104 |
|
---|
| 105 | <!-- sect2:
|
---|
| 106 | When there is a role attibute, use it as the class value.
|
---|
| 107 | Removed unused code. -->
|
---|
| 108 | <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
|
---|
| 109 | <xsl:template match="sect2">
|
---|
| 110 | <div>
|
---|
| 111 | <xsl:choose>
|
---|
| 112 | <xsl:when test="@role">
|
---|
| 113 | <xsl:attribute name="class">
|
---|
| 114 | <xsl:value-of select="@role"/>
|
---|
| 115 | </xsl:attribute>
|
---|
| 116 | </xsl:when>
|
---|
| 117 | <xsl:otherwise>
|
---|
| 118 | <xsl:attribute name="class">
|
---|
| 119 | <xsl:value-of select="name(.)"/>
|
---|
| 120 | </xsl:attribute>
|
---|
| 121 | </xsl:otherwise>
|
---|
| 122 | </xsl:choose>
|
---|
| 123 | <xsl:call-template name="language.attribute"/>
|
---|
| 124 | <xsl:call-template name="sect2.titlepage"/>
|
---|
| 125 | <xsl:apply-templates/>
|
---|
| 126 | </div>
|
---|
| 127 | </xsl:template>
|
---|
| 128 |
|
---|
[946abe26] | 129 | <!-- sect3: treat as sect2 (for Python and Perl modules
|
---|
| 130 | When there is a role attibute, use it as the class value.
|
---|
| 131 | Removed unused code. -->
|
---|
| 132 | <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
|
---|
| 133 | <xsl:template match="sect3">
|
---|
| 134 | <div>
|
---|
| 135 | <xsl:choose>
|
---|
| 136 | <xsl:when test="@role">
|
---|
| 137 | <xsl:attribute name="class">
|
---|
| 138 | <xsl:value-of select="@role"/>
|
---|
| 139 | </xsl:attribute>
|
---|
| 140 | </xsl:when>
|
---|
| 141 | <xsl:otherwise>
|
---|
| 142 | <xsl:attribute name="class">
|
---|
| 143 | <xsl:value-of select="name(.)"/>
|
---|
| 144 | </xsl:attribute>
|
---|
| 145 | </xsl:otherwise>
|
---|
| 146 | </xsl:choose>
|
---|
| 147 | <xsl:call-template name="language.attribute"/>
|
---|
| 148 | <xsl:call-template name="sect3.titlepage"/>
|
---|
| 149 | <xsl:apply-templates/>
|
---|
| 150 | </div>
|
---|
| 151 | </xsl:template>
|
---|
| 152 |
|
---|
[65b2904] | 153 | <!-- sect1info mode svn-keys:
|
---|
| 154 | Self-made template to process SVN keywords found in sect1info. -->
|
---|
| 155 | <xsl:template match="sect1info" mode="svn-keys">
|
---|
[d0c81354] | 156 | <!-- <p class="updated">Last updated --><!-- by
|
---|
[65b2904] | 157 | <xsl:apply-templates select="othername" mode="svn-keys"/> -->
|
---|
[d0c81354] | 158 | <!-- on
|
---|
[65b2904] | 159 | <xsl:apply-templates select="date" mode="svn-keys"/>
|
---|
[d0c81354] | 160 | </p> -->
|
---|
[65b2904] | 161 | </xsl:template>
|
---|
| 162 |
|
---|
| 163 | <!-- othername mode svn-keys:
|
---|
| 164 | Self-made template to process the $LastChangedBy SVN keyword. -->
|
---|
| 165 | <xsl:template match="othername" mode="svn-keys">
|
---|
| 166 | <xsl:variable name="author">
|
---|
| 167 | <xsl:value-of select="."/>
|
---|
| 168 | </xsl:variable>
|
---|
| 169 | <xsl:variable name="nameonly">
|
---|
| 170 | <xsl:value-of select="substring($author,16)"/>
|
---|
| 171 | </xsl:variable>
|
---|
| 172 | <xsl:value-of select="substring-before($nameonly,'$')"/>
|
---|
| 173 | </xsl:template>
|
---|
| 174 |
|
---|
| 175 | <!-- date mode svn-keys:
|
---|
| 176 | Self-made template to process the $Date SVN keyword. -->
|
---|
| 177 | <xsl:template match="date" mode="svn-keys">
|
---|
| 178 | <xsl:variable name="date">
|
---|
| 179 | <xsl:value-of select="."/>
|
---|
| 180 | </xsl:variable>
|
---|
| 181 | <xsl:value-of select="substring($date,7,26)"/>
|
---|
| 182 | </xsl:template>
|
---|
| 183 |
|
---|
| 184 | </xsl:stylesheet>
|
---|