[9882b55] | 1 | <?xml version="1.0" encoding="ASCII"?>
|
---|
| 2 | <!--This file was created automatically by html2xhtml-->
|
---|
| 3 | <!--from the HTML stylesheets.-->
|
---|
| 4 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="exsl cf ng db">
|
---|
| 5 |
|
---|
| 6 | <!-- ********************************************************************
|
---|
| 7 | $Id$
|
---|
| 8 | ********************************************************************
|
---|
| 9 |
|
---|
| 10 | This file is part of the XSL DocBook Stylesheet distribution.
|
---|
| 11 | See ../README or http://docbook.sf.net/release/xsl/current/ for
|
---|
| 12 | copyright and other information.
|
---|
| 13 |
|
---|
| 14 | ******************************************************************** -->
|
---|
| 15 |
|
---|
| 16 | <!-- ==================================================================== -->
|
---|
| 17 |
|
---|
| 18 | <xsl:param name="onechunk" select="0"/>
|
---|
| 19 | <xsl:param name="refentry.separator" select="0"/>
|
---|
| 20 | <xsl:param name="chunk.fast" select="0"/>
|
---|
| 21 |
|
---|
| 22 | <xsl:key name="genid" match="*" use="generate-id()"/>
|
---|
| 23 |
|
---|
| 24 | <!-- ==================================================================== -->
|
---|
| 25 |
|
---|
| 26 | <xsl:variable name="chunk.hierarchy">
|
---|
| 27 | <xsl:if test="$chunk.fast != 0">
|
---|
| 28 | <xsl:choose>
|
---|
| 29 | <xsl:when test="function-available('exsl:node-set')">
|
---|
| 30 | <xsl:message>Computing chunks...</xsl:message>
|
---|
| 31 | <xsl:apply-templates select="/*" mode="find.chunks"/>
|
---|
| 32 | </xsl:when>
|
---|
| 33 | <xsl:otherwise>
|
---|
| 34 | <xsl:message>
|
---|
| 35 | <xsl:text>Fast chunking requires exsl:node-set(). </xsl:text>
|
---|
| 36 | <xsl:text>Using "slow" chunking.</xsl:text>
|
---|
| 37 | </xsl:message>
|
---|
| 38 | </xsl:otherwise>
|
---|
| 39 | </xsl:choose>
|
---|
| 40 | </xsl:if>
|
---|
| 41 | </xsl:variable>
|
---|
| 42 |
|
---|
| 43 | <!-- ==================================================================== -->
|
---|
| 44 |
|
---|
| 45 | <xsl:template name="process-chunk-element">
|
---|
| 46 | <xsl:param name="content">
|
---|
| 47 | <xsl:apply-imports/>
|
---|
| 48 | </xsl:param>
|
---|
| 49 |
|
---|
| 50 | <xsl:choose>
|
---|
| 51 | <xsl:when test="$chunk.fast != 0 and function-available('exsl:node-set')">
|
---|
| 52 | <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
|
---|
| 53 | <xsl:variable name="genid" select="generate-id()"/>
|
---|
| 54 |
|
---|
| 55 | <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
|
---|
| 56 |
|
---|
| 57 | <xsl:variable name="prevdiv" select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
|
---|
| 58 | <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
|
---|
| 59 |
|
---|
| 60 | <xsl:variable name="nextdiv" select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
|
---|
| 61 | <xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
|
---|
| 62 |
|
---|
| 63 | <xsl:choose>
|
---|
| 64 | <xsl:when test="$onechunk != 0 and parent::*">
|
---|
| 65 | <xsl:copy-of select="$content"/>
|
---|
| 66 | </xsl:when>
|
---|
| 67 | <xsl:otherwise>
|
---|
| 68 | <xsl:call-template name="process-chunk">
|
---|
| 69 | <xsl:with-param name="prev" select="$prev"/>
|
---|
| 70 | <xsl:with-param name="next" select="$next"/>
|
---|
| 71 | <xsl:with-param name="content" select="$content"/>
|
---|
| 72 | </xsl:call-template>
|
---|
| 73 | </xsl:otherwise>
|
---|
| 74 | </xsl:choose>
|
---|
| 75 | </xsl:when>
|
---|
| 76 | <xsl:otherwise>
|
---|
| 77 | <xsl:choose>
|
---|
| 78 | <xsl:when test="$onechunk != 0 and not(parent::*)">
|
---|
| 79 | <xsl:call-template name="chunk-all-sections">
|
---|
| 80 | <xsl:with-param name="content" select="$content"/>
|
---|
| 81 | </xsl:call-template>
|
---|
| 82 | </xsl:when>
|
---|
| 83 | <xsl:when test="$onechunk != 0">
|
---|
| 84 | <xsl:copy-of select="$content"/>
|
---|
| 85 | </xsl:when>
|
---|
| 86 | <xsl:when test="$chunk.first.sections = 0">
|
---|
| 87 | <xsl:call-template name="chunk-first-section-with-parent">
|
---|
| 88 | <xsl:with-param name="content" select="$content"/>
|
---|
| 89 | </xsl:call-template>
|
---|
| 90 | </xsl:when>
|
---|
| 91 | <xsl:otherwise>
|
---|
| 92 | <xsl:call-template name="chunk-all-sections">
|
---|
| 93 | <xsl:with-param name="content" select="$content"/>
|
---|
| 94 | </xsl:call-template>
|
---|
| 95 | </xsl:otherwise>
|
---|
| 96 | </xsl:choose>
|
---|
| 97 | </xsl:otherwise>
|
---|
| 98 | </xsl:choose>
|
---|
| 99 | </xsl:template>
|
---|
| 100 |
|
---|
| 101 | <xsl:template name="process-chunk">
|
---|
| 102 | <xsl:param name="prev" select="."/>
|
---|
| 103 | <xsl:param name="next" select="."/>
|
---|
| 104 | <xsl:param name="content">
|
---|
| 105 | <xsl:apply-imports/>
|
---|
| 106 | </xsl:param>
|
---|
| 107 |
|
---|
| 108 | <xsl:variable name="ischunk">
|
---|
| 109 | <xsl:call-template name="chunk"/>
|
---|
| 110 | </xsl:variable>
|
---|
| 111 |
|
---|
| 112 | <xsl:variable name="chunkfn">
|
---|
| 113 | <xsl:if test="$ischunk='1'">
|
---|
| 114 | <xsl:apply-templates mode="chunk-filename" select="."/>
|
---|
| 115 | </xsl:if>
|
---|
| 116 | </xsl:variable>
|
---|
| 117 |
|
---|
| 118 | <xsl:if test="$ischunk='0'">
|
---|
| 119 | <xsl:message>
|
---|
| 120 | <xsl:text>Error </xsl:text>
|
---|
| 121 | <xsl:value-of select="name(.)"/>
|
---|
| 122 | <xsl:text> is not a chunk!</xsl:text>
|
---|
| 123 | </xsl:message>
|
---|
| 124 | </xsl:if>
|
---|
| 125 |
|
---|
| 126 | <xsl:variable name="filename">
|
---|
| 127 | <xsl:call-template name="make-relative-filename">
|
---|
| 128 | <xsl:with-param name="base.dir" select="$base.dir"/>
|
---|
| 129 | <xsl:with-param name="base.name" select="$chunkfn"/>
|
---|
| 130 | </xsl:call-template>
|
---|
| 131 | </xsl:variable>
|
---|
| 132 |
|
---|
| 133 | <xsl:call-template name="write.chunk">
|
---|
| 134 | <xsl:with-param name="filename" select="$filename"/>
|
---|
| 135 | <xsl:with-param name="content">
|
---|
| 136 | <xsl:call-template name="chunk-element-content">
|
---|
| 137 | <xsl:with-param name="prev" select="$prev"/>
|
---|
| 138 | <xsl:with-param name="next" select="$next"/>
|
---|
| 139 | <xsl:with-param name="content" select="$content"/>
|
---|
| 140 | </xsl:call-template>
|
---|
| 141 | </xsl:with-param>
|
---|
| 142 | <xsl:with-param name="quiet" select="$chunk.quietly"/>
|
---|
| 143 | </xsl:call-template>
|
---|
| 144 | </xsl:template>
|
---|
| 145 |
|
---|
| 146 | <xsl:template name="chunk-first-section-with-parent">
|
---|
| 147 | <xsl:param name="content">
|
---|
| 148 | <xsl:apply-imports/>
|
---|
| 149 | </xsl:param>
|
---|
| 150 |
|
---|
| 151 | <!-- These xpath expressions are really hairy. The trick is to pick sections -->
|
---|
| 152 | <!-- that are not first children and are not the children of first children -->
|
---|
| 153 |
|
---|
| 154 | <!-- Break these variables into pieces to work around
|
---|
| 155 | http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6063 -->
|
---|
| 156 |
|
---|
| 157 | <xsl:variable name="prev-v1" select="(ancestor::sect1[$chunk.section.depth > 0 and preceding-sibling::sect1][1] |ancestor::sect2[$chunk.section.depth > 1 and preceding-sibling::sect2 and parent::sect1[preceding-sibling::sect1]][1] |ancestor::sect3[$chunk.section.depth > 2 and preceding-sibling::sect3 and parent::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |ancestor::sect4[$chunk.section.depth > 3 and preceding-sibling::sect4 and parent::sect3[preceding-sibling::sect3] and ancestor::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |ancestor::sect5[$chunk.section.depth > 4 and preceding-sibling::sect5 and parent::sect4[preceding-sibling::sect4] and ancestor::sect3[preceding-sibling::sect3] and ancestor::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |ancestor::section[$chunk.section.depth > count(ancestor::section) and not(ancestor::section[not(preceding-sibling::section)])][1])[last()]"/>
|
---|
| 158 |
|
---|
| 159 | <xsl:variable name="prev-v2" select="(preceding::sect1[$chunk.section.depth > 0 and preceding-sibling::sect1][1] |preceding::sect2[$chunk.section.depth > 1 and preceding-sibling::sect2 and parent::sect1[preceding-sibling::sect1]][1] |preceding::sect3[$chunk.section.depth > 2 and preceding-sibling::sect3 and parent::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |preceding::sect4[$chunk.section.depth > 3 and preceding-sibling::sect4 and parent::sect3[preceding-sibling::sect3] and ancestor::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |preceding::sect5[$chunk.section.depth > 4 and preceding-sibling::sect5 and parent::sect4[preceding-sibling::sect4] and ancestor::sect3[preceding-sibling::sect3] and ancestor::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |preceding::section[$chunk.section.depth > count(ancestor::section) and preceding-sibling::section and not(ancestor::section[not(preceding-sibling::section)])][1])[last()]"/>
|
---|
| 160 |
|
---|
| 161 | <xsl:variable name="prev" select="(preceding::book[1] |preceding::preface[1] |preceding::chapter[1] |preceding::appendix[1] |preceding::part[1] |preceding::reference[1] |preceding::refentry[1] |preceding::colophon[1] |preceding::article[1] |preceding::bibliography[parent::article or parent::book or parent::part][1] |preceding::glossary[parent::article or parent::book or parent::part][1] |preceding::index[$generate.index != 0] [parent::article or parent::book or parent::part][1] |preceding::setindex[$generate.index != 0][1] |ancestor::set |ancestor::book[1] |ancestor::preface[1] |ancestor::chapter[1] |ancestor::appendix[1] |ancestor::part[1] |ancestor::reference[1] |ancestor::article[1] |$prev-v1 |$prev-v2)[last()]"/>
|
---|
| 162 |
|
---|
| 163 | <xsl:variable name="next-v1" select="(following::sect1[$chunk.section.depth > 0 and preceding-sibling::sect1][1] |following::sect2[$chunk.section.depth > 1 and preceding-sibling::sect2 and parent::sect1[preceding-sibling::sect1]][1] |following::sect3[$chunk.section.depth > 2 and preceding-sibling::sect3 and parent::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |following::sect4[$chunk.section.depth > 3 and preceding-sibling::sect4 and parent::sect3[preceding-sibling::sect3] and ancestor::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |following::sect5[$chunk.section.depth > 4 and preceding-sibling::sect5 and parent::sect4[preceding-sibling::sect4] and ancestor::sect3[preceding-sibling::sect3] and ancestor::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |following::section[$chunk.section.depth > count(ancestor::section) and preceding-sibling::section and not(ancestor::section[not(preceding-sibling::section)])][1])[1]"/>
|
---|
| 164 |
|
---|
| 165 | <xsl:variable name="next-v2" select="(descendant::sect1[$chunk.section.depth > 0 and preceding-sibling::sect1][1] |descendant::sect2[$chunk.section.depth > 1 and preceding-sibling::sect2 and parent::sect1[preceding-sibling::sect1]][1] |descendant::sect3[$chunk.section.depth > 2 and preceding-sibling::sect3 and parent::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |descendant::sect4[$chunk.section.depth > 3 and preceding-sibling::sect4 and parent::sect3[preceding-sibling::sect3] and ancestor::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |descendant::sect5[$chunk.section.depth > 4 and preceding-sibling::sect5 and parent::sect4[preceding-sibling::sect4] and ancestor::sect3[preceding-sibling::sect3] and ancestor::sect2[preceding-sibling::sect2] and ancestor::sect1[preceding-sibling::sect1]][1] |descendant::section[$chunk.section.depth > count(ancestor::section) and preceding-sibling::section and not(ancestor::section[not(preceding-sibling::section)])])[1]"/>
|
---|
| 166 |
|
---|
| 167 | <xsl:variable name="next" select="(following::book[1] |following::preface[1] |following::chapter[1] |following::appendix[1] |following::part[1] |following::reference[1] |following::refentry[1] |following::colophon[1] |following::bibliography[parent::article or parent::book or parent::part][1] |following::glossary[parent::article or parent::book or parent::part][1] |following::index[$generate.index != 0] [parent::article or parent::book or parent::part][1] |following::article[1] |following::setindex[$generate.index != 0][1] |descendant::book[1] |descendant::preface[1] |descendant::chapter[1] |descendant::appendix[1] |descendant::article[1] |descendant::bibliography[parent::article or parent::book or parent::part][1] |descendant::glossary[parent::article or parent::book or parent::part][1] |descendant::index[$generate.index != 0] [parent::article or parent::book or parent::part][1] |descendant::colophon[1] |descendant::setindex[$generate.index != 0][1] |descendant::part[1] |descendant::reference[1] |descendant::refentry[1] |$next-v1 |$next-v2)[1]"/>
|
---|
| 168 |
|
---|
| 169 | <xsl:call-template name="process-chunk">
|
---|
| 170 | <xsl:with-param name="prev" select="$prev"/>
|
---|
| 171 | <xsl:with-param name="next" select="$next"/>
|
---|
| 172 | <xsl:with-param name="content" select="$content"/>
|
---|
| 173 | </xsl:call-template>
|
---|
| 174 | </xsl:template>
|
---|
| 175 |
|
---|
| 176 | <xsl:template name="chunk-all-sections">
|
---|
| 177 | <xsl:param name="content">
|
---|
| 178 | <xsl:apply-imports/>
|
---|
| 179 | </xsl:param>
|
---|
| 180 |
|
---|
| 181 | <xsl:variable name="prev-v1" select="(preceding::sect1[$chunk.section.depth > 0][1] |preceding::sect2[$chunk.section.depth > 1][1] |preceding::sect3[$chunk.section.depth > 2][1] |preceding::sect4[$chunk.section.depth > 3][1] |preceding::sect5[$chunk.section.depth > 4][1] |preceding::section[$chunk.section.depth > count(ancestor::section)][1])[last()]"/>
|
---|
| 182 |
|
---|
| 183 | <xsl:variable name="prev-v2" select="(ancestor::sect1[$chunk.section.depth > 0][1] |ancestor::sect2[$chunk.section.depth > 1][1] |ancestor::sect3[$chunk.section.depth > 2][1] |ancestor::sect4[$chunk.section.depth > 3][1] |ancestor::sect5[$chunk.section.depth > 4][1] |ancestor::section[$chunk.section.depth > count(ancestor::section)][1])[last()]"/>
|
---|
| 184 |
|
---|
| 185 | <xsl:variable name="prev" select="(preceding::book[1] |preceding::preface[1] |preceding::chapter[1] |preceding::appendix[1] |preceding::part[1] |preceding::reference[1] |preceding::refentry[1] |preceding::colophon[1] |preceding::article[1] |preceding::bibliography[parent::article or parent::book or parent::part][1] |preceding::glossary[parent::article or parent::book or parent::part][1] |preceding::index[$generate.index != 0] [parent::article or parent::book or parent::part][1] |preceding::setindex[$generate.index != 0][1] |ancestor::set |ancestor::book[1] |ancestor::preface[1] |ancestor::chapter[1] |ancestor::appendix[1] |ancestor::part[1] |ancestor::reference[1] |ancestor::article[1] |$prev-v1 |$prev-v2)[last()]"/>
|
---|
| 186 |
|
---|
| 187 | <xsl:variable name="next-v1" select="(following::sect1[$chunk.section.depth > 0][1] |following::sect2[$chunk.section.depth > 1][1] |following::sect3[$chunk.section.depth > 2][1] |following::sect4[$chunk.section.depth > 3][1] |following::sect5[$chunk.section.depth > 4][1] |following::section[$chunk.section.depth > count(ancestor::section)][1])[1]"/>
|
---|
| 188 |
|
---|
| 189 | <xsl:variable name="next-v2" select="(descendant::sect1[$chunk.section.depth > 0][1] |descendant::sect2[$chunk.section.depth > 1][1] |descendant::sect3[$chunk.section.depth > 2][1] |descendant::sect4[$chunk.section.depth > 3][1] |descendant::sect5[$chunk.section.depth > 4][1] |descendant::section[$chunk.section.depth > count(ancestor::section)][1])[1]"/>
|
---|
| 190 |
|
---|
| 191 | <xsl:variable name="next" select="(following::book[1] |following::preface[1] |following::chapter[1] |following::appendix[1] |following::part[1] |following::reference[1] |following::refentry[1] |following::colophon[1] |following::bibliography[parent::article or parent::book or parent::part][1] |following::glossary[parent::article or parent::book or parent::part][1] |following::index[$generate.index != 0] [parent::article or parent::book][1] |following::article[1] |following::setindex[$generate.index != 0][1] |descendant::book[1] |descendant::preface[1] |descendant::chapter[1] |descendant::appendix[1] |descendant::article[1] |descendant::bibliography[parent::article or parent::book][1] |descendant::glossary[parent::article or parent::book or parent::part][1] |descendant::index[$generate.index != 0] [parent::article or parent::book][1] |descendant::colophon[1] |descendant::setindex[$generate.index != 0][1] |descendant::part[1] |descendant::reference[1] |descendant::refentry[1] |$next-v1 |$next-v2)[1]"/>
|
---|
| 192 |
|
---|
| 193 | <xsl:call-template name="process-chunk">
|
---|
| 194 | <xsl:with-param name="prev" select="$prev"/>
|
---|
| 195 | <xsl:with-param name="next" select="$next"/>
|
---|
| 196 | <xsl:with-param name="content" select="$content"/>
|
---|
| 197 | </xsl:call-template>
|
---|
| 198 | </xsl:template>
|
---|
| 199 |
|
---|
| 200 | <!-- ==================================================================== -->
|
---|
| 201 |
|
---|
| 202 | <!-- ==================================================================== -->
|
---|
| 203 |
|
---|
| 204 | <xsl:template name="make.lots">
|
---|
| 205 | <xsl:param name="toc.params" select="''"/>
|
---|
| 206 | <xsl:param name="toc"/>
|
---|
| 207 |
|
---|
| 208 | <xsl:variable name="lots">
|
---|
| 209 | <xsl:if test="contains($toc.params, 'toc')">
|
---|
| 210 | <xsl:copy-of select="$toc"/>
|
---|
| 211 | </xsl:if>
|
---|
| 212 |
|
---|
| 213 | <xsl:if test="contains($toc.params, 'figure')">
|
---|
| 214 | <xsl:choose>
|
---|
| 215 | <xsl:when test="$chunk.separate.lots != '0'">
|
---|
| 216 | <xsl:call-template name="make.lot.chunk">
|
---|
| 217 | <xsl:with-param name="type" select="'figure'"/>
|
---|
| 218 | <xsl:with-param name="lot">
|
---|
| 219 | <xsl:call-template name="list.of.titles">
|
---|
| 220 | <xsl:with-param name="titles" select="'figure'"/>
|
---|
| 221 | <xsl:with-param name="nodes" select=".//figure"/>
|
---|
| 222 | </xsl:call-template>
|
---|
| 223 | </xsl:with-param>
|
---|
| 224 | </xsl:call-template>
|
---|
| 225 | </xsl:when>
|
---|
| 226 | <xsl:otherwise>
|
---|
| 227 | <xsl:call-template name="list.of.titles">
|
---|
| 228 | <xsl:with-param name="titles" select="'figure'"/>
|
---|
| 229 | <xsl:with-param name="nodes" select=".//figure"/>
|
---|
| 230 | </xsl:call-template>
|
---|
| 231 | </xsl:otherwise>
|
---|
| 232 | </xsl:choose>
|
---|
| 233 | </xsl:if>
|
---|
| 234 |
|
---|
| 235 | <xsl:if test="contains($toc.params, 'table')">
|
---|
| 236 | <xsl:choose>
|
---|
| 237 | <xsl:when test="$chunk.separate.lots != '0'">
|
---|
| 238 | <xsl:call-template name="make.lot.chunk">
|
---|
| 239 | <xsl:with-param name="type" select="'table'"/>
|
---|
| 240 | <xsl:with-param name="lot">
|
---|
| 241 | <xsl:call-template name="list.of.titles">
|
---|
| 242 | <xsl:with-param name="titles" select="'table'"/>
|
---|
| 243 | <xsl:with-param name="nodes" select=".//table"/>
|
---|
| 244 | </xsl:call-template>
|
---|
| 245 | </xsl:with-param>
|
---|
| 246 | </xsl:call-template>
|
---|
| 247 | </xsl:when>
|
---|
| 248 | <xsl:otherwise>
|
---|
| 249 | <xsl:call-template name="list.of.titles">
|
---|
| 250 | <xsl:with-param name="titles" select="'table'"/>
|
---|
| 251 | <xsl:with-param name="nodes" select=".//table"/>
|
---|
| 252 | </xsl:call-template>
|
---|
| 253 | </xsl:otherwise>
|
---|
| 254 | </xsl:choose>
|
---|
| 255 | </xsl:if>
|
---|
| 256 |
|
---|
| 257 | <xsl:if test="contains($toc.params, 'example')">
|
---|
| 258 | <xsl:choose>
|
---|
| 259 | <xsl:when test="$chunk.separate.lots != '0'">
|
---|
| 260 | <xsl:call-template name="make.lot.chunk">
|
---|
| 261 | <xsl:with-param name="type" select="'example'"/>
|
---|
| 262 | <xsl:with-param name="lot">
|
---|
| 263 | <xsl:call-template name="list.of.titles">
|
---|
| 264 | <xsl:with-param name="titles" select="'example'"/>
|
---|
| 265 | <xsl:with-param name="nodes" select=".//example"/>
|
---|
| 266 | </xsl:call-template>
|
---|
| 267 | </xsl:with-param>
|
---|
| 268 | </xsl:call-template>
|
---|
| 269 | </xsl:when>
|
---|
| 270 | <xsl:otherwise>
|
---|
| 271 | <xsl:call-template name="list.of.titles">
|
---|
| 272 | <xsl:with-param name="titles" select="'example'"/>
|
---|
| 273 | <xsl:with-param name="nodes" select=".//example"/>
|
---|
| 274 | </xsl:call-template>
|
---|
| 275 | </xsl:otherwise>
|
---|
| 276 | </xsl:choose>
|
---|
| 277 | </xsl:if>
|
---|
| 278 |
|
---|
| 279 | <xsl:if test="contains($toc.params, 'equation')">
|
---|
| 280 | <xsl:choose>
|
---|
| 281 | <xsl:when test="$chunk.separate.lots != '0'">
|
---|
| 282 | <xsl:call-template name="make.lot.chunk">
|
---|
| 283 | <xsl:with-param name="type" select="'equation'"/>
|
---|
| 284 | <xsl:with-param name="lot">
|
---|
| 285 | <xsl:call-template name="list.of.titles">
|
---|
| 286 | <xsl:with-param name="titles" select="'equation'"/>
|
---|
| 287 | <xsl:with-param name="nodes" select=".//equation"/>
|
---|
| 288 | </xsl:call-template>
|
---|
| 289 | </xsl:with-param>
|
---|
| 290 | </xsl:call-template>
|
---|
| 291 | </xsl:when>
|
---|
| 292 | <xsl:otherwise>
|
---|
| 293 | <xsl:call-template name="list.of.titles">
|
---|
| 294 | <xsl:with-param name="titles" select="'equation'"/>
|
---|
| 295 | <xsl:with-param name="nodes" select=".//equation"/>
|
---|
| 296 | </xsl:call-template>
|
---|
| 297 | </xsl:otherwise>
|
---|
| 298 | </xsl:choose>
|
---|
| 299 | </xsl:if>
|
---|
| 300 |
|
---|
| 301 | <xsl:if test="contains($toc.params, 'procedure')">
|
---|
| 302 | <xsl:choose>
|
---|
| 303 | <xsl:when test="$chunk.separate.lots != '0'">
|
---|
| 304 | <xsl:call-template name="make.lot.chunk">
|
---|
| 305 | <xsl:with-param name="type" select="'procedure'"/>
|
---|
| 306 | <xsl:with-param name="lot">
|
---|
| 307 | <xsl:call-template name="list.of.titles">
|
---|
| 308 | <xsl:with-param name="titles" select="'procedure'"/>
|
---|
| 309 | <xsl:with-param name="nodes" select=".//procedure[title]"/>
|
---|
| 310 | </xsl:call-template>
|
---|
| 311 | </xsl:with-param>
|
---|
| 312 | </xsl:call-template>
|
---|
| 313 | </xsl:when>
|
---|
| 314 | <xsl:otherwise>
|
---|
| 315 | <xsl:call-template name="list.of.titles">
|
---|
| 316 | <xsl:with-param name="titles" select="'procedure'"/>
|
---|
| 317 | <xsl:with-param name="nodes" select=".//procedure[title]"/>
|
---|
| 318 | </xsl:call-template>
|
---|
| 319 | </xsl:otherwise>
|
---|
| 320 | </xsl:choose>
|
---|
| 321 | </xsl:if>
|
---|
| 322 | </xsl:variable>
|
---|
| 323 |
|
---|
| 324 | <xsl:if test="string($lots) != ''">
|
---|
| 325 | <xsl:choose>
|
---|
| 326 | <xsl:when test="$chunk.tocs.and.lots != 0 and not(parent::*)">
|
---|
| 327 | <xsl:call-template name="write.chunk">
|
---|
| 328 | <xsl:with-param name="filename">
|
---|
| 329 | <xsl:call-template name="make-relative-filename">
|
---|
| 330 | <xsl:with-param name="base.dir" select="$base.dir"/>
|
---|
| 331 | <xsl:with-param name="base.name">
|
---|
| 332 | <xsl:call-template name="dbhtml-dir"/>
|
---|
| 333 | <xsl:apply-templates select="." mode="recursive-chunk-filename">
|
---|
| 334 | <xsl:with-param name="recursive" select="true()"/>
|
---|
| 335 | </xsl:apply-templates>
|
---|
| 336 | <xsl:text>-toc</xsl:text>
|
---|
| 337 | <xsl:value-of select="$html.ext"/>
|
---|
| 338 | </xsl:with-param>
|
---|
| 339 | </xsl:call-template>
|
---|
| 340 | </xsl:with-param>
|
---|
| 341 | <xsl:with-param name="content">
|
---|
| 342 | <xsl:call-template name="chunk-element-content">
|
---|
| 343 | <xsl:with-param name="prev" select="/foo"/>
|
---|
| 344 | <xsl:with-param name="next" select="/foo"/>
|
---|
| 345 | <xsl:with-param name="nav.context" select="'toc'"/>
|
---|
| 346 | <xsl:with-param name="content">
|
---|
| 347 | <xsl:if test="$chunk.tocs.and.lots.has.title != 0">
|
---|
| 348 | <h1>
|
---|
| 349 | <xsl:apply-templates select="." mode="object.title.markup"/>
|
---|
| 350 | </h1>
|
---|
| 351 | </xsl:if>
|
---|
| 352 | <xsl:copy-of select="$lots"/>
|
---|
| 353 | </xsl:with-param>
|
---|
| 354 | </xsl:call-template>
|
---|
| 355 | </xsl:with-param>
|
---|
| 356 | <xsl:with-param name="quiet" select="$chunk.quietly"/>
|
---|
| 357 | </xsl:call-template>
|
---|
| 358 | </xsl:when>
|
---|
| 359 | <xsl:otherwise>
|
---|
| 360 | <xsl:copy-of select="$lots"/>
|
---|
| 361 | </xsl:otherwise>
|
---|
| 362 | </xsl:choose>
|
---|
| 363 | </xsl:if>
|
---|
| 364 | </xsl:template>
|
---|
| 365 |
|
---|
| 366 | <xsl:template name="make.lot.chunk">
|
---|
| 367 | <xsl:param name="type" select="''"/>
|
---|
| 368 | <xsl:param name="lot"/>
|
---|
| 369 |
|
---|
| 370 | <xsl:if test="string($lot) != ''">
|
---|
| 371 | <xsl:variable name="filename">
|
---|
| 372 | <xsl:call-template name="make-relative-filename">
|
---|
| 373 | <xsl:with-param name="base.dir" select="$base.dir"/>
|
---|
| 374 | <xsl:with-param name="base.name">
|
---|
| 375 | <xsl:call-template name="dbhtml-dir"/>
|
---|
| 376 | <xsl:value-of select="$type"/>
|
---|
| 377 | <xsl:text>-toc</xsl:text>
|
---|
| 378 | <xsl:value-of select="$html.ext"/>
|
---|
| 379 | </xsl:with-param>
|
---|
| 380 | </xsl:call-template>
|
---|
| 381 | </xsl:variable>
|
---|
| 382 |
|
---|
| 383 | <xsl:variable name="href">
|
---|
| 384 | <xsl:call-template name="make-relative-filename">
|
---|
| 385 | <xsl:with-param name="base.name">
|
---|
| 386 | <xsl:call-template name="dbhtml-dir"/>
|
---|
| 387 | <xsl:value-of select="$type"/>
|
---|
| 388 | <xsl:text>-toc</xsl:text>
|
---|
| 389 | <xsl:value-of select="$html.ext"/>
|
---|
| 390 | </xsl:with-param>
|
---|
| 391 | </xsl:call-template>
|
---|
| 392 | </xsl:variable>
|
---|
| 393 |
|
---|
| 394 | <xsl:call-template name="write.chunk">
|
---|
| 395 | <xsl:with-param name="filename" select="$filename"/>
|
---|
| 396 | <xsl:with-param name="content">
|
---|
| 397 | <xsl:call-template name="chunk-element-content">
|
---|
| 398 | <xsl:with-param name="prev" select="/foo"/>
|
---|
| 399 | <xsl:with-param name="next" select="/foo"/>
|
---|
| 400 | <xsl:with-param name="nav.context" select="'toc'"/>
|
---|
| 401 | <xsl:with-param name="content">
|
---|
| 402 | <xsl:copy-of select="$lot"/>
|
---|
| 403 | </xsl:with-param>
|
---|
| 404 | </xsl:call-template>
|
---|
| 405 | </xsl:with-param>
|
---|
| 406 | <xsl:with-param name="quiet" select="$chunk.quietly"/>
|
---|
| 407 | </xsl:call-template>
|
---|
| 408 | <!-- And output a link to this file -->
|
---|
| 409 | <div>
|
---|
| 410 | <xsl:attribute name="class">
|
---|
| 411 | <xsl:text>ListofTitles</xsl:text>
|
---|
| 412 | </xsl:attribute>
|
---|
| 413 | <a href="{$href}">
|
---|
| 414 | <xsl:call-template name="gentext">
|
---|
| 415 | <xsl:with-param name="key">
|
---|
| 416 | <xsl:choose>
|
---|
| 417 | <xsl:when test="$type='table'">ListofTables</xsl:when>
|
---|
| 418 | <xsl:when test="$type='figure'">ListofFigures</xsl:when>
|
---|
| 419 | <xsl:when test="$type='equation'">ListofEquations</xsl:when>
|
---|
| 420 | <xsl:when test="$type='example'">ListofExamples</xsl:when>
|
---|
| 421 | <xsl:when test="$type='procedure'">ListofProcedures</xsl:when>
|
---|
| 422 | <xsl:otherwise>ListofUnknown</xsl:otherwise>
|
---|
| 423 | </xsl:choose>
|
---|
| 424 | </xsl:with-param>
|
---|
| 425 | </xsl:call-template>
|
---|
| 426 | </a>
|
---|
| 427 | </div>
|
---|
| 428 | </xsl:if>
|
---|
| 429 | </xsl:template>
|
---|
| 430 |
|
---|
| 431 | <!-- ==================================================================== -->
|
---|
| 432 |
|
---|
| 433 | <xsl:template name="in.other.chunk">
|
---|
| 434 | <xsl:param name="chunk" select="."/>
|
---|
| 435 | <xsl:param name="node" select="."/>
|
---|
| 436 |
|
---|
| 437 | <xsl:variable name="is.chunk">
|
---|
| 438 | <xsl:call-template name="chunk">
|
---|
| 439 | <xsl:with-param name="node" select="$node"/>
|
---|
| 440 | </xsl:call-template>
|
---|
| 441 | </xsl:variable>
|
---|
| 442 |
|
---|
| 443 | <!--
|
---|
| 444 | <xsl:message>
|
---|
| 445 | <xsl:text>in.other.chunk: </xsl:text>
|
---|
| 446 | <xsl:value-of select="name($chunk)"/>
|
---|
| 447 | <xsl:text> </xsl:text>
|
---|
| 448 | <xsl:value-of select="name($node)"/>
|
---|
| 449 | <xsl:text> </xsl:text>
|
---|
| 450 | <xsl:value-of select="$chunk = $node"/>
|
---|
| 451 | <xsl:text> </xsl:text>
|
---|
| 452 | <xsl:value-of select="$is.chunk"/>
|
---|
| 453 | </xsl:message>
|
---|
| 454 | -->
|
---|
| 455 |
|
---|
| 456 | <xsl:choose>
|
---|
| 457 | <xsl:when test="$chunk = $node">0</xsl:when>
|
---|
| 458 | <xsl:when test="$is.chunk = 1">1</xsl:when>
|
---|
| 459 | <xsl:when test="count($node) = 0">0</xsl:when>
|
---|
| 460 | <xsl:otherwise>
|
---|
| 461 | <xsl:call-template name="in.other.chunk">
|
---|
| 462 | <xsl:with-param name="chunk" select="$chunk"/>
|
---|
| 463 | <xsl:with-param name="node" select="$node/parent::*"/>
|
---|
| 464 | </xsl:call-template>
|
---|
| 465 | </xsl:otherwise>
|
---|
| 466 | </xsl:choose>
|
---|
| 467 | </xsl:template>
|
---|
| 468 |
|
---|
| 469 | <xsl:template name="count.footnotes.in.this.chunk">
|
---|
| 470 | <xsl:param name="node" select="."/>
|
---|
| 471 | <xsl:param name="footnotes" select="$node//footnote"/>
|
---|
| 472 | <xsl:param name="count" select="0"/>
|
---|
| 473 |
|
---|
| 474 | <!--
|
---|
| 475 | <xsl:message>
|
---|
| 476 | <xsl:text>count.footnotes.in.this.chunk: </xsl:text>
|
---|
| 477 | <xsl:value-of select="name($node)"/>
|
---|
| 478 | </xsl:message>
|
---|
| 479 | -->
|
---|
| 480 |
|
---|
| 481 | <xsl:variable name="in.other.chunk">
|
---|
| 482 | <xsl:call-template name="in.other.chunk">
|
---|
| 483 | <xsl:with-param name="chunk" select="$node"/>
|
---|
| 484 | <xsl:with-param name="node" select="$footnotes[1]"/>
|
---|
| 485 | </xsl:call-template>
|
---|
| 486 | </xsl:variable>
|
---|
| 487 |
|
---|
| 488 | <xsl:choose>
|
---|
| 489 | <xsl:when test="count($footnotes) = 0">
|
---|
| 490 | <xsl:value-of select="$count"/>
|
---|
| 491 | </xsl:when>
|
---|
| 492 | <xsl:otherwise>
|
---|
| 493 | <xsl:choose>
|
---|
| 494 | <xsl:when test="$in.other.chunk != 0">
|
---|
| 495 | <xsl:call-template name="count.footnotes.in.this.chunk">
|
---|
| 496 | <xsl:with-param name="node" select="$node"/>
|
---|
| 497 | <xsl:with-param name="footnotes" select="$footnotes[position() > 1]"/>
|
---|
| 498 | <xsl:with-param name="count" select="$count"/>
|
---|
| 499 | </xsl:call-template>
|
---|
| 500 | </xsl:when>
|
---|
| 501 | <xsl:when test="$footnotes[1]/ancestor::table |$footnotes[1]/ancestor::informaltable">
|
---|
| 502 | <xsl:call-template name="count.footnotes.in.this.chunk">
|
---|
| 503 | <xsl:with-param name="node" select="$node"/>
|
---|
| 504 | <xsl:with-param name="footnotes" select="$footnotes[position() > 1]"/>
|
---|
| 505 | <xsl:with-param name="count" select="$count"/>
|
---|
| 506 | </xsl:call-template>
|
---|
| 507 | </xsl:when>
|
---|
| 508 | <xsl:otherwise>
|
---|
| 509 | <xsl:call-template name="count.footnotes.in.this.chunk">
|
---|
| 510 | <xsl:with-param name="node" select="$node"/>
|
---|
| 511 | <xsl:with-param name="footnotes" select="$footnotes[position() > 1]"/>
|
---|
| 512 | <xsl:with-param name="count" select="$count + 1"/>
|
---|
| 513 | </xsl:call-template>
|
---|
| 514 | </xsl:otherwise>
|
---|
| 515 | </xsl:choose>
|
---|
| 516 | </xsl:otherwise>
|
---|
| 517 | </xsl:choose>
|
---|
| 518 | </xsl:template>
|
---|
| 519 |
|
---|
| 520 | <xsl:template name="process.footnotes.in.this.chunk">
|
---|
| 521 | <xsl:param name="node" select="."/>
|
---|
| 522 | <xsl:param name="footnotes" select="$node//footnote"/>
|
---|
| 523 |
|
---|
| 524 | <!--
|
---|
| 525 | <xsl:message>process.footnotes.in.this.chunk</xsl:message>
|
---|
| 526 | -->
|
---|
| 527 |
|
---|
| 528 | <xsl:variable name="in.other.chunk">
|
---|
| 529 | <xsl:call-template name="in.other.chunk">
|
---|
| 530 | <xsl:with-param name="chunk" select="$node"/>
|
---|
| 531 | <xsl:with-param name="node" select="$footnotes[1]"/>
|
---|
| 532 | </xsl:call-template>
|
---|
| 533 | </xsl:variable>
|
---|
| 534 |
|
---|
| 535 | <xsl:choose>
|
---|
| 536 | <xsl:when test="count($footnotes) = 0">
|
---|
| 537 | <!-- nop -->
|
---|
| 538 | </xsl:when>
|
---|
| 539 | <xsl:otherwise>
|
---|
| 540 | <xsl:choose>
|
---|
| 541 | <xsl:when test="$in.other.chunk != 0">
|
---|
| 542 | <xsl:call-template name="process.footnotes.in.this.chunk">
|
---|
| 543 | <xsl:with-param name="node" select="$node"/>
|
---|
| 544 | <xsl:with-param name="footnotes" select="$footnotes[position() > 1]"/>
|
---|
| 545 | </xsl:call-template>
|
---|
| 546 | </xsl:when>
|
---|
| 547 | <xsl:when test="$footnotes[1]/ancestor::table |$footnotes[1]/ancestor::informaltable">
|
---|
| 548 | <xsl:call-template name="process.footnotes.in.this.chunk">
|
---|
| 549 | <xsl:with-param name="node" select="$node"/>
|
---|
| 550 | <xsl:with-param name="footnotes" select="$footnotes[position() > 1]"/>
|
---|
| 551 | </xsl:call-template>
|
---|
| 552 | </xsl:when>
|
---|
| 553 | <xsl:otherwise>
|
---|
| 554 | <xsl:apply-templates select="$footnotes[1]" mode="process.footnote.mode"/>
|
---|
| 555 | <xsl:call-template name="process.footnotes.in.this.chunk">
|
---|
| 556 | <xsl:with-param name="node" select="$node"/>
|
---|
| 557 | <xsl:with-param name="footnotes" select="$footnotes[position() > 1]"/>
|
---|
| 558 | </xsl:call-template>
|
---|
| 559 | </xsl:otherwise>
|
---|
| 560 | </xsl:choose>
|
---|
| 561 | </xsl:otherwise>
|
---|
| 562 | </xsl:choose>
|
---|
| 563 | </xsl:template>
|
---|
| 564 |
|
---|
| 565 | <xsl:template name="process.footnotes">
|
---|
| 566 | <xsl:variable name="footnotes" select=".//footnote"/>
|
---|
| 567 | <xsl:variable name="fcount">
|
---|
| 568 | <xsl:call-template name="count.footnotes.in.this.chunk">
|
---|
| 569 | <xsl:with-param name="node" select="."/>
|
---|
| 570 | <xsl:with-param name="footnotes" select="$footnotes"/>
|
---|
| 571 | </xsl:call-template>
|
---|
| 572 | </xsl:variable>
|
---|
| 573 |
|
---|
| 574 | <!--
|
---|
| 575 | <xsl:message>
|
---|
| 576 | <xsl:value-of select="name(.)"/>
|
---|
| 577 | <xsl:text> fcount: </xsl:text>
|
---|
| 578 | <xsl:value-of select="$fcount"/>
|
---|
| 579 | </xsl:message>
|
---|
| 580 | -->
|
---|
| 581 |
|
---|
| 582 | <!-- Only bother to do this if there's at least one non-table footnote -->
|
---|
| 583 | <xsl:if test="$fcount > 0">
|
---|
| 584 | <div class="footnotes">
|
---|
| 585 | <br/>
|
---|
| 586 | <hr width="100" align="left"/>
|
---|
| 587 | <xsl:call-template name="process.footnotes.in.this.chunk">
|
---|
| 588 | <xsl:with-param name="node" select="."/>
|
---|
| 589 | <xsl:with-param name="footnotes" select="$footnotes"/>
|
---|
| 590 | </xsl:call-template>
|
---|
| 591 | </div>
|
---|
| 592 | </xsl:if>
|
---|
| 593 |
|
---|
| 594 | <!-- FIXME: When chunking, only the annotations actually used
|
---|
| 595 | in this chunk should be referenced. I don't think it
|
---|
| 596 | does any harm to reference them all, but it adds
|
---|
| 597 | unnecessary bloat to each chunk. -->
|
---|
| 598 | <xsl:if test="$annotation.support != 0 and //annotation">
|
---|
| 599 | <div class="annotation-list">
|
---|
| 600 | <div class="annotation-nocss">
|
---|
| 601 | <p>The following annotations are from this essay. You are seeing
|
---|
| 602 | them here because your browser doesn’t support the user-interface
|
---|
| 603 | techniques used to make them appear as ‘popups’ on modern browsers.</p>
|
---|
| 604 | </div>
|
---|
| 605 |
|
---|
| 606 | <xsl:apply-templates select="//annotation" mode="annotation-popup"/>
|
---|
| 607 | </div>
|
---|
| 608 | </xsl:if>
|
---|
| 609 | </xsl:template>
|
---|
| 610 |
|
---|
| 611 | <xsl:template name="process.chunk.footnotes">
|
---|
| 612 | <xsl:variable name="is.chunk">
|
---|
| 613 | <xsl:call-template name="chunk"/>
|
---|
| 614 | </xsl:variable>
|
---|
| 615 | <xsl:if test="$is.chunk = 1">
|
---|
| 616 | <xsl:call-template name="process.footnotes"/>
|
---|
| 617 | </xsl:if>
|
---|
| 618 | </xsl:template>
|
---|
| 619 |
|
---|
| 620 | <!-- ====================================================================== -->
|
---|
| 621 |
|
---|
| 622 | <xsl:template name="chunk">
|
---|
| 623 | <xsl:param name="node" select="."/>
|
---|
| 624 | <!-- returns 1 if $node is a chunk -->
|
---|
| 625 |
|
---|
| 626 | <!-- ==================================================================== -->
|
---|
| 627 | <!-- What's a chunk?
|
---|
| 628 |
|
---|
| 629 | The root element
|
---|
| 630 | appendix
|
---|
| 631 | article
|
---|
| 632 | bibliography in article or part or book
|
---|
| 633 | book
|
---|
| 634 | chapter
|
---|
| 635 | colophon
|
---|
| 636 | glossary in article or part or book
|
---|
| 637 | index in article or part or book
|
---|
| 638 | part
|
---|
| 639 | preface
|
---|
| 640 | refentry
|
---|
| 641 | reference
|
---|
| 642 | sect{1,2,3,4,5} if position()>1 && depth < chunk.section.depth
|
---|
| 643 | section if position()>1 && depth < chunk.section.depth
|
---|
| 644 | set
|
---|
| 645 | setindex
|
---|
| 646 | -->
|
---|
| 647 | <!-- ==================================================================== -->
|
---|
| 648 |
|
---|
| 649 | <!--
|
---|
| 650 | <xsl:message>
|
---|
| 651 | <xsl:text>chunk: </xsl:text>
|
---|
| 652 | <xsl:value-of select="name($node)"/>
|
---|
| 653 | <xsl:text>(</xsl:text>
|
---|
| 654 | <xsl:value-of select="$node/@id"/>
|
---|
| 655 | <xsl:text>)</xsl:text>
|
---|
| 656 | <xsl:text> csd: </xsl:text>
|
---|
| 657 | <xsl:value-of select="$chunk.section.depth"/>
|
---|
| 658 | <xsl:text> cfs: </xsl:text>
|
---|
| 659 | <xsl:value-of select="$chunk.first.sections"/>
|
---|
| 660 | <xsl:text> ps: </xsl:text>
|
---|
| 661 | <xsl:value-of select="count($node/parent::section)"/>
|
---|
| 662 | <xsl:text> prs: </xsl:text>
|
---|
| 663 | <xsl:value-of select="count($node/preceding-sibling::section)"/>
|
---|
| 664 | </xsl:message>
|
---|
| 665 | -->
|
---|
| 666 |
|
---|
| 667 | <xsl:choose>
|
---|
| 668 | <xsl:when test="not($node/parent::*)">1</xsl:when>
|
---|
| 669 |
|
---|
| 670 | <xsl:when test="local-name($node) = 'sect1' and $chunk.section.depth >= 1 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect1) > 0)">
|
---|
| 671 | <xsl:text>1</xsl:text>
|
---|
| 672 | </xsl:when>
|
---|
| 673 | <xsl:when test="local-name($node) = 'sect2' and $chunk.section.depth >= 2 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect2) > 0)">
|
---|
| 674 | <xsl:call-template name="chunk">
|
---|
| 675 | <xsl:with-param name="node" select="$node/parent::*"/>
|
---|
| 676 | </xsl:call-template>
|
---|
| 677 | </xsl:when>
|
---|
| 678 | <xsl:when test="local-name($node) = 'sect3' and $chunk.section.depth >= 3 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect3) > 0)">
|
---|
| 679 | <xsl:call-template name="chunk">
|
---|
| 680 | <xsl:with-param name="node" select="$node/parent::*"/>
|
---|
| 681 | </xsl:call-template>
|
---|
| 682 | </xsl:when>
|
---|
| 683 | <xsl:when test="local-name($node) = 'sect4' and $chunk.section.depth >= 4 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect4) > 0)">
|
---|
| 684 | <xsl:call-template name="chunk">
|
---|
| 685 | <xsl:with-param name="node" select="$node/parent::*"/>
|
---|
| 686 | </xsl:call-template>
|
---|
| 687 | </xsl:when>
|
---|
| 688 | <xsl:when test="local-name($node) = 'sect5' and $chunk.section.depth >= 5 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect5) > 0)">
|
---|
| 689 | <xsl:call-template name="chunk">
|
---|
| 690 | <xsl:with-param name="node" select="$node/parent::*"/>
|
---|
| 691 | </xsl:call-template>
|
---|
| 692 | </xsl:when>
|
---|
| 693 | <xsl:when test="local-name($node) = 'section' and $chunk.section.depth >= count($node/ancestor::section)+1 and ($chunk.first.sections != 0 or count($node/preceding-sibling::section) > 0)">
|
---|
| 694 | <xsl:call-template name="chunk">
|
---|
| 695 | <xsl:with-param name="node" select="$node/parent::*"/>
|
---|
| 696 | </xsl:call-template>
|
---|
| 697 | </xsl:when>
|
---|
| 698 |
|
---|
| 699 | <xsl:when test="local-name($node)='preface'">1</xsl:when>
|
---|
| 700 | <xsl:when test="local-name($node)='chapter'">1</xsl:when>
|
---|
| 701 | <xsl:when test="local-name($node)='appendix'">1</xsl:when>
|
---|
| 702 | <xsl:when test="local-name($node)='article'">1</xsl:when>
|
---|
| 703 | <xsl:when test="local-name($node)='part'">1</xsl:when>
|
---|
| 704 | <xsl:when test="local-name($node)='reference'">1</xsl:when>
|
---|
| 705 | <xsl:when test="local-name($node)='refentry'">1</xsl:when>
|
---|
| 706 | <xsl:when test="local-name($node)='index' and ($generate.index != 0 or count($node/*) > 0) and (local-name($node/parent::*) = 'article' or local-name($node/parent::*) = 'book' or local-name($node/parent::*) = 'part' )">1</xsl:when>
|
---|
| 707 | <xsl:when test="local-name($node)='bibliography' and (local-name($node/parent::*) = 'article' or local-name($node/parent::*) = 'book' or local-name($node/parent::*) = 'part' )">1</xsl:when>
|
---|
| 708 | <xsl:when test="local-name($node)='glossary' and (local-name($node/parent::*) = 'article' or local-name($node/parent::*) = 'book' or local-name($node/parent::*) = 'part' )">1</xsl:when>
|
---|
| 709 | <xsl:when test="local-name($node)='colophon'">1</xsl:when>
|
---|
| 710 | <xsl:when test="local-name($node)='book'">1</xsl:when>
|
---|
| 711 | <xsl:when test="local-name($node)='set'">1</xsl:when>
|
---|
| 712 | <xsl:when test="local-name($node)='setindex'">1</xsl:when>
|
---|
| 713 | <xsl:when test="local-name($node)='legalnotice' and $generate.legalnotice.link != 0">1</xsl:when>
|
---|
| 714 | <xsl:otherwise>0</xsl:otherwise>
|
---|
| 715 | </xsl:choose>
|
---|
| 716 | </xsl:template>
|
---|
| 717 |
|
---|
| 718 | <!-- ==================================================================== -->
|
---|
| 719 | <xsl:template name="href.target.uri">
|
---|
| 720 | <xsl:param name="object" select="."/>
|
---|
| 721 | <xsl:variable name="ischunk">
|
---|
| 722 | <xsl:call-template name="chunk">
|
---|
| 723 | <xsl:with-param name="node" select="$object"/>
|
---|
| 724 | </xsl:call-template>
|
---|
| 725 | </xsl:variable>
|
---|
| 726 |
|
---|
| 727 | <xsl:apply-templates mode="chunk-filename" select="$object"/>
|
---|
| 728 |
|
---|
| 729 | <xsl:if test="$ischunk='0'">
|
---|
| 730 | <xsl:text>#</xsl:text>
|
---|
| 731 | <xsl:call-template name="object.id">
|
---|
| 732 | <xsl:with-param name="object" select="$object"/>
|
---|
| 733 | </xsl:call-template>
|
---|
| 734 | </xsl:if>
|
---|
| 735 | </xsl:template>
|
---|
| 736 |
|
---|
| 737 | <xsl:template name="href.target">
|
---|
| 738 | <xsl:param name="context" select="."/>
|
---|
| 739 | <xsl:param name="object" select="."/>
|
---|
| 740 |
|
---|
| 741 | <xsl:variable name="href.to.uri">
|
---|
| 742 | <xsl:call-template name="href.target.uri">
|
---|
| 743 | <xsl:with-param name="object" select="$object"/>
|
---|
| 744 | </xsl:call-template>
|
---|
| 745 | </xsl:variable>
|
---|
| 746 |
|
---|
| 747 | <xsl:variable name="href.from.uri">
|
---|
| 748 | <xsl:call-template name="href.target.uri">
|
---|
| 749 | <xsl:with-param name="object" select="$context"/>
|
---|
| 750 | </xsl:call-template>
|
---|
| 751 | </xsl:variable>
|
---|
| 752 |
|
---|
| 753 | <!--
|
---|
| 754 | <xsl:message>href.to.uri: <xsl:value-of select="$href.to.uri"/></xsl:message>
|
---|
| 755 | <xsl:message>href.from.uri: <xsl:value-of select="$href.from.uri"/></xsl:message>
|
---|
| 756 | -->
|
---|
| 757 |
|
---|
| 758 | <xsl:variable name="href.to">
|
---|
| 759 | <xsl:call-template name="trim.common.uri.paths">
|
---|
| 760 | <xsl:with-param name="uriA" select="$href.to.uri"/>
|
---|
| 761 | <xsl:with-param name="uriB" select="$href.from.uri"/>
|
---|
| 762 | <xsl:with-param name="return" select="'A'"/>
|
---|
| 763 | </xsl:call-template>
|
---|
| 764 | </xsl:variable>
|
---|
| 765 |
|
---|
| 766 | <xsl:variable name="href.from">
|
---|
| 767 | <xsl:call-template name="trim.common.uri.paths">
|
---|
| 768 | <xsl:with-param name="uriA" select="$href.to.uri"/>
|
---|
| 769 | <xsl:with-param name="uriB" select="$href.from.uri"/>
|
---|
| 770 | <xsl:with-param name="return" select="'B'"/>
|
---|
| 771 | </xsl:call-template>
|
---|
| 772 | </xsl:variable>
|
---|
| 773 |
|
---|
| 774 | <xsl:variable name="depth">
|
---|
| 775 | <xsl:call-template name="count.uri.path.depth">
|
---|
| 776 | <xsl:with-param name="filename" select="$href.from"/>
|
---|
| 777 | </xsl:call-template>
|
---|
| 778 | </xsl:variable>
|
---|
| 779 |
|
---|
| 780 | <xsl:variable name="href">
|
---|
| 781 | <xsl:call-template name="copy-string">
|
---|
| 782 | <xsl:with-param name="string" select="'../'"/>
|
---|
| 783 | <xsl:with-param name="count" select="$depth"/>
|
---|
| 784 | </xsl:call-template>
|
---|
| 785 | <xsl:value-of select="$href.to"/>
|
---|
| 786 | </xsl:variable>
|
---|
| 787 |
|
---|
| 788 | <!--
|
---|
| 789 | <xsl:message>
|
---|
| 790 | <xsl:text>In </xsl:text>
|
---|
| 791 | <xsl:value-of select="name(.)"/>
|
---|
| 792 | <xsl:text> (</xsl:text>
|
---|
| 793 | <xsl:value-of select="$href.from"/>
|
---|
| 794 | <xsl:text>,</xsl:text>
|
---|
| 795 | <xsl:value-of select="$depth"/>
|
---|
| 796 | <xsl:text>) </xsl:text>
|
---|
| 797 | <xsl:value-of select="name($object)"/>
|
---|
| 798 | <xsl:text> href=</xsl:text>
|
---|
| 799 | <xsl:value-of select="$href"/>
|
---|
| 800 | </xsl:message>
|
---|
| 801 | -->
|
---|
| 802 |
|
---|
| 803 | <xsl:value-of select="$href"/>
|
---|
| 804 | </xsl:template>
|
---|
| 805 |
|
---|
| 806 | <!-- Returns the complete olink href value if found -->
|
---|
| 807 | <!-- Must take into account any dbhtml dir of the chunk containing the olink -->
|
---|
| 808 | <xsl:template name="make.olink.href">
|
---|
| 809 | <xsl:param name="olink.key" select="''"/>
|
---|
| 810 | <xsl:param name="target.database"/>
|
---|
| 811 |
|
---|
| 812 | <xsl:if test="$olink.key != ''">
|
---|
| 813 | <xsl:variable name="target.href">
|
---|
| 814 | <xsl:for-each select="$target.database">
|
---|
| 815 | <xsl:value-of select="key('targetptr-key', $olink.key)/@href"/>
|
---|
| 816 | </xsl:for-each>
|
---|
| 817 | </xsl:variable>
|
---|
| 818 |
|
---|
| 819 | <!-- an olink starting point may be in a subdirectory, so need
|
---|
| 820 | the "from" reference point to compute a relative path -->
|
---|
| 821 |
|
---|
| 822 | <xsl:variable name="from.href">
|
---|
| 823 | <xsl:call-template name="olink.from.uri">
|
---|
| 824 | <xsl:with-param name="target.database" select="$target.database"/>
|
---|
| 825 | <xsl:with-param name="object" select="."/>
|
---|
| 826 | <xsl:with-param name="object.targetdoc" select="$current.docid"/>
|
---|
| 827 | </xsl:call-template>
|
---|
| 828 | </xsl:variable>
|
---|
| 829 |
|
---|
| 830 | <!-- If the from.href has directory path, then must "../" upward
|
---|
| 831 | to document level -->
|
---|
| 832 | <xsl:variable name="upward.from.path">
|
---|
| 833 | <xsl:call-template name="upward.path">
|
---|
| 834 | <xsl:with-param name="path" select="$from.href"/>
|
---|
| 835 | </xsl:call-template>
|
---|
| 836 | </xsl:variable>
|
---|
| 837 |
|
---|
| 838 | <xsl:variable name="targetdoc">
|
---|
| 839 | <xsl:value-of select="substring-before($olink.key, '/')"/>
|
---|
| 840 | </xsl:variable>
|
---|
| 841 |
|
---|
| 842 | <!-- Does the target database use a sitemap? -->
|
---|
| 843 | <xsl:variable name="use.sitemap">
|
---|
| 844 | <xsl:choose>
|
---|
| 845 | <xsl:when test="$target.database//sitemap">1</xsl:when>
|
---|
| 846 | <xsl:otherwise>0</xsl:otherwise>
|
---|
| 847 | </xsl:choose>
|
---|
| 848 | </xsl:variable>
|
---|
| 849 |
|
---|
| 850 |
|
---|
| 851 | <!-- Get the baseuri for this targetptr -->
|
---|
| 852 | <xsl:variable name="baseuri">
|
---|
| 853 | <xsl:choose>
|
---|
| 854 | <!-- Does the database use a sitemap? -->
|
---|
| 855 | <xsl:when test="$use.sitemap != 0">
|
---|
| 856 | <xsl:choose>
|
---|
| 857 | <!-- Was current.docid parameter set? -->
|
---|
| 858 | <xsl:when test="$current.docid != ''">
|
---|
| 859 | <!-- Was it found in the database? -->
|
---|
| 860 | <xsl:variable name="currentdoc.key">
|
---|
| 861 | <xsl:for-each select="$target.database">
|
---|
| 862 | <xsl:value-of select="key('targetdoc-key', $current.docid)/@targetdoc"/>
|
---|
| 863 | </xsl:for-each>
|
---|
| 864 | </xsl:variable>
|
---|
| 865 | <xsl:choose>
|
---|
| 866 | <xsl:when test="$currentdoc.key != ''">
|
---|
| 867 | <xsl:for-each select="$target.database">
|
---|
| 868 | <xsl:call-template name="targetpath">
|
---|
| 869 | <xsl:with-param name="dirnode" select="key('targetdoc-key', $current.docid)/parent::dir"/>
|
---|
| 870 | <xsl:with-param name="targetdoc" select="$targetdoc"/>
|
---|
| 871 | </xsl:call-template>
|
---|
| 872 | </xsl:for-each>
|
---|
| 873 | </xsl:when>
|
---|
| 874 | <xsl:otherwise>
|
---|
| 875 | <xsl:message>
|
---|
| 876 | <xsl:text>Olink error: cannot compute relative </xsl:text>
|
---|
| 877 | <xsl:text>sitemap path because $current.docid '</xsl:text>
|
---|
| 878 | <xsl:value-of select="$current.docid"/>
|
---|
| 879 | <xsl:text>' not found in target database.</xsl:text>
|
---|
| 880 | </xsl:message>
|
---|
| 881 | </xsl:otherwise>
|
---|
| 882 | </xsl:choose>
|
---|
| 883 | </xsl:when>
|
---|
| 884 | <xsl:otherwise>
|
---|
| 885 | <xsl:message>
|
---|
| 886 | <xsl:text>Olink warning: cannot compute relative </xsl:text>
|
---|
| 887 | <xsl:text>sitemap path without $current.docid parameter</xsl:text>
|
---|
| 888 | </xsl:message>
|
---|
| 889 | </xsl:otherwise>
|
---|
| 890 | </xsl:choose>
|
---|
| 891 | <!-- In either case, add baseuri from its document entry-->
|
---|
| 892 | <xsl:variable name="docbaseuri">
|
---|
| 893 | <xsl:for-each select="$target.database">
|
---|
| 894 | <xsl:value-of select="key('targetdoc-key', $targetdoc)/@baseuri"/>
|
---|
| 895 | </xsl:for-each>
|
---|
| 896 | </xsl:variable>
|
---|
| 897 | <xsl:if test="$docbaseuri != ''">
|
---|
| 898 | <xsl:value-of select="$docbaseuri"/>
|
---|
| 899 | </xsl:if>
|
---|
| 900 | </xsl:when>
|
---|
| 901 | <!-- No database sitemap in use -->
|
---|
| 902 | <xsl:otherwise>
|
---|
| 903 | <!-- Just use any baseuri from its document entry -->
|
---|
| 904 | <xsl:variable name="docbaseuri">
|
---|
| 905 | <xsl:for-each select="$target.database">
|
---|
| 906 | <xsl:value-of select="key('targetdoc-key', $targetdoc)/@baseuri"/>
|
---|
| 907 | </xsl:for-each>
|
---|
| 908 | </xsl:variable>
|
---|
| 909 | <xsl:if test="$docbaseuri != ''">
|
---|
| 910 | <xsl:value-of select="$docbaseuri"/>
|
---|
| 911 | </xsl:if>
|
---|
| 912 | </xsl:otherwise>
|
---|
| 913 | </xsl:choose>
|
---|
| 914 | </xsl:variable>
|
---|
| 915 |
|
---|
| 916 | <!-- Form the href information -->
|
---|
| 917 | <xsl:if test="not(contains($baseuri, ':'))">
|
---|
| 918 | <!-- if not an absolute uri, add upward path from olink chunk -->
|
---|
| 919 | <xsl:value-of select="$upward.from.path"/>
|
---|
| 920 | </xsl:if>
|
---|
| 921 |
|
---|
| 922 | <xsl:if test="$baseuri != ''">
|
---|
| 923 | <xsl:value-of select="$baseuri"/>
|
---|
| 924 | <xsl:if test="substring($target.href,1,1) != '#'">
|
---|
| 925 | <!--xsl:text>/</xsl:text-->
|
---|
| 926 | </xsl:if>
|
---|
| 927 | </xsl:if>
|
---|
| 928 | <!-- optionally turn off frag for PDF references -->
|
---|
| 929 | <xsl:if test="not($insert.olink.pdf.frag = 0 and translate(substring($baseuri, string-length($baseuri) - 3), 'PDF', 'pdf') = '.pdf' and starts-with($target.href, '#') )">
|
---|
| 930 | <xsl:value-of select="$target.href"/>
|
---|
| 931 | </xsl:if>
|
---|
| 932 | </xsl:if>
|
---|
| 933 | </xsl:template>
|
---|
| 934 |
|
---|
| 935 | <!-- Computes "../" to reach top -->
|
---|
| 936 | <xsl:template name="upward.path">
|
---|
| 937 | <xsl:param name="path" select="''"/>
|
---|
| 938 | <xsl:choose>
|
---|
| 939 | <!-- Don't bother with absolute uris -->
|
---|
| 940 | <xsl:when test="contains($path, ':')"/>
|
---|
| 941 | <xsl:when test="starts-with($path, '/')"/>
|
---|
| 942 | <xsl:when test="contains($path, '/')">
|
---|
| 943 | <xsl:text>../</xsl:text>
|
---|
| 944 | <xsl:call-template name="upward.path">
|
---|
| 945 | <xsl:with-param name="path" select="substring-after($path, '/')"/>
|
---|
| 946 | </xsl:call-template>
|
---|
| 947 | </xsl:when>
|
---|
| 948 | </xsl:choose>
|
---|
| 949 |
|
---|
| 950 | </xsl:template>
|
---|
| 951 |
|
---|
| 952 | <!-- ==================================================================== -->
|
---|
| 953 |
|
---|
| 954 | <xsl:template name="html.head">
|
---|
| 955 | <xsl:param name="prev" select="/foo"/>
|
---|
| 956 | <xsl:param name="next" select="/foo"/>
|
---|
| 957 | <xsl:variable name="this" select="."/>
|
---|
| 958 | <xsl:variable name="home" select="/*[1]"/>
|
---|
| 959 | <xsl:variable name="up" select="parent::*"/>
|
---|
| 960 |
|
---|
| 961 | <head>
|
---|
| 962 | <xsl:call-template name="system.head.content"/>
|
---|
| 963 | <xsl:call-template name="head.content"/>
|
---|
| 964 |
|
---|
| 965 | <xsl:if test="$home">
|
---|
| 966 | <link rel="start">
|
---|
| 967 | <xsl:attribute name="href">
|
---|
| 968 | <xsl:call-template name="href.target">
|
---|
| 969 | <xsl:with-param name="object" select="$home"/>
|
---|
| 970 | </xsl:call-template>
|
---|
| 971 | </xsl:attribute>
|
---|
| 972 | <xsl:attribute name="title">
|
---|
| 973 | <xsl:apply-templates select="$home" mode="object.title.markup.textonly"/>
|
---|
| 974 | </xsl:attribute>
|
---|
| 975 | </link>
|
---|
| 976 | </xsl:if>
|
---|
| 977 |
|
---|
| 978 | <xsl:if test="$up">
|
---|
| 979 | <link rel="up">
|
---|
| 980 | <xsl:attribute name="href">
|
---|
| 981 | <xsl:call-template name="href.target">
|
---|
| 982 | <xsl:with-param name="object" select="$up"/>
|
---|
| 983 | </xsl:call-template>
|
---|
| 984 | </xsl:attribute>
|
---|
| 985 | <xsl:attribute name="title">
|
---|
| 986 | <xsl:apply-templates select="$up" mode="object.title.markup.textonly"/>
|
---|
| 987 | </xsl:attribute>
|
---|
| 988 | </link>
|
---|
| 989 | </xsl:if>
|
---|
| 990 |
|
---|
| 991 | <xsl:if test="$prev">
|
---|
| 992 | <link rel="prev">
|
---|
| 993 | <xsl:attribute name="href">
|
---|
| 994 | <xsl:call-template name="href.target">
|
---|
| 995 | <xsl:with-param name="object" select="$prev"/>
|
---|
| 996 | </xsl:call-template>
|
---|
| 997 | </xsl:attribute>
|
---|
| 998 | <xsl:attribute name="title">
|
---|
| 999 | <xsl:apply-templates select="$prev" mode="object.title.markup.textonly"/>
|
---|
| 1000 | </xsl:attribute>
|
---|
| 1001 | </link>
|
---|
| 1002 | </xsl:if>
|
---|
| 1003 |
|
---|
| 1004 | <xsl:if test="$next">
|
---|
| 1005 | <link rel="next">
|
---|
| 1006 | <xsl:attribute name="href">
|
---|
| 1007 | <xsl:call-template name="href.target">
|
---|
| 1008 | <xsl:with-param name="object" select="$next"/>
|
---|
| 1009 | </xsl:call-template>
|
---|
| 1010 | </xsl:attribute>
|
---|
| 1011 | <xsl:attribute name="title">
|
---|
| 1012 | <xsl:apply-templates select="$next" mode="object.title.markup.textonly"/>
|
---|
| 1013 | </xsl:attribute>
|
---|
| 1014 | </link>
|
---|
| 1015 | </xsl:if>
|
---|
| 1016 |
|
---|
| 1017 | <xsl:if test="$html.extra.head.links != 0">
|
---|
| 1018 | <xsl:for-each select="//part |//reference |//preface |//chapter |//article |//refentry |//appendix[not(parent::article)]|appendix |//glossary[not(parent::article)]|glossary |//index[not(parent::article)]|index">
|
---|
| 1019 | <link rel="{local-name(.)}">
|
---|
| 1020 | <xsl:attribute name="href">
|
---|
| 1021 | <xsl:call-template name="href.target">
|
---|
| 1022 | <xsl:with-param name="context" select="$this"/>
|
---|
| 1023 | <xsl:with-param name="object" select="."/>
|
---|
| 1024 | </xsl:call-template>
|
---|
| 1025 | </xsl:attribute>
|
---|
| 1026 | <xsl:attribute name="title">
|
---|
| 1027 | <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
|
---|
| 1028 | </xsl:attribute>
|
---|
| 1029 | </link>
|
---|
| 1030 | </xsl:for-each>
|
---|
| 1031 |
|
---|
| 1032 | <xsl:for-each select="section|sect1|refsection|refsect1">
|
---|
| 1033 | <link>
|
---|
| 1034 | <xsl:attribute name="rel">
|
---|
| 1035 | <xsl:choose>
|
---|
| 1036 | <xsl:when test="local-name($this) = 'section' or local-name($this) = 'refsection'">
|
---|
| 1037 | <xsl:value-of select="'subsection'"/>
|
---|
| 1038 | </xsl:when>
|
---|
| 1039 | <xsl:otherwise>
|
---|
| 1040 | <xsl:value-of select="'section'"/>
|
---|
| 1041 | </xsl:otherwise>
|
---|
| 1042 | </xsl:choose>
|
---|
| 1043 | </xsl:attribute>
|
---|
| 1044 | <xsl:attribute name="href">
|
---|
| 1045 | <xsl:call-template name="href.target">
|
---|
| 1046 | <xsl:with-param name="context" select="$this"/>
|
---|
| 1047 | <xsl:with-param name="object" select="."/>
|
---|
| 1048 | </xsl:call-template>
|
---|
| 1049 | </xsl:attribute>
|
---|
| 1050 | <xsl:attribute name="title">
|
---|
| 1051 | <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
|
---|
| 1052 | </xsl:attribute>
|
---|
| 1053 | </link>
|
---|
| 1054 | </xsl:for-each>
|
---|
| 1055 |
|
---|
| 1056 | <xsl:for-each select="sect2|sect3|sect4|sect5|refsect2|refsect3">
|
---|
| 1057 | <link rel="subsection">
|
---|
| 1058 | <xsl:attribute name="href">
|
---|
| 1059 | <xsl:call-template name="href.target">
|
---|
| 1060 | <xsl:with-param name="context" select="$this"/>
|
---|
| 1061 | <xsl:with-param name="object" select="."/>
|
---|
| 1062 | </xsl:call-template>
|
---|
| 1063 | </xsl:attribute>
|
---|
| 1064 | <xsl:attribute name="title">
|
---|
| 1065 | <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
|
---|
| 1066 | </xsl:attribute>
|
---|
| 1067 | </link>
|
---|
| 1068 | </xsl:for-each>
|
---|
| 1069 | </xsl:if>
|
---|
| 1070 |
|
---|
| 1071 | <!-- * if we have a legalnotice and user wants it output as a -->
|
---|
| 1072 | <!-- * separate page and $html.head.legalnotice.link.types is -->
|
---|
| 1073 | <!-- * non-empty, we generate a link or links for each value in -->
|
---|
| 1074 | <!-- * $html.head.legalnotice.link.types -->
|
---|
| 1075 | <xsl:if test="//legalnotice and not($generate.legalnotice.link = 0) and not($html.head.legalnotice.link.types = '')">
|
---|
| 1076 | <xsl:call-template name="make.legalnotice.head.links"/>
|
---|
| 1077 | </xsl:if>
|
---|
| 1078 |
|
---|
| 1079 | <xsl:call-template name="user.head.content"/>
|
---|
| 1080 | </head>
|
---|
| 1081 | </xsl:template>
|
---|
| 1082 |
|
---|
| 1083 | <!-- ==================================================================== -->
|
---|
| 1084 |
|
---|
| 1085 | <xsl:template name="header.navigation">
|
---|
| 1086 | <xsl:param name="prev" select="/foo"/>
|
---|
| 1087 | <xsl:param name="next" select="/foo"/>
|
---|
| 1088 | <xsl:param name="nav.context"/>
|
---|
| 1089 |
|
---|
| 1090 | <xsl:variable name="home" select="/*[1]"/>
|
---|
| 1091 | <xsl:variable name="up" select="parent::*"/>
|
---|
| 1092 |
|
---|
| 1093 | <xsl:variable name="row1" select="$navig.showtitles != 0"/>
|
---|
| 1094 | <xsl:variable name="row2" select="count($prev) > 0 or (count($up) > 0 and generate-id($up) != generate-id($home) and $navig.showtitles != 0) or count($next) > 0"/>
|
---|
| 1095 |
|
---|
| 1096 | <xsl:if test="$suppress.navigation = '0' and $suppress.header.navigation = '0'">
|
---|
| 1097 | <div class="navheader">
|
---|
| 1098 | <xsl:if test="$row1 or $row2">
|
---|
| 1099 | <table width="100%" summary="Navigation header">
|
---|
| 1100 | <xsl:if test="$row1">
|
---|
| 1101 | <tr>
|
---|
| 1102 | <th colspan="3" align="center">
|
---|
| 1103 | <xsl:apply-templates select="." mode="object.title.markup"/>
|
---|
| 1104 | </th>
|
---|
| 1105 | </tr>
|
---|
| 1106 | </xsl:if>
|
---|
| 1107 |
|
---|
| 1108 | <xsl:if test="$row2">
|
---|
| 1109 | <tr>
|
---|
| 1110 | <td width="20%" align="left">
|
---|
| 1111 | <xsl:if test="count($prev)>0">
|
---|
| 1112 | <a accesskey="p">
|
---|
| 1113 | <xsl:attribute name="href">
|
---|
| 1114 | <xsl:call-template name="href.target">
|
---|
| 1115 | <xsl:with-param name="object" select="$prev"/>
|
---|
| 1116 | </xsl:call-template>
|
---|
| 1117 | </xsl:attribute>
|
---|
| 1118 | <xsl:call-template name="navig.content">
|
---|
| 1119 | <xsl:with-param name="direction" select="'prev'"/>
|
---|
| 1120 | </xsl:call-template>
|
---|
| 1121 | </a>
|
---|
| 1122 | </xsl:if>
|
---|
| 1123 | <xsl:text> </xsl:text>
|
---|
| 1124 | </td>
|
---|
| 1125 | <th width="60%" align="center">
|
---|
| 1126 | <xsl:choose>
|
---|
| 1127 | <xsl:when test="count($up) > 0 and generate-id($up) != generate-id($home) and $navig.showtitles != 0">
|
---|
| 1128 | <xsl:apply-templates select="$up" mode="object.title.markup"/>
|
---|
| 1129 | </xsl:when>
|
---|
| 1130 | <xsl:otherwise> </xsl:otherwise>
|
---|
| 1131 | </xsl:choose>
|
---|
| 1132 | </th>
|
---|
| 1133 | <td width="20%" align="right">
|
---|
| 1134 | <xsl:text> </xsl:text>
|
---|
| 1135 | <xsl:if test="count($next)>0">
|
---|
| 1136 | <a accesskey="n">
|
---|
| 1137 | <xsl:attribute name="href">
|
---|
| 1138 | <xsl:call-template name="href.target">
|
---|
| 1139 | <xsl:with-param name="object" select="$next"/>
|
---|
| 1140 | </xsl:call-template>
|
---|
| 1141 | </xsl:attribute>
|
---|
| 1142 | <xsl:call-template name="navig.content">
|
---|
| 1143 | <xsl:with-param name="direction" select="'next'"/>
|
---|
| 1144 | </xsl:call-template>
|
---|
| 1145 | </a>
|
---|
| 1146 | </xsl:if>
|
---|
| 1147 | </td>
|
---|
| 1148 | </tr>
|
---|
| 1149 | </xsl:if>
|
---|
| 1150 | </table>
|
---|
| 1151 | </xsl:if>
|
---|
| 1152 | <xsl:if test="$header.rule != 0">
|
---|
| 1153 | <hr/>
|
---|
| 1154 | </xsl:if>
|
---|
| 1155 | </div>
|
---|
| 1156 | </xsl:if>
|
---|
| 1157 | </xsl:template>
|
---|
| 1158 |
|
---|
| 1159 | <!-- ==================================================================== -->
|
---|
| 1160 |
|
---|
| 1161 | <xsl:template name="footer.navigation">
|
---|
| 1162 | <xsl:param name="prev" select="/foo"/>
|
---|
| 1163 | <xsl:param name="next" select="/foo"/>
|
---|
| 1164 | <xsl:param name="nav.context"/>
|
---|
| 1165 |
|
---|
| 1166 | <xsl:variable name="home" select="/*[1]"/>
|
---|
| 1167 | <xsl:variable name="up" select="parent::*"/>
|
---|
| 1168 |
|
---|
| 1169 | <xsl:variable name="row1" select="count($prev) > 0 or count($up) > 0 or count($next) > 0"/>
|
---|
| 1170 |
|
---|
| 1171 | <xsl:variable name="row2" select="($prev and $navig.showtitles != 0) or (generate-id($home) != generate-id(.) or $nav.context = 'toc') or ($chunk.tocs.and.lots != 0 and $nav.context != 'toc') or ($next and $navig.showtitles != 0)"/>
|
---|
| 1172 |
|
---|
| 1173 | <xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
|
---|
| 1174 | <div class="navfooter">
|
---|
| 1175 | <xsl:if test="$footer.rule != 0">
|
---|
| 1176 | <hr/>
|
---|
| 1177 | </xsl:if>
|
---|
| 1178 |
|
---|
| 1179 | <xsl:if test="$row1 or $row2">
|
---|
| 1180 | <table width="100%" summary="Navigation footer">
|
---|
| 1181 | <xsl:if test="$row1">
|
---|
| 1182 | <tr>
|
---|
| 1183 | <td width="40%" align="left">
|
---|
| 1184 | <xsl:if test="count($prev)>0">
|
---|
| 1185 | <a accesskey="p">
|
---|
| 1186 | <xsl:attribute name="href">
|
---|
| 1187 | <xsl:call-template name="href.target">
|
---|
| 1188 | <xsl:with-param name="object" select="$prev"/>
|
---|
| 1189 | </xsl:call-template>
|
---|
| 1190 | </xsl:attribute>
|
---|
| 1191 | <xsl:call-template name="navig.content">
|
---|
| 1192 | <xsl:with-param name="direction" select="'prev'"/>
|
---|
| 1193 | </xsl:call-template>
|
---|
| 1194 | </a>
|
---|
| 1195 | </xsl:if>
|
---|
| 1196 | <xsl:text> </xsl:text>
|
---|
| 1197 | </td>
|
---|
| 1198 | <td width="20%" align="center">
|
---|
| 1199 | <xsl:choose>
|
---|
| 1200 | <xsl:when test="count($up)>0 and generate-id($up) != generate-id($home)">
|
---|
| 1201 | <a accesskey="u">
|
---|
| 1202 | <xsl:attribute name="href">
|
---|
| 1203 | <xsl:call-template name="href.target">
|
---|
| 1204 | <xsl:with-param name="object" select="$up"/>
|
---|
| 1205 | </xsl:call-template>
|
---|
| 1206 | </xsl:attribute>
|
---|
| 1207 | <xsl:call-template name="navig.content">
|
---|
| 1208 | <xsl:with-param name="direction" select="'up'"/>
|
---|
| 1209 | </xsl:call-template>
|
---|
| 1210 | </a>
|
---|
| 1211 | </xsl:when>
|
---|
| 1212 | <xsl:otherwise> </xsl:otherwise>
|
---|
| 1213 | </xsl:choose>
|
---|
| 1214 | </td>
|
---|
| 1215 | <td width="40%" align="right">
|
---|
| 1216 | <xsl:text> </xsl:text>
|
---|
| 1217 | <xsl:if test="count($next)>0">
|
---|
| 1218 | <a accesskey="n">
|
---|
| 1219 | <xsl:attribute name="href">
|
---|
| 1220 | <xsl:call-template name="href.target">
|
---|
| 1221 | <xsl:with-param name="object" select="$next"/>
|
---|
| 1222 | </xsl:call-template>
|
---|
| 1223 | </xsl:attribute>
|
---|
| 1224 | <xsl:call-template name="navig.content">
|
---|
| 1225 | <xsl:with-param name="direction" select="'next'"/>
|
---|
| 1226 | </xsl:call-template>
|
---|
| 1227 | </a>
|
---|
| 1228 | </xsl:if>
|
---|
| 1229 | </td>
|
---|
| 1230 | </tr>
|
---|
| 1231 | </xsl:if>
|
---|
| 1232 |
|
---|
| 1233 | <xsl:if test="$row2">
|
---|
| 1234 | <tr>
|
---|
| 1235 | <td width="40%" align="left" valign="top">
|
---|
| 1236 | <xsl:if test="$navig.showtitles != 0">
|
---|
| 1237 | <xsl:apply-templates select="$prev" mode="object.title.markup"/>
|
---|
| 1238 | </xsl:if>
|
---|
| 1239 | <xsl:text> </xsl:text>
|
---|
| 1240 | </td>
|
---|
| 1241 | <td width="20%" align="center">
|
---|
| 1242 | <xsl:choose>
|
---|
| 1243 | <xsl:when test="$home != . or $nav.context = 'toc'">
|
---|
| 1244 | <a accesskey="h">
|
---|
| 1245 | <xsl:attribute name="href">
|
---|
| 1246 | <xsl:call-template name="href.target">
|
---|
| 1247 | <xsl:with-param name="object" select="$home"/>
|
---|
| 1248 | </xsl:call-template>
|
---|
| 1249 | </xsl:attribute>
|
---|
| 1250 | <xsl:call-template name="navig.content">
|
---|
| 1251 | <xsl:with-param name="direction" select="'home'"/>
|
---|
| 1252 | </xsl:call-template>
|
---|
| 1253 | </a>
|
---|
| 1254 | <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
|
---|
| 1255 | <xsl:text> | </xsl:text>
|
---|
| 1256 | </xsl:if>
|
---|
| 1257 | </xsl:when>
|
---|
| 1258 | <xsl:otherwise> </xsl:otherwise>
|
---|
| 1259 | </xsl:choose>
|
---|
| 1260 |
|
---|
| 1261 | <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
|
---|
| 1262 | <a accesskey="t">
|
---|
| 1263 | <xsl:attribute name="href">
|
---|
| 1264 | <xsl:apply-templates select="/*[1]" mode="recursive-chunk-filename">
|
---|
| 1265 | <xsl:with-param name="recursive" select="true()"/>
|
---|
| 1266 | </xsl:apply-templates>
|
---|
| 1267 | <xsl:text>-toc</xsl:text>
|
---|
| 1268 | <xsl:value-of select="$html.ext"/>
|
---|
| 1269 | </xsl:attribute>
|
---|
| 1270 | <xsl:call-template name="gentext">
|
---|
| 1271 | <xsl:with-param name="key" select="'nav-toc'"/>
|
---|
| 1272 | </xsl:call-template>
|
---|
| 1273 | </a>
|
---|
| 1274 | </xsl:if>
|
---|
| 1275 | </td>
|
---|
| 1276 | <td width="40%" align="right" valign="top">
|
---|
| 1277 | <xsl:text> </xsl:text>
|
---|
| 1278 | <xsl:if test="$navig.showtitles != 0">
|
---|
| 1279 | <xsl:apply-templates select="$next" mode="object.title.markup"/>
|
---|
| 1280 | </xsl:if>
|
---|
| 1281 | </td>
|
---|
| 1282 | </tr>
|
---|
| 1283 | </xsl:if>
|
---|
| 1284 | </table>
|
---|
| 1285 | </xsl:if>
|
---|
| 1286 | </div>
|
---|
| 1287 | </xsl:if>
|
---|
| 1288 | </xsl:template>
|
---|
| 1289 |
|
---|
| 1290 | <!-- ==================================================================== -->
|
---|
| 1291 |
|
---|
| 1292 | <xsl:template name="navig.content">
|
---|
| 1293 | <xsl:param name="direction" select="next"/>
|
---|
| 1294 | <xsl:variable name="navtext">
|
---|
| 1295 | <xsl:choose>
|
---|
| 1296 | <xsl:when test="$direction = 'prev'">
|
---|
| 1297 | <xsl:call-template name="gentext.nav.prev"/>
|
---|
| 1298 | </xsl:when>
|
---|
| 1299 | <xsl:when test="$direction = 'next'">
|
---|
| 1300 | <xsl:call-template name="gentext.nav.next"/>
|
---|
| 1301 | </xsl:when>
|
---|
| 1302 | <xsl:when test="$direction = 'up'">
|
---|
| 1303 | <xsl:call-template name="gentext.nav.up"/>
|
---|
| 1304 | </xsl:when>
|
---|
| 1305 | <xsl:when test="$direction = 'home'">
|
---|
| 1306 | <xsl:call-template name="gentext.nav.home"/>
|
---|
| 1307 | </xsl:when>
|
---|
| 1308 | <xsl:otherwise>
|
---|
| 1309 | <xsl:text>xxx</xsl:text>
|
---|
| 1310 | </xsl:otherwise>
|
---|
| 1311 | </xsl:choose>
|
---|
| 1312 | </xsl:variable>
|
---|
| 1313 |
|
---|
| 1314 | <xsl:choose>
|
---|
| 1315 | <xsl:when test="$navig.graphics != 0">
|
---|
| 1316 | <img>
|
---|
| 1317 | <xsl:attribute name="src">
|
---|
| 1318 | <xsl:value-of select="$navig.graphics.path"/>
|
---|
| 1319 | <xsl:value-of select="$direction"/>
|
---|
| 1320 | <xsl:value-of select="$navig.graphics.extension"/>
|
---|
| 1321 | </xsl:attribute>
|
---|
| 1322 | <xsl:attribute name="alt">
|
---|
| 1323 | <xsl:value-of select="$navtext"/>
|
---|
| 1324 | </xsl:attribute>
|
---|
| 1325 | </img>
|
---|
| 1326 | </xsl:when>
|
---|
| 1327 | <xsl:otherwise>
|
---|
| 1328 | <xsl:value-of select="$navtext"/>
|
---|
| 1329 | </xsl:otherwise>
|
---|
| 1330 | </xsl:choose>
|
---|
| 1331 | </xsl:template>
|
---|
| 1332 |
|
---|
| 1333 | <!-- ==================================================================== -->
|
---|
| 1334 |
|
---|
| 1335 | <!-- * The following template assumes that the first legalnotice -->
|
---|
| 1336 | <!-- * instance found in a document applies to the contents of the -->
|
---|
| 1337 | <!-- * entire document. It generates an HTML link in each chunk, back -->
|
---|
| 1338 | <!-- * to the file containing the contents of the first legalnotice. -->
|
---|
| 1339 | <!-- * -->
|
---|
| 1340 | <!-- * Actually, it may generate multiple link instances in each chunk, -->
|
---|
| 1341 | <!-- * because it walks through the space-separated list of link -->
|
---|
| 1342 | <!-- * types specified in the $html.head.legalnotice.link.types param, -->
|
---|
| 1343 | <!-- * popping off link types and generating links for them until it -->
|
---|
| 1344 | <!-- * depletes the list. -->
|
---|
| 1345 |
|
---|
| 1346 | <xsl:template name="make.legalnotice.head.links">
|
---|
| 1347 | <!-- * the following ID is used as part of the legalnotice filename; -->
|
---|
| 1348 | <!-- * we need it in order to construct the filename for use in the -->
|
---|
| 1349 | <!-- * value of the href attribute on the link -->
|
---|
| 1350 | <xsl:param name="id">
|
---|
| 1351 | <xsl:call-template name="object.id">
|
---|
| 1352 | <xsl:with-param name="object" select="(//legalnotice)[1]"/>
|
---|
| 1353 | </xsl:call-template>
|
---|
| 1354 | </xsl:param>
|
---|
| 1355 | <xsl:param name="linktype">
|
---|
| 1356 | <xsl:choose>
|
---|
| 1357 | <xsl:when test="contains($html.head.legalnotice.link.types, ' ')">
|
---|
| 1358 | <xsl:value-of select="normalize-space( substring-before($html.head.legalnotice.link.types, ' '))"/>
|
---|
| 1359 | </xsl:when>
|
---|
| 1360 | <xsl:otherwise>
|
---|
| 1361 | <xsl:value-of select="$html.head.legalnotice.link.types"/>
|
---|
| 1362 | </xsl:otherwise>
|
---|
| 1363 | </xsl:choose>
|
---|
| 1364 | </xsl:param>
|
---|
| 1365 | <xsl:param name="remaining.linktypes" select="concat( normalize-space( substring-after($html.head.legalnotice.link.types, ' ')),' ')"/>
|
---|
| 1366 | <xsl:if test="not($linktype = '')">
|
---|
| 1367 | <link rel="{$linktype}">
|
---|
| 1368 | <xsl:attribute name="href">
|
---|
| 1369 | <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
|
---|
| 1370 | </xsl:attribute>
|
---|
| 1371 | <xsl:attribute name="title">
|
---|
| 1372 | <xsl:apply-templates select="(//legalnotice)[1]" mode="object.title.markup.textonly"/>
|
---|
| 1373 | </xsl:attribute>
|
---|
| 1374 | </link>
|
---|
| 1375 | <xsl:call-template name="make.legalnotice.head.links">
|
---|
| 1376 | <!-- * pop the next value off the list of link types -->
|
---|
| 1377 | <xsl:with-param name="linktype" select="substring-before($remaining.linktypes, ' ')"/>
|
---|
| 1378 | <!-- * remove the link type from the list of remaining link types -->
|
---|
| 1379 | <xsl:with-param name="remaining.linktypes" select="substring-after($remaining.linktypes, ' ')"/>
|
---|
| 1380 | </xsl:call-template>
|
---|
| 1381 | </xsl:if>
|
---|
| 1382 | </xsl:template>
|
---|
| 1383 |
|
---|
| 1384 | <!-- ==================================================================== -->
|
---|
| 1385 | <xsl:template name="chunk-element-content">
|
---|
| 1386 | <xsl:param name="prev"/>
|
---|
| 1387 | <xsl:param name="next"/>
|
---|
| 1388 | <xsl:param name="nav.context"/>
|
---|
| 1389 | <xsl:param name="content">
|
---|
| 1390 | <xsl:apply-imports/>
|
---|
| 1391 | </xsl:param>
|
---|
| 1392 |
|
---|
| 1393 | <xsl:call-template name="user.preroot"/>
|
---|
| 1394 |
|
---|
| 1395 | <html>
|
---|
| 1396 | <xsl:call-template name="html.head">
|
---|
| 1397 | <xsl:with-param name="prev" select="$prev"/>
|
---|
| 1398 | <xsl:with-param name="next" select="$next"/>
|
---|
| 1399 | </xsl:call-template>
|
---|
| 1400 |
|
---|
| 1401 | <body>
|
---|
| 1402 | <xsl:call-template name="body.attributes"/>
|
---|
| 1403 | <xsl:call-template name="user.header.navigation"/>
|
---|
| 1404 |
|
---|
| 1405 | <xsl:call-template name="header.navigation">
|
---|
| 1406 | <xsl:with-param name="prev" select="$prev"/>
|
---|
| 1407 | <xsl:with-param name="next" select="$next"/>
|
---|
| 1408 | <xsl:with-param name="nav.context" select="$nav.context"/>
|
---|
| 1409 | </xsl:call-template>
|
---|
| 1410 |
|
---|
| 1411 | <xsl:call-template name="user.header.content"/>
|
---|
| 1412 |
|
---|
| 1413 | <xsl:copy-of select="$content"/>
|
---|
| 1414 |
|
---|
| 1415 | <xsl:call-template name="user.footer.content"/>
|
---|
| 1416 |
|
---|
| 1417 | <xsl:call-template name="footer.navigation">
|
---|
| 1418 | <xsl:with-param name="prev" select="$prev"/>
|
---|
| 1419 | <xsl:with-param name="next" select="$next"/>
|
---|
| 1420 | <xsl:with-param name="nav.context" select="$nav.context"/>
|
---|
| 1421 | </xsl:call-template>
|
---|
| 1422 |
|
---|
| 1423 | <xsl:call-template name="user.footer.navigation"/>
|
---|
| 1424 | </body>
|
---|
| 1425 | </html>
|
---|
| 1426 | <xsl:value-of select="$chunk.append"/>
|
---|
| 1427 | </xsl:template>
|
---|
| 1428 |
|
---|
| 1429 | <!-- ==================================================================== -->
|
---|
| 1430 | <xsl:template name="generate.manifest">
|
---|
| 1431 | <xsl:param name="node" select="/"/>
|
---|
| 1432 | <xsl:call-template name="write.text.chunk">
|
---|
| 1433 | <xsl:with-param name="filename">
|
---|
| 1434 | <xsl:if test="$manifest.in.base.dir != 0">
|
---|
| 1435 | <xsl:value-of select="$base.dir"/>
|
---|
| 1436 | </xsl:if>
|
---|
| 1437 | <xsl:value-of select="$manifest"/>
|
---|
| 1438 | </xsl:with-param>
|
---|
| 1439 | <xsl:with-param name="method" select="'text'"/>
|
---|
| 1440 | <xsl:with-param name="content">
|
---|
| 1441 | <xsl:apply-templates select="$node" mode="enumerate-files"/>
|
---|
| 1442 | </xsl:with-param>
|
---|
| 1443 | <xsl:with-param name="encoding" select="$chunker.output.encoding"/>
|
---|
| 1444 | </xsl:call-template>
|
---|
| 1445 | </xsl:template>
|
---|
| 1446 |
|
---|
| 1447 | </xsl:stylesheet>
|
---|