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