Update of /cvsroot/hibernate/Hibernate2/doc/reference/lib/docbook-xsl/fo In directory sc8-pr-cvs1:/tmp/cvs-serv25158/doc/reference/lib/docbook-xsl/fo Added Files: ChangeLog admon.xsl autoidx.xsl autotoc.xsl biblio.xsl block.xsl callout.xsl component.xsl division.xsl docbook.xsl ebnf.xsl fo-patch-for-fop.xsl fo-rtf.xsl fo.xsl footnote.xsl fop.xsl formal.xsl glossary.xsl graphics.xsl index.xsl info.xsl inline.xsl keywords.xsl lists.xsl math.xsl pagesetup.xsl param.ent param.xml param.xsl param.xweb passivetex.xsl pdf2index pi.xsl profile-docbook.xsl qandaset.xsl refentry.xsl sections.xsl synop.xsl table.xsl titlepage.templates.xml titlepage.templates.xsl titlepage.xsl toc.xsl verbatim.xsl xep.xsl xref.xsl Log Message: DocBook XSL now in CVS --- NEW FILE: ChangeLog --- 2003-01-23 Norman Walsh <nw...@us...> * autotoc.xsl: Fix bugs associated with toc-context parameter in division.toc * division.xsl: Generate Part ToCs * pagesetup.xsl: Use proportional-column-width() for header/footer tables; suppress relative-align when when using FOP 2003-01-22 Norman Walsh <nw...@us...> * formal.xsl: Handle alignment correctly when screenshot is used in figure * xref.xsl: Format chapter and appendix titles consistently in xrefs 2003-01-21 Norman Walsh <nw...@us...> * formal.xsl: Attempt to support multiple tgroups (by making multiple tables and placing them right next to each other) * lists.xsl: Bug #653344: Output fo:table-columns in simplelist tables [...1188 lines suppressed...] * formal.xsl: Fixed typo * param.xsl: Added some new parameters * toc.xsl: Support DocBook toc markup 2001-04-03 Norman Walsh <nw...@us...> * callout.xsl: Fix bug 412487, make XSL-generated callout marks honor callout mark parameters * param.xsl: Documentation fixes 2001-04-02 Norman Walsh <nw...@us...> * .cvsignore, Makefile, admon.xsl, autoidx.xsl, autotoc.xsl, biblio.xsl, block.xsl, callout.xsl, component.xsl, division.xsl, docbook.xsl, fo.xsl, footnote.xsl, fop.xsl, formal.xsl, glossary.xsl, graphics.xsl, index.xsl, info.xsl, inline.xsl, keywords.xsl, lists.xsl, math.xsl, pagesetup.xsl, param.xsl, pi.xsl, qandaset.xsl, refentry.xsl, sections.xsl, synop.xsl, table.xsl, titlepage.templates.xml, titlepage.xsl, toc.xsl, verbatim.xsl, xref.xsl: New file. * Makefile: Use the cvstools version of saxon --- NEW FILE: admon.xsl --- <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version='1.0'> <!-- ******************************************************************** $Id: admon.xsl,v 1.1 2003/03/27 23:07:17 turin42 Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://nwalsh.com/docbook/xsl/ for copyright and other information. ******************************************************************** --> <xsl:template match="note|important|warning|caution|tip"> <xsl:choose> <xsl:when test="$admon.graphics != 0"> <xsl:call-template name="graphical.admonition"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="nongraphical.admonition"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="admon.graphic.width"> <xsl:param name="node" select="."/> <xsl:text>36pt</xsl:text> </xsl:template> <xsl:template name="admon.graphic"> <xsl:param name="node" select="."/> <xsl:variable name="filename"> <xsl:value-of select="$admon.graphics.path"/> <xsl:choose> <xsl:when test="name($node)='note'">note</xsl:when> <xsl:when test="name($node)='warning'">warning</xsl:when> <xsl:when test="name($node)='caution'">caution</xsl:when> <xsl:when test="name($node)='tip'">tip</xsl:when> <xsl:when test="name($node)='important'">important</xsl:when> <xsl:otherwise>note</xsl:otherwise> </xsl:choose> <xsl:value-of select="$admon.graphics.extension"/> </xsl:variable> <xsl:choose> <xsl:when test="$passivetex.extensions != 0 or $fop.extensions != 0 or $arbortext.extensions != 0"> <xsl:value-of select="$filename"/> </xsl:when> <xsl:otherwise> <xsl:text>url(</xsl:text> <xsl:value-of select="$filename"/> <xsl:text>)</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="graphical.admonition"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="graphic.width"> <xsl:call-template name="admon.graphic.width"/> </xsl:variable> <fo:block id="{$id}"> <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt" provisional-label-separation="18pt" xsl:use-attribute-sets="list.block.spacing"> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block> <fo:external-graphic width="auto" height="auto" content-width="{$graphic.width}" > <xsl:attribute name="src"> <xsl:call-template name="admon.graphic"/> </xsl:attribute> </fo:external-graphic> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> <fo:block xsl:use-attribute-sets="admonition.title.properties"> <xsl:apply-templates select="." mode="object.title.markup"/> </fo:block> <fo:block xsl:use-attribute-sets="admonition.properties"> <xsl:apply-templates/> </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> </fo:block> </xsl:template> <xsl:template name="nongraphical.admonition"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <fo:block space-before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" start-indent="0.25in" end-indent="0.25in" id="{$id}"> <fo:block keep-with-next='always' xsl:use-attribute-sets="admonition.title.properties"> <xsl:apply-templates select="." mode="object.title.markup"/> </fo:block> <fo:block xsl:use-attribute-sets="admonition.properties"> <xsl:apply-templates/> </fo:block> </fo:block> </xsl:template> <xsl:template match="note/title"></xsl:template> <xsl:template match="important/title"></xsl:template> <xsl:template match="warning/title"></xsl:template> <xsl:template match="caution/title"></xsl:template> <xsl:template match="tip/title"></xsl:template> </xsl:stylesheet> --- NEW FILE: autoidx.xsl --- <?xml version="1.0"?> <!DOCTYPE xsl:stylesheet [ <!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'"> <!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"> <!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'> <!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))'> <!ENTITY tertiary 'normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)]))'> <!ENTITY sep '" "'> <!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'> ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <!-- ******************************************************************** $Id: autoidx.xsl,v 1.1 2003/03/27 23:07:17 turin42 Exp $ ******************************************************************** This file is part of the DocBook XSL Stylesheet distribution. See ../README or http://docbook.sf.net/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <!-- Derived from Jeni Tennison's work in the HTML case --> <xsl:key name="letter" match="indexterm" use="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/> <xsl:key name="primary" match="indexterm" use="&primary;"/> <xsl:key name="secondary" match="indexterm" use="concat(&primary;, &sep;, &secondary;)"/> <xsl:key name="tertiary" match="indexterm" use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/> <xsl:key name="endofrange" match="indexterm[@class='endofrange']" use="@startref"/> <xsl:key name="see-also" match="indexterm[seealso]" use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso)"/> <xsl:key name="see" match="indexterm[see]" use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see)"/> <xsl:template name="generate-index"> <xsl:param name="scope" select="(ancestor::book|/)[last()]"/> <xsl:variable name="terms" select="//indexterm[count(.|key('letter', translate(substring(&primary;, 1, 1), &lowercase;, &uppercase;))[&scope;][1]) = 1 and not(@class = 'endofrange')]"/> <xsl:variable name="alphabetical" select="$terms[contains(concat(&lowercase;, &uppercase;), substring(&primary;, 1, 1))]"/> <xsl:variable name="others" select="$terms[not(contains(concat(&lowercase;, &uppercase;), substring(&primary;, 1, 1)))]"/> <fo:block> <xsl:if test="$others"> <xsl:call-template name="indexdiv.title"> <xsl:with-param name="titlecontent"> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'index symbols'"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> <fo:block> <xsl:apply-templates select="$others[count(.|key('primary', &primary;)[&scope;][1]) = 1]" mode="index-symbol-div"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </fo:block> </xsl:if> <xsl:apply-templates select="$alphabetical[count(.|key('letter', translate(substring(&primary;, 1, 1), &lowercase;,&uppercase;))[&scope;][1]) = 1]" mode="index-div"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </fo:block> </xsl:template> <xsl:template match="indexterm" mode="index-div"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/> <xsl:if test="key('letter', $key)[&scope;] [count(.|key('primary', &primary;)[&scope;][1]) = 1]"> <fo:block> <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)"> <xsl:call-template name="indexdiv.title"> <xsl:with-param name="titlecontent"> <xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/> </xsl:with-param> </xsl:call-template> </xsl:if> <fo:block> <xsl:apply-templates select="key('letter', $key)[&scope;] [count(.|key('primary', &primary;)[&scope;][1])=1]" mode="index-primary"> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> <xsl:with-param name="scope" select="$scope"/> </xsl:apply-templates> </fo:block> </fo:block> </xsl:if> </xsl:template> <xsl:template match="indexterm" mode="index-symbol-div"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/> <fo:block> <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]" mode="index-primary"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </fo:block> </xsl:template> <xsl:template match="indexterm" mode="index-primary"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="&primary;"/> <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/> <fo:block> <xsl:value-of select="primary"/> <xsl:variable name="page-number-citations"> <xsl:for-each select="$refs[not(see) and not(seealso)]"> <xsl:apply-templates select="." mode="reference"> <xsl:with-param name="scope" select="$scope"/> </xsl:apply-templates> </xsl:for-each> <xsl:if test="$refs[not(secondary)]/*[self::see]"> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]" mode="index-see"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </xsl:if> </xsl:variable> <xsl:choose> <xsl:when test="$passivetex.extensions != '0'"> <fotex:sort xmlns:fotex="http://www.tug.org/fotex"> <xsl:copy-of select="$page-number-citations"/> </fotex:sort> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$page-number-citations"/> </xsl:otherwise> </xsl:choose> </fo:block> <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]"> <fo:block start-indent="1pc"> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]" mode="index-seealso"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" mode="index-secondary"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="indexterm" mode="index-secondary"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/> <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/> <fo:block> <xsl:value-of select="secondary"/> <xsl:variable name="page-number-citations"> <xsl:for-each select="$refs[not(see) and not(seealso)]"> <xsl:apply-templates select="." mode="reference"> <xsl:with-param name="scope" select="$scope"/> </xsl:apply-templates> </xsl:for-each> <xsl:if test="$refs[not(tertiary)]/*[self::see]"> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]" mode="index-see"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </xsl:if> </xsl:variable> <xsl:choose> <xsl:when test="$passivetex.extensions != '0'"> <fotex:sort xmlns:fotex="http://www.tug.org/fotex"> <xsl:copy-of select="$page-number-citations"/> </fotex:sort> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$page-number-citations"/> </xsl:otherwise> </xsl:choose> </fo:block> <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::seealso]"> <fo:block start-indent="2pc"> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[&scope;][1])]" mode="index-seealso"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[&scope;][1]) = 1]" mode="index-tertiary"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="indexterm" mode="index-tertiary"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/> <xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/> <fo:block> <xsl:value-of select="tertiary"/> <xsl:variable name="page-number-citations"> <xsl:for-each select="$refs[not(see) and not(seealso)]"> <xsl:apply-templates select="." mode="reference"> <xsl:with-param name="scope" select="$scope"/> </xsl:apply-templates> </xsl:for-each> <xsl:if test="$refs/see"> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]" mode="index-see"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </xsl:if> </xsl:variable> <xsl:choose> <xsl:when test="$passivetex.extensions != '0'"> <fotex:sort xmlns:fotex="http://www.tug.org/fotex"> <xsl:copy-of select="$page-number-citations"/> </fotex:sort> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$page-number-citations"/> </xsl:otherwise> </xsl:choose> </fo:block> <xsl:if test="$refs/seealso"> <fo:block> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[&scope;][1])]" mode="index-seealso"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="indexterm" mode="reference"> <xsl:param name="scope" select="."/> <xsl:param name="separator" select="', '"/> <xsl:if test="$passivetex.extensions = '0'"> <xsl:value-of select="$separator"/> </xsl:if> <xsl:choose> <xsl:when test="@zone and string(@zone)"> <xsl:call-template name="reference"> <xsl:with-param name="zones" select="normalize-space(@zone)"/> <xsl:with-param name="scope" select="$scope"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <fo:basic-link internal-destination="{$id}"> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> <xsl:if test="key('endofrange', @id)[&scope;]"> <xsl:apply-templates select="key('endofrange', @id)[&scope;][last()]" mode="reference"> <xsl:with-param name="scope" select="$scope"/> <xsl:with-param name="separator" select="'-'"/> </xsl:apply-templates> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="reference"> <xsl:param name="scope" select="."/> <xsl:param name="zones"/> <xsl:choose> <xsl:when test="contains($zones, ' ')"> <xsl:variable name="zone" select="substring-before($zones, ' ')"/> <xsl:variable name="target" select="key('id', $zone)[&scope;]"/> <xsl:variable name="id"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$target[1]"/> </xsl:call-template> </xsl:variable> <fo:basic-link internal-destination="{$id}"> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> <xsl:if test="$passivetex.extensions = '0'"> <xsl:text>, </xsl:text> </xsl:if> <xsl:call-template name="reference"> <xsl:with-param name="zones" select="substring-after($zones, ' ')"/> <xsl:with-param name="scope" select="$scope"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:variable name="zone" select="$zones"/> <xsl:variable name="target" select="key('id', $zone)[&scope;]"/> <xsl:variable name="id"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$target[1]"/> </xsl:call-template> </xsl:variable> <fo:basic-link internal-destination="{$id}"> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="indexterm" mode="index-see"> <xsl:param name="scope" select="."/> <fo:inline> <xsl:text> (</xsl:text> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'see'"/> </xsl:call-template> <xsl:text> </xsl:text> <xsl:value-of select="see"/> <xsl:text>)</xsl:text> </fo:inline> </xsl:template> <xsl:template match="indexterm" mode="index-seealso"> <xsl:param name="scope" select="."/> <fo:block> <xsl:text>(</xsl:text> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'seealso'"/> </xsl:call-template> <xsl:text> </xsl:text> <xsl:value-of select="seealso"/> <xsl:text>)</xsl:text> </fo:block> </xsl:template> <!-- ====================================================================== --> <xsl:template name="generate-index-markup"> <xsl:param name="scope" select="(ancestor::book|/)[last()]"/> <xsl:variable name="terms" select="$scope//indexterm[count(.|key('letter', translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;))[&scope;][1]) = 1]"/> <xsl:variable name="alphabetical" select="$terms[contains(concat(&lowercase;, &uppercase;), substring(&primary;, 1, 1))]"/> <xsl:variable name="others" select="$terms[not(contains(concat(&lowercase;, &uppercase;), substring(&primary;, 1, 1)))]"/> <xsl:text><index> </xsl:text> <xsl:if test="$others"> <xsl:text> <indexdiv> </xsl:text> <xsl:text><title></xsl:text> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'index symbols'"/> </xsl:call-template> <xsl:text></title> </xsl:text> <xsl:apply-templates select="$others[count(.|key('primary', &primary;)[&scope;][1]) = 1]" mode="index-symbol-div-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:text></indexdiv> </xsl:text> </xsl:if> <xsl:apply-templates select="$alphabetical[count(.|key('letter', translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;))[&scope;][1]) = 1]" mode="index-div-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:text></index> </xsl:text> </xsl:template> <xsl:template match="*" mode="index-markup"> <xsl:param name="scope" select="."/> <xsl:text><</xsl:text> <xsl:value-of select="name(.)"/> <xsl:text>> </xsl:text> <xsl:apply-templates mode="index-markup"> <xsl:with-param name="scope" select="$scope"/> </xsl:apply-templates> </xsl:template> <xsl:template match="indexterm" mode="index-div-markup"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/> <xsl:text> <indexdiv> </xsl:text> <xsl:text><title></xsl:text> <xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/> <xsl:text></title> </xsl:text> <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]" mode="index-primary-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:text></indexdiv> </xsl:text> </xsl:template> <xsl:template match="indexterm" mode="index-symbol-div-markup"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/> <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]" mode="index-primary-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </xsl:template> <xsl:template match="indexterm" mode="index-primary-markup"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="&primary;"/> <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/> <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/> <xsl:text> <indexentry> </xsl:text> <xsl:text><primaryie></xsl:text> <xsl:text><phrase></xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="string(primary)"/> </xsl:call-template> <xsl:text></phrase></xsl:text> <xsl:if test="$pages">,</xsl:if> <xsl:text> </xsl:text> <xsl:for-each select="$pages"> <xsl:apply-templates select="." mode="reference-markup"> <xsl:with-param name="scope" select="$scope"/> </xsl:apply-templates> </xsl:for-each> <xsl:text></primaryie> </xsl:text> <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::see or self::seealso]"> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]" mode="index-see-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]" mode="index-seealso-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" mode="index-secondary-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </xsl:if> <xsl:text></indexentry> </xsl:text> </xsl:template> <xsl:template match="indexterm" mode="index-secondary-markup"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/> <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/> <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/> <xsl:text><secondaryie></xsl:text> <xsl:text><phrase></xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="string(secondary)"/> </xsl:call-template> <xsl:text></phrase></xsl:text> <xsl:if test="$pages">,</xsl:if> <xsl:text> </xsl:text> <xsl:for-each select="$pages"> <xsl:apply-templates select="." mode="reference-markup"> <xsl:with-param name="scope" select="$scope"/> </xsl:apply-templates> </xsl:for-each> <xsl:text></secondaryie> </xsl:text> <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::see or self::seealso]"> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]" mode="index-see-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[&scope;][1])]" mode="index-seealso-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[&scope;][1]) = 1]" mode="index-tertiary-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </xsl:if> </xsl:template> <xsl:template match="indexterm" mode="index-tertiary-markup"> <xsl:param name="scope" select="."/> <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/> <xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/> <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/> <xsl:text><tertiaryie></xsl:text> <xsl:text><phrase></xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="string(tertiary)"/> </xsl:call-template> <xsl:text></phrase></xsl:text> <xsl:if test="$pages">,</xsl:if> <xsl:text> </xsl:text> <xsl:for-each select="$pages"> <xsl:apply-templates select="." mode="reference-markup"> <xsl:with-param name="scope" select="$scope"/> </xsl:apply-templates> </xsl:for-each> <xsl:text></tertiaryie> </xsl:text> <xsl:variable name="see" select="$refs/see | $refs/seealso"/> <xsl:if test="$see"> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]" mode="index-see-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/> </xsl:apply-templates> <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[&scope;][1])]" mode="index-seealso-markup"> <xsl:with-param name="scope" select="$scope"/> <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/> </xsl:apply-templates> </xsl:if> </xsl:template> <xsl:template match="indexterm" mode="reference-markup"> <xsl:param name="scope" select="."/> <xsl:choose> <xsl:when test="@zone and string(@zone)"> <xsl:call-template name="reference-markup"> <xsl:with-param name="zones" select="normalize-space(@zone)"/> <xsl:with-param name="scope" select="$scope"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:choose> <xsl:when test="@startref and @class='endofrange'"> <xsl:text><phrase role="pageno"></xsl:text> <xsl:text><link linkend="</xsl:text> <xsl:value-of select="@startref"/> <xsl:text>"></xsl:text> <fo:basic-link internal-destination="{@startref}"> <fo:page-number-citation ref-id="{@startref}"/> <xsl:text>-</xsl:text> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> <xsl:text></link></xsl:text> <xsl:text></phrase> </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text><phrase role="pageno"></xsl:text> <xsl:if test="@id"> <xsl:text><link linkend="</xsl:text> <xsl:value-of select="$id"/> <xsl:text>"></xsl:text> </xsl:if> <fo:basic-link internal-destination="{$id}"> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> <xsl:if test="@id"> <xsl:text></link></xsl:text> </xsl:if> <xsl:text></phrase> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="reference-markup"> <xsl:param name="scope" select="."/> <xsl:param name="zones"/> <xsl:choose> <xsl:when test="contains($zones, ' ')"> <xsl:variable name="zone" select="substring-before($zones, ' ')"/> <xsl:variable name="target" select="key('id', $zone)[&scope;]"/> <xsl:variable name="id"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$target[1]"/> </xsl:call-template> </xsl:variable> <xsl:text><phrase fole="pageno"></xsl:text> <xsl:if test="$target[1]/@id"> <xsl:text><link linkend="</xsl:text> <xsl:value-of select="$id"/> <xsl:text>"></xsl:text> </xsl:if> <fo:basic-link internal-destination="{$id}"> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> <xsl:if test="$target[1]/@id"> <xsl:text></link></xsl:text> </xsl:if> <xsl:text></phrase> </xsl:text> <xsl:call-template name="reference"> <xsl:with-param name="zones" select="substring-after($zones, ' ')"/> <xsl:with-param name="scope" select="$scope"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:variable name="zone" select="$zones"/> <xsl:variable name="target" select="key('id', $zone)[&scope;]"/> <xsl:variable name="id"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$target[1]"/> </xsl:call-template> </xsl:variable> <xsl:text><phrase role="pageno"></xsl:text> <xsl:if test="$target[1]/@id"> <xsl:text><link linkend="</xsl:text> <xsl:value-of select="$id"/> <xsl:text>"></xsl:text> </xsl:if> <fo:basic-link internal-destination="{$id}"> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> <xsl:if test="$target[1]/@id"> <xsl:text></link></xsl:text> </xsl:if> <xsl:text></phrase> </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="indexterm" mode="index-see-markup"> <xsl:param name="scope" select="."/> <fo:block> <xsl:text><seeie></xsl:text> <xsl:text><phrase></xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="string(see)"/> </xsl:call-template> <xsl:text></phrase></xsl:text> <xsl:text></seeie> </xsl:text> </fo:block> </xsl:template> <xsl:template match="indexterm" mode="index-seealso-markup"> <xsl:param name="scope" select="."/> <fo:block> <xsl:text><seealsoie></xsl:text> <xsl:text><phrase></xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="string(seealso)"/> </xsl:call-template> <xsl:text></phrase></xsl:text> <xsl:text></seealsoie> </xsl:text> </fo:block> </xsl:template> <xsl:template name="escape-text"> <xsl:param name="text" select="''"/> <xsl:variable name="ltpos" select="substring-before($text, '<')"/> <xsl:variable name="amppos" select="substring-before($text, '&')"/> <xsl:choose> <xsl:when test="contains($text,'<') and contains($text, '&') and string-length($ltpos) < string-length($amppos)"> <xsl:value-of select="$ltpos"/> <xsl:text>&lt;</xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="substring-after($text, '<')"/> </xsl:call-template> </xsl:when> <xsl:when test="contains($text,'<') and contains($text, '&') and string-length($amppos) < string-length($ltpos)"> <xsl:value-of select="$amppos"/> <xsl:text>&amp;</xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="substring-after($text, '&')"/> </xsl:call-template> </xsl:when> <xsl:when test="contains($text, '<')"> <xsl:value-of select="$ltpos"/> <xsl:text>&lt;</xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="substring-after($text, '<')"/> </xsl:call-template> </xsl:when> <xsl:when test="contains($text, '&')"> <xsl:value-of select="$amppos"/> <xsl:text>&amp;</xsl:text> <xsl:call-template name="escape-text"> <xsl:with-param name="text" select="substring-after($text, '&')"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> --- NEW FILE: autotoc.xsl --- <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version='1.0'> <!-- ******************************************************************** $Id: autotoc.xsl,v 1.1 2003/03/27 23:07:17 turin42 Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://nwalsh.com/docbook/xsl/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <xsl:template name="set.toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:variable name="nodes" select="book|setindex"/> <xsl:if test="$nodes"> <fo:block id="toc...{$id}" xsl:use-attribute-sets="toc.margin.properties"> <xsl:call-template name="table.of.contents.titlepage"/> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template name="division.toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:variable name="nodes" select="$toc-context/part |$toc-context/reference |$toc-context/preface |$toc-context/chapter |$toc-context/appendix |$toc-context/article |$toc-context/bibliography |$toc-context/glossary |$toc-context/index"/> <xsl:if test="$nodes"> <fo:block id="toc...{$cid}" xsl:use-attribute-sets="toc.margin.properties"> <xsl:call-template name="table.of.contents.titlepage"/> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template name="component.toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:variable name="nodes" select="section|sect1|refentry |article|bibliography|glossary |appendix"/> <xsl:if test="$nodes"> <fo:block id="toc...{$id}" xsl:use-attribute-sets="toc.margin.properties"> <xsl:call-template name="table.of.contents.titlepage"/> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template name="component.toc.separator"> <!-- Customize to output something between component.toc and first output --> </xsl:template> <xsl:template name="section.toc"> <xsl:param name="toc-context" select="."/> <xsl:param name="toc.title.p" select="true()"/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:variable name="nodes" select="section|sect1|sect2|sect3|sect4|sect5|refentry |bridgehead[$bridgehead.in.toc != 0]"/> <xsl:variable name="level"> <xsl:call-template name="section.level"/> </xsl:variable> <xsl:if test="$nodes"> <fo:block id="toc...{$id}" xsl:use-attribute-sets="toc.margin.properties"> <xsl:if test="$toc.title.p"> <xsl:call-template name="section.heading"> <xsl:with-param name="level" select="$level + 1"/> <xsl:with-param name="title"> <fo:block space-after="0.5em"> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'TableofContents'"/> </xsl:call-template> </fo:block> </xsl:with-param> </xsl:call-template> </xsl:if> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template name="section.toc.separator"> <!-- Customize to output something between section.toc and first output --> </xsl:template> <!-- ==================================================================== --> <xsl:template name="toc.line"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="label"> <xsl:apply-templates select="." mode="label.markup"/> </xsl:variable> <fo:block text-align-last="justify" end-indent="{$toc.indent.width}pt" last-line-end-indent="-{$toc.indent.width}pt"> <fo:inline keep-with-next.within-line="always"> <fo:basic-link internal-destination="{$id}"> <xsl:if test="$label != ''"> <xsl:copy-of select="$label"/> <xsl:value-of select="$autotoc.label.separator"/> </xsl:if> <xsl:apply-templates select="." mode="title.markup"/> </fo:basic-link> </fo:inline> <fo:inline keep-together.within-line="always"> <xsl:text> </xsl:text> <fo:leader leader-pattern="dots" leader-pattern-width="3pt" leader-alignment="reference-area" keep-with-next.within-line="always"/> <xsl:text> </xsl:text> <fo:basic-link internal-destination="{$id}"> <fo:page-number-citation ref-id="{$id}"/> </fo:basic-link> </fo:inline> </fo:block> </xsl:template> <!-- ==================================================================== --> <xsl:template match="book|setindex" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="toc.line"/> <xsl:variable name="nodes" select="glossary|bibliography|preface|chapter |reference|part|article|appendix|index"/> <xsl:if test="$toc.section.depth > 0 and $nodes"> <fo:block id="toc.{$cid}.{$id}" start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="part" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="toc.line"/> <xsl:variable name="nodes" select="chapter|appendix|preface|reference"/> <xsl:if test="$toc.section.depth > 0 and $nodes"> <fo:block id="toc.{$cid}.{$id}" start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="reference" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 0 and refentry"> <fo:block id="toc.{$cid}.{$id}" start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="refentry" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="refentry" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:call-template name="toc.line"/> </xsl:template> <xsl:template match="preface|chapter|appendix|article" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="toc.line"/> <xsl:variable name="nodes" select="section|sect1"/> <xsl:if test="$toc.section.depth > 0 and $nodes"> <fo:block id="toc.{$cid}.{$id}" start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="sect1" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > 1 and sect2"> <fo:block id="toc.{$cid}.{$id}" start-indent="{count(ancestor::*)*$toc.indent.width}pt"> <xsl:apply-templates select="sect2" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="sect2" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="toc.line"/> <xsl:variable name="reldepth" select="count(ancestor::*)-count($toc-context/ancestor::*)"/> <xsl:if test="$toc.section.depth > 2 and sect3"> <fo:block id="toc.{$cid}.{$id}" start-indent="{$reldepth*$toc.indent.width}pt"> <xsl:apply-templates select="sect3" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="sect3" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="toc.line"/> <xsl:variable name="reldepth" select="count(ancestor::*)-count($toc-context/ancestor::*)"/> <xsl:if test="$toc.section.depth > 3 and sect4"> <fo:block id="toc.{$cid}.{$id}" start-indent="{$reldepth*$toc.indent.width}pt"> <xsl:apply-templates select="sect4" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="sect4" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="toc.line"/> <xsl:variable name="reldepth" select="count(ancestor::*)-count($toc-context/ancestor::*)"/> <xsl:if test="$toc.section.depth > 4 and sect5"> <fo:block id="toc.{$cid}.{$id}" start-indent="{$reldepth*$toc.indent.width}pt"> <xsl:apply-templates select="sect5" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="sect5" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:call-template name="toc.line"/> </xsl:template> <xsl:template match="section" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:variable name="cid"> <xsl:call-template name="object.id"> <xsl:with-param name="object" select="$toc-context"/> </xsl:call-template> </xsl:variable> <xsl:variable name="depth" select="count(ancestor::section) + 1"/> <xsl:variable name="reldepth" select="count(ancestor::*)-count($toc-context/ancestor::*)"/> <xsl:if test="$toc.section.depth >= $depth"> <xsl:call-template name="toc.line"/> <xsl:if test="$toc.section.depth > $depth and section"> <fo:block id="toc.{$cid}.{$id}" start-indent="{$reldepth*$toc.indent.width}pt"> <xsl:apply-templates select="section" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:if> </xsl:template> <xsl:template match="bibliography|glossary" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:call-template name="toc.line"/> </xsl:template> <xsl:template match="index" mode="toc"> <xsl:param name="toc-context" select="."/> <xsl:if test="* or $generate.index != 0"> <xsl:call-template name="toc.line"/> </xsl:if> </xsl:template> <xsl:template match="title" mode="toc"> <xsl:apply-templates/> </xsl:template> <!-- ==================================================================== --> <xsl:template name="list.of.titles"> <xsl:param name="titles" select="'table'"/> <xsl:param name="nodes" select=".//table"/> <xsl:param name="toc-context" select="."/> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:if test="$nodes"> <fo:block id="lot...{$titles}...{$id}"> <xsl:choose> <xsl:when test="$titles='table'"> <xsl:call-template name="list.of.tables.titlepage"/> </xsl:when> <xsl:when test="$titles='figure'"> <xsl:call-template name="list.of.figures.titlepage"/> </xsl:when> <xsl:when test="$titles='equation'"> <xsl:call-template name="list.of.equations.titlepage"/> </xsl:when> <xsl:when test="$titles='example'"> <xsl:call-template name="list.of.examples.titlepage"/> </xsl:when> <xsl:when test="$titles='procedure'"> <xsl:call-template name="list.of.procedures.titlepage"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="list.of.unknowns.titlepage"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="$nodes" mode="toc"> <xsl:with-param name="toc-context" select="$toc-context"/> </xsl:apply-templates> </fo:block> </xsl:if> </xsl:template> <xsl:template match="figure|table|example|equation|procedure" mode="toc"> <xsl:call-template name="toc.line"/> </xsl:template> <!-- ==================================================================== --> </xsl:stylesheet> --- NEW FILE: biblio.xsl --- <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version='1.0'> <!-- ******************************************************************** $Id: biblio.xsl,v 1.1 2003/03/27 23:07:17 turin42 Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://nwalsh.com/docbook/xsl/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <xsl:template match="bibliography"> <xsl:variable name="id"> [...1041 lines suppressed...] <xsl:apply-templates mode="bibliomixed.mode"/> </fo:inline> </xsl:template> <xsl:template match="volumenum" mode="bibliomixed.mode"> <fo:inline> <xsl:apply-templates mode="bibliomixed.mode"/> </fo:inline> </xsl:template> <xsl:template match="bibliocoverage|biblioid|bibliorelation|bibliosource" mode="bibliomixed.mode"> <fo:inline> <xsl:apply-templates mode="bibliomixed.mode"/> </fo:inline> </xsl:template> <!-- ==================================================================== --> </xsl:stylesheet> --- NEW FILE: block.xsl --- <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version='1.0'> <!-- ******************************************************************** $Id: block.xsl,v 1.1 2003/03/27 23:07:17 turin42 Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://nwalsh.com/docbook/xsl/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <xsl:template name="block.object"> <fo:block> <xsl:apply-templates/> </fo:block> </xsl:template> <!-- ==================================================================== --> <xsl:template match="para"> <fo:block xsl:use-attribute-sets="normal.para.spacing"> <xsl:call-template name="anchor"/> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="simpara"> <fo:block xsl:use-attribute-sets="normal.para.spacing"> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="formalpara"> <fo:block xsl:use-attribute-sets="normal.para.spacing"> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="formalpara/title"> <xsl:variable name="titleStr" select="."/> <xsl:variable name="lastChar"> <xsl:if test="$titleStr != ''"> <xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/> </xsl:if> </xsl:variable> <fo:inline font-weight="bold" keep-with-next.within-line="always" padding-end="1em"> <xsl:apply-templates/> <xsl:if test="$lastChar != '' and not(contains($runinhead.title.end.punct, $lastChar))"> <xsl:value-of select="$runinhead.default.title.end.punct"/> </xsl:if> <xsl:text> </xsl:text> </fo:inline> </xsl:template> <xsl:template match="formalpara/para"> <xsl:apply-templates/> </xsl:template> <!-- ==================================================================== --> <xsl:template match="blockquote"> <fo:block xsl:use-attribute-sets="blockquote.properties"> <xsl:call-template name="anchor"/> <fo:block> <xsl:if test="title"> <fo:block xsl:use-attribute-sets="formal.title.properties"> <xsl:apply-templates select="." mode="object.title.markup"/> </fo:block> </xsl:if> <xsl:apply-templates select="*[local-name(.) != 'title' and local-name(.) != 'attribution']"/> </fo:block> <xsl:if test="attribution"> <fo:block text-align="right"> <!-- mdash --> <xsl:text>—</xsl:text> <xsl:apply-templates select="attribution"/> </fo:block> </xsl:if> </fo:block> </xsl:template> <xsl:template match="epigraph"> <fo:block> <xsl:call-template name="anchor"/> <xsl:apply-templates select="para|simpara|formalpara|literallayout"/> <fo:inline> <xsl:text>--</xsl:text> <xsl:apply-templates select="attribution"/> </fo:inline> </fo:block> </xsl:template> <xsl:template match="attribution"> <fo:inline><xsl:apply-templates/></fo:inline> </xsl:template> <!-- ==================================================================== --> <xsl:template match="sidebar"> <fo:block xsl:use-attribute-sets="sidebar.properties"> <xsl:if test="./title"> <fo:block font-weight="bold" keep-with-next.within-column="always" hyphenate="false"> <xsl:apply-templates select="./title" mode="sidebar.title.mode"/> </fo:block> </xsl:if> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="sidebar/title"> </xsl:template> <xsl:template match="sidebar/title" mode="sidebar.title.mode"> <xsl:apply-templates/> </xsl:template> <!-- ==================================================================== --> <xsl:template match="abstract"> <fo:block> <xsl:if test="@id"> <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> </xsl:if> <xsl:call-template name="formal.object.heading"> <xsl:with-param name="title"> <xsl:apply-templates se... [truncated message content] |