1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
|
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
xmlns:exsl="http://exslt.org/common"
xmlns:set="http://exslt.org/sets"
version="1.0"
exclude-result-prefixes="doc exsl set">
<!-- ********************************************************************
$Id$
******************************************************************** -->
<xsl:import href="chunk.xsl"/>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp-common.xsl"/>
<xsl:include href="manifest.xsl"/>
<xsl:param name="use.extensions" select="1"/>
<xsl:param name="base.dir" select="'htmlhelp/'"/>
<xsl:variable name="x">
<xsl:choose>
<xsl:when test="$output.type='unexpanded'">-x</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:param name="html.ext" select="concat($x,'.html')"/>
<xsl:param name="htmlhelp.encoding" select="'windows-1252'"/>
<xsl:param name="chunker.output.encoding" select="'iso-8859-1'"/>
<xsl:param name="saxon.character.representation" select="'native'"/>
<xsl:param name="suppress.navigation" select="0"/>
<xsl:param name="suppress.footer.navigation" select="1"/>
<xsl:param name="htmlhelp.hhc.show.root" select="0"/>
<xsl:param name="htmlhelp.button.locate" select="1"/>
<xsl:param name="htmlhelp.show.advanced.search" select="1"/>
<xsl:param name="htmlhelp.show.favorities" select="1"/>
<xsl:param name="htmlhelp.button.home" select="1"/>
<xsl:param name="htmlhelp.button.home.url">http://www.docbook.org</xsl:param>
<xsl:param name="htmlhelp.button.jump1" select="1"/>
<xsl:param name="htmlhelp.button.jump1.url">http://sourceforge.net/docman/display_doc.php?docid=10513&group_id=21935</xsl:param>
<xsl:param name="htmlhelp.button.jump1.title">Archives</xsl:param>
<xsl:param name="htmlhelp.button.jump2" select="1"/>
<xsl:param name="htmlhelp.button.jump2.url">http://sourceforge.net/project/showfiles.php?group_id=21935</xsl:param>
<xsl:param name="htmlhelp.button.jump2.title">Stylesheets</xsl:param>
<xsl:param name="htmlhelp.title">
<xsl:text>DocBook: The Definitive Guide</xsl:text>
<xsl:if test="$output.type='unexpanded'"><xsl:text> (unexpanded)</xsl:text></xsl:if>
</xsl:param>
<xsl:param name="htmlhelp.chm" select="concat('tdg-en-',/book/bookinfo/releaseinfo,$x,'.chm')"/>
<!-- Group element reference by first letter -->
<xsl:template match="reference"
mode="hhc">
<xsl:variable name="title">
<xsl:if test="$htmlhelp.autolabel=1">
<xsl:variable name="label.markup">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:if test="normalize-space($label.markup)">
<xsl:value-of select="concat($label.markup,$autotoc.label.separator)"/>
</xsl:if>
</xsl:if>
<xsl:apply-templates select="." mode="title.markup"/>
</xsl:variable>
<xsl:if test="$htmlhelp.hhc.show.root != 0 or parent::*">
<xsl:text disable-output-escaping="yes"><LI> <OBJECT type="text/sitemap">
<param name="Name" value="</xsl:text>
<xsl:value-of select="normalize-space($title)"/>
<xsl:text disable-output-escaping="yes">">
<param name="Local" value="</xsl:text>
<xsl:call-template name="href.target.with.base.dir"/>
<xsl:text disable-output-escaping="yes">">
</OBJECT></xsl:text>
</xsl:if>
<xsl:choose>
<xsl:when test="refentry/refmeta[refmiscinfo = 'Element']">
<xsl:text disable-output-escaping="yes"><UL></xsl:text>
<xsl:for-each select="refentry">
<xsl:variable name="letter" select="substring(refnamediv/refname,1,1)"/>
<xsl:if test="position()=1 or
substring(preceding-sibling::refentry[1]/refnamediv/refname,1,1)!=$letter">
<xsl:text disable-output-escaping="yes"><LI> <OBJECT type="text/sitemap">
<param name="Name" value="</xsl:text>
<xsl:value-of select="translate($letter,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
<xsl:text disable-output-escaping="yes">">
<!--
<param name="Local" value="</xsl:text>
<xsl:call-template name="href.target.with.base.dir"/>
<xsl:text disable-output-escaping="yes">">
-->
</OBJECT></xsl:text>
<xsl:text disable-output-escaping="yes"><UL></xsl:text>
<xsl:apply-templates select="../refentry[substring(refnamediv/refname,1,1)=$letter]" mode="hhc"/>
<xsl:text disable-output-escaping="yes"></UL></xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text disable-output-escaping="yes"></UL></xsl:text>
</xsl:when>
<xsl:when test="refentry">
<xsl:text disable-output-escaping="yes"><UL></xsl:text>
<xsl:apply-templates
select="refentry"
mode="hhc"/>
<xsl:text disable-output-escaping="yes"></UL></xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- All elements from reference go automatically to index -->
<xsl:template name="refentry.title">
<xsl:param name="node" select="."/>
<xsl:variable name="refmeta" select="$node//refmeta"/>
<xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
<xsl:variable name="refnamediv" select="$node//refnamediv"/>
<xsl:variable name="refname" select="$refnamediv//refname"/>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$refentrytitle">
<xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
</xsl:when>
<xsl:when test="$refname">
<xsl:apply-templates select="$refname[1]" mode="title"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="write.indexterm">
<xsl:with-param name="text" select="concat($refname,' element reference')"/>
</xsl:call-template>
<h1 class="title">
<xsl:call-template name="revision.graphic">
<xsl:with-param name="large" select="'1'"/>
<xsl:with-param name="align" select="'right'"/>
</xsl:call-template>
<xsl:copy-of select="$title"/>
</h1>
</xsl:template>
<!-- CHM should be selfcontained, we must use local copies of glyphs images -->
<xsl:template name="mediaobject.filename">
<xsl:param name="object"></xsl:param>
<xsl:variable name="data" select="$object/videodata
|$object/imagedata
|$object/audiodata
|$object"/>
<xsl:variable name="filename2">
<xsl:choose>
<xsl:when test="$data[@fileref]">
<xsl:value-of select="$data/@fileref"/>
</xsl:when>
<xsl:when test="$data[@entityref]">
<xsl:value-of select="unparsed-entity-uri($data/@entityref)"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="starts-with($filename2, 'http://www.oasis-open.org/docbook/xmlcharent/')">
<xsl:value-of select="substring-after($filename2, 'http://www.oasis-open.org/docbook/xmlcharent/')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$filename2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="real.ext">
<xsl:call-template name="filename-extension">
<xsl:with-param name="filename" select="$filename"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="ext">
<xsl:choose>
<xsl:when test="$real.ext != ''">
<xsl:value-of select="$real.ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$graphic.default.extension"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="graphic.ext">
<xsl:call-template name="is.graphic.extension">
<xsl:with-param name="ext" select="$ext"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$real.ext = ''">
<xsl:choose>
<xsl:when test="$ext != ''">
<xsl:value-of select="$filename"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="$ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$filename"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="not($graphic.ext)">
<xsl:choose>
<xsl:when test="$graphic.default.extension != ''">
<xsl:value-of select="$filename"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="$graphic.default.extension"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$filename"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$filename"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|