1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 12:59:02 +00:00

Copy nping, nsock, nbase, zenmap, ncat from their homes in /.

If you have trouble updating after this revision you need to follow
these instructions. You have probably just seen an error like this:

svn: URL 'svn://svn.insecure.org/nping' of existing directory 'nping'
does not match expected URL 'svn://svn.insecure.org/nmap/nping'

This is caused by the replacement of SVN externals.

Here's what you need to do. First, save any local changes you might have
in the nping, nsock, nbase, ncat, and zenmap directories. (For example
by running "cd nping; svn diff > ../nping.diff".) If you don't have any
local changes you can skip this step.

Then run these commands:

rm -rf nping/ nsock/ nbase/ ncat/ zenmap/
svn update
svn cleanup

If all else fails, you can just delete your whole working directory and
check out anew:

svn co --username guest --password "" svn://svn.insecure.org/nmap

There may be further discussion in the mailing list thread at
http://seclists.org/nmap-dev/2011/q4/303.
This commit is contained in:
david
2011-11-16 21:49:44 +00:00
parent 4dabecf3b8
commit ed2ba4e168
619 changed files with 351133 additions and 0 deletions

View File

@@ -0,0 +1,134 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: admon.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:template match="*" mode="admon.graphic.width">
<xsl:param name="node" select="."/>
<xsl:text>25</xsl:text>
</xsl:template>
<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">
<xsl:param name="node" select="."/>
<xsl:value-of select="$admon.graphics.path"/>
<xsl:choose>
<xsl:when test="local-name($node)='note'">note</xsl:when>
<xsl:when test="local-name($node)='warning'">warning</xsl:when>
<xsl:when test="local-name($node)='caution'">caution</xsl:when>
<xsl:when test="local-name($node)='tip'">tip</xsl:when>
<xsl:when test="local-name($node)='important'">important</xsl:when>
<xsl:otherwise>note</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$admon.graphics.extension"/>
</xsl:template>
<xsl:template name="graphical.admonition">
<xsl:variable name="admon.type">
<xsl:choose>
<xsl:when test="local-name(.)='note'">Note</xsl:when>
<xsl:when test="local-name(.)='warning'">Warning</xsl:when>
<xsl:when test="local-name(.)='caution'">Caution</xsl:when>
<xsl:when test="local-name(.)='tip'">Tip</xsl:when>
<xsl:when test="local-name(.)='important'">Important</xsl:when>
<xsl:otherwise>Note</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="alt">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="$admon.type"/>
</xsl:call-template>
</xsl:variable>
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:if test="$admon.style != ''">
<xsl:attribute name="style">
<xsl:value-of select="$admon.style"/>
</xsl:attribute>
</xsl:if>
<table border="0">
<xsl:attribute name="summary">
<xsl:value-of select="$admon.type"/>
<xsl:if test="title|info/title">
<xsl:text>: </xsl:text>
<xsl:value-of select="(title|info/title)[1]"/>
</xsl:if>
</xsl:attribute>
<tr>
<td rowspan="2" align="center" valign="top">
<xsl:attribute name="width">
<xsl:apply-templates select="." mode="admon.graphic.width"/>
</xsl:attribute>
<img alt="[{$alt}]">
<xsl:attribute name="src">
<xsl:call-template name="admon.graphic"/>
</xsl:attribute>
</img>
</td>
<th align="{$direction.align.start}">
<xsl:call-template name="anchor"/>
<xsl:if test="$admon.textlabel != 0 or title or info/title">
<xsl:apply-templates select="." mode="object.title.markup"/>
</xsl:if>
</th>
</tr>
<tr>
<td align="{$direction.align.start}" valign="top">
<xsl:apply-templates/>
</td>
</tr>
</table>
</div>
</xsl:template>
<xsl:template name="nongraphical.admonition">
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:if test="$admon.style">
<xsl:attribute name="style">
<xsl:value-of select="$admon.style"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$admon.textlabel != 0 or title or info/title">
<h3 class="title">
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="." mode="object.title.markup"/>
</h3>
</xsl:if>
<xsl:apply-templates/>
</div>
</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>

View File

@@ -0,0 +1,169 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:template name="add.annotation.links">
<xsl:param name="scripts" select="normalize-space($annotation.js)"/>
<xsl:choose>
<xsl:when test="contains($scripts, ' ')">
<script type="text/javascript" src="{substring-before($scripts, ' ')}"/>
<xsl:call-template name="add.annotation.links">
<xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<script type="text/javascript" src="{$scripts}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="annotation"/>
<xsl:template name="apply-annotations">
<xsl:if test="$annotation.support != 0">
<!-- do any annotations apply to the context node? -->
<xsl:variable name="id" select="(@id|@xml:id)[1]"/>
<xsl:variable name="aids">
<xsl:for-each select="//annotation">
<xsl:if test="@annotates=$id
or starts-with(@annotates, concat($id, ' '))
or contains(@annotates, concat(' ', $id, ' '))
or substring(@annotates, string-length(@annotates)-3)
= concat(' ', $id)">
<xsl:value-of select="generate-id()"/>
<xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test="normalize-space(@annotations) != ''">
<xsl:call-template name="annotations-pointed-to">
<xsl:with-param name="annotations"
select="normalize-space(@annotations)"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:if test="$aids != ''">
<xsl:call-template name="apply-annotations-by-gid">
<xsl:with-param name="gids" select="normalize-space($aids)"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template name="annotations-pointed-to">
<xsl:param name="annotations"/>
<xsl:choose>
<xsl:when test="contains($annotations, ' ')">
<xsl:variable name='a'
select="key('id', substring-before($annotations, ' '))"/>
<xsl:if test="$a">
<xsl:value-of select="generate-id($a)"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:call-template name="annotations-pointed-to">
<xsl:with-param name="annotations"
select="substring-after($annotations, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name='a'
select="key('id', $annotations)"/>
<xsl:if test="$a">
<xsl:value-of select="generate-id($a)"/>
<xsl:text> </xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="apply-annotations-by-gid">
<xsl:param name="gids"/>
<xsl:choose>
<xsl:when test="contains($gids, ' ')">
<xsl:variable name="gid" select="substring-before($gids, ' ')"/>
<xsl:apply-templates select="key('gid', $gid)"
mode="annotation-inline"/>
<xsl:call-template name="apply-annotations-by-gid">
<xsl:with-param name="gids"
select="substring-after($gids, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="key('gid', $gids)"
mode="annotation-inline"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="annotation" mode="annotation-inline">
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="title">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>[Annotation #</xsl:text>
<xsl:number count="annotation" level="any" format="1"/>
<xsl:text>]</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="#annot-{generate-id(.)}" title="{$title}"
name="anch-{generate-id(.)}" id="anch-{generate-id(.)}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:attribute name="onClick">
<xsl:text>popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>.showPopup('anch-</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>'); return false;</xsl:text>
</xsl:attribute>
<img src="{$annotation.graphic.open}" border="0" alt="{$title}"/>
</a>
</xsl:template>
<xsl:template match="annotation" mode="annotation-popup">
<div class="annotation-nocss">
<p>
<a name="annot-{generate-id(.)}"/>
<xsl:text>Annotation #</xsl:text>
<xsl:number count="annotation" level="any" format="1"/>
<xsl:text>:</xsl:text>
</p>
</div>
<div id="popup-{generate-id(.)}" class="annotation-popup">
<xsl:if test="string-length(.) &gt; 300">
<xsl:attribute name="style">width:400px</xsl:attribute>
</xsl:if>
<xsl:call-template name="annotation-title"/>
<div class="annotation-body">
<xsl:apply-templates select="*[local-name(.) != 'title']"/>
</div>
<div class="annotation-close">
<a href="#" onclick="popup_{generate-id(.)}.hidePopup();return false;">
<xsl:apply-templates select="." mode="class.attribute"/>
<img src="{$annotation.graphic.close}" alt="X" border="0"/>
</a>
</div>
</div>
</xsl:template>
<xsl:template name="annotation-title">
<div class="annotation-title">
<xsl:choose>
<xsl:when test="title">
<xsl:apply-templates select="title/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Annotation</xsl:text>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,168 @@
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = ""]))'>
<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = ""]))'>
<!ENTITY tertiary 'normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas) or @sortas = ""]))'>
<!-- Documents using the kimber index method must have a lang attribute -->
<!-- Only one of these should be present in the entity -->
<!ENTITY lang 'concat(/*/@lang, /*/@xml:lang)'>
<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))'>
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:k="http://www.isogen.com/functions/com.isogen.saxoni18n.Saxoni18nService"
exclude-result-prefixes="k"
version="1.0">
<!-- ********************************************************************
$Id: autoidx-kimber.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- The "kimber" method contributed by Eliot Kimber of Innodata Isogen. -->
<!-- ==================================================================== -->
<!-- *** THIS MODULE ONLY WORKS WITH SAXON 6 OR SAXON 8 *** -->
<!-- ==================================================================== -->
<xsl:include href="../common/autoidx-kimber.xsl"/>
<!-- Java sort apparently works only on lang part, not country -->
<xsl:param name="sort.lang">
<xsl:choose>
<xsl:when test="contains(&lang;, '-')">
<xsl:value-of select="substring-before(&lang;, '-')"/>
</xsl:when>
<xsl:when test="contains(&lang;, '_')">
<xsl:value-of select="substring-before(&lang;, '_')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="&lang;"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:template name="generate-kimber-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:if test="not(contains($vendor, 'SAXON '))">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
<xsl:text>Saxon version 6 or 8 XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="not(function-available('k:getIndexGroupKey'))">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
<xsl:text>Innodata Isogen &#x0A;Java extensions for </xsl:text>
<xsl:text>internationalized indexes. &#x0A;Install those </xsl:text>
<xsl:text>extensions, or use a different index method.&#x0A;</xsl:text>
<xsl:text>For more information, see:&#x0A;</xsl:text>
<xsl:text>http://www.innodata-isogen.com/knowledge_center/tools_downloads/i18nsupport</xsl:text>
</xsl:message>
</xsl:if>
<xsl:variable name="role">
<xsl:if test="$index.on.role != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="type">
<xsl:if test="$index.on.type != 0">
<xsl:value-of select="@type"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="terms"
select="//indexterm[count(.|key('k-group', k:getIndexGroupKey(&lang;, &primary;))[&scope;][1]) = 1 and not(@class = 'endofrange')]"/>
<xsl:variable name="alphabetical"
select="$terms[not(starts-with(
k:getIndexGroupKey(&lang;, &primary;),
'#NUMERIC'
))]"/>
<xsl:variable name="others"
select="$terms[starts-with(
k:getIndexGroupKey(&lang;, &primary;),
'#NUMERIC'
)]"/>
<div class="index">
<xsl:if test="$others">
<div class="indexdev">
<h3>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'index symbols'"/>
</xsl:call-template>
</h3>
<dl>
<xsl:apply-templates select="$others"
mode="index-symbol-div">
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort lang="{$sort.lang}"
select="k:getIndexGroupSortKey(&lang;,
k:getIndexGroupKey(&lang;, &primary;))"/>
</xsl:apply-templates>
</dl>
</div>
</xsl:if>
<xsl:apply-templates select="$alphabetical"
mode="index-div-kimber">
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort lang="{$sort.lang}"
select="k:getIndexGroupSortKey(&lang;,
k:getIndexGroupKey(&lang;, &primary;))"/>
</xsl:apply-templates>
</div>
</xsl:template>
<xsl:template match="indexterm" mode="index-div-kimber">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key"
select="k:getIndexGroupKey(&lang;, &primary;)"/>
<xsl:variable name="label"
select="k:getIndexGroupLabel(&lang;, $key)"/>
<xsl:if test="key('k-group', $label)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]">
<div class="indexdiv">
<h3>
<xsl:value-of select="$label"/>
</h3>
<dl>
<xsl:apply-templates select="key('k-group', $key)[&scope;]
[count(.|key('primary', &primary;)[&scope;]
[1])=1]"
mode="index-primary">
<xsl:sort select="&primary;" lang="{$sort.lang}"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</dl>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,124 @@
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = ""]))'>
<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = ""]))'>
<!ENTITY tertiary 'normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas) or @sortas = ""]))'>
<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))'>
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:i="urn:cz-kosek:functions:index"
xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
xmlns:func="http://exslt.org/functions"
xmlns:k="http://www.isogen.com/functions/com.isogen.saxoni18n.Saxoni18nService"
xmlns:exslt="http://exslt.org/common"
extension-element-prefixes="func exslt"
exclude-result-prefixes="func exslt i l k"
version="1.0">
<!-- ********************************************************************
$Id: autoidx-kosek.xsl 8399 2009-04-08 07:37:42Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- The "kosek" method contributed by Jirka Kosek. -->
<xsl:include href="../common/autoidx-kosek.xsl"/>
<xsl:template name="generate-kosek-index">
<xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:if test="contains($vendor, 'libxslt')">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
<xsl:text>work with the xsltproc XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="contains($vendor, 'Saxonica')">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
<xsl:text>work with the Saxon 8 XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="$exsl.node.set.available = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method requires the </xsl:text>
<xsl:text>exslt:node-set() function. Use a processor that </xsl:text>
<xsl:text>has it, or use a different index method.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="not(function-available('i:group-index'))">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method requires the&#xA;</xsl:text>
<xsl:text>index extension functions be imported:&#xA;</xsl:text>
<xsl:text> xsl:import href="common/autoidx-kosek.xsl"</xsl:text>
</xsl:message>
</xsl:if>
<xsl:variable name="role">
<xsl:if test="$index.on.role != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="type">
<xsl:if test="$index.on.type != 0">
<xsl:value-of select="@type"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="terms"
select="//indexterm[count(.|key('group-code', i:group-index(&primary;))[&scope;][1]) = 1 and not(@class = 'endofrange')]"/>
<div class="index">
<xsl:apply-templates select="$terms" mode="index-div-kosek">
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="i:group-index(&primary;)" data-type="number"/>
</xsl:apply-templates>
</div>
</xsl:template>
<xsl:template match="indexterm" mode="index-div-kosek">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key"
select="i:group-index(&primary;)"/>
<xsl:variable name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:variable>
<xsl:if test="key('group-code', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]">
<div class="indexdiv">
<h3>
<xsl:value-of select="i:group-letter($key)"/>
</h3>
<dl>
<xsl:apply-templates select="key('group-code', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1])=1]"
mode="index-primary">
<xsl:sort select="&primary;" lang="{$lang}"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</dl>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- ********************************************************************
$Id: autoidx-ng.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the DocBook XSL Stylesheet distribution.
See ../README or http://docbook.sf.net/ for copyright
copyright and other information.
******************************************************************** -->
<!-- You should have this directly in your customization file. -->
<!-- This file is there only to retain backward compatibility. -->
<xsl:import href="autoidx-kosek.xsl"/>
<xsl:param name="index.method">kosek</xsl:param>
</xsl:stylesheet>

View File

@@ -0,0 +1,712 @@
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY % common.entities SYSTEM "../common/entities.ent">
%common.entities;
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common"
extension-element-prefixes="exslt"
exclude-result-prefixes="exslt"
version="1.0">
<!-- ********************************************************************
$Id: autoidx.xsl 8399 2009-04-08 07:37:42Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- The "basic" method derived from Jeni Tennison's work. -->
<!-- The "kosek" method contributed by Jirka Kosek. -->
<!-- The "kimber" method contributed by Eliot Kimber of Innodata Isogen. -->
<xsl:variable name="kimber.imported" select="0"/>
<xsl:variable name="kosek.imported" select="0"/>
<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="primary-section"
match="indexterm[not(secondary) and not(see)]"
use="concat(&primary;, &sep;, &section.id;)"/>
<xsl:key name="secondary-section"
match="indexterm[not(tertiary) and not(see)]"
use="concat(&primary;, &sep;, &secondary;, &sep;, &section.id;)"/>
<xsl:key name="tertiary-section"
match="indexterm[not(see)]"
use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, &section.id;)"/>
<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:key name="sections" match="*[@id or @xml:id]" use="@id|@xml:id"/>
<xsl:template name="generate-index">
<xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
<xsl:choose>
<xsl:when test="$index.method = 'kosek'">
<xsl:call-template name="generate-kosek-index">
<xsl:with-param name="scope" select="$scope"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$index.method = 'kimber'">
<xsl:call-template name="generate-kimber-index">
<xsl:with-param name="scope" select="$scope"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="generate-basic-index">
<xsl:with-param name="scope" select="$scope"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="generate-basic-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="role">
<xsl:if test="$index.on.role != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="type">
<xsl:if test="$index.on.type != 0">
<xsl:value-of select="@type"/>
</xsl:if>
</xsl:variable>
<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)))]"/>
<div class="index">
<xsl:if test="$others">
<div class="indexdiv">
<h3>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'index symbols'"/>
</xsl:call-template>
</h3>
<dl>
<xsl:apply-templates select="$others[count(.|key('primary',
&primary;)[&scope;][1]) = 1]"
mode="index-symbol-div">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</div>
</xsl:if>
<xsl:apply-templates select="$alphabetical[count(.|key('letter',
translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;))[&scope;][1]) = 1]"
mode="index-div-basic">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</div>
</xsl:template>
<!-- This template not used if html/autoidx-kosek.xsl is imported -->
<xsl:template name="generate-kosek-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:if test="contains($vendor, 'libxslt')">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
<xsl:text>work with the xsltproc XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="$exsl.node.set.available = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method requires the </xsl:text>
<xsl:text>exslt:node-set() function. Use a processor that </xsl:text>
<xsl:text>has it, or use a different index method.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="$kosek.imported = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kosek' index method requires the&#xA;</xsl:text>
<xsl:text>kosek index extensions be imported:&#xA;</xsl:text>
<xsl:text> xsl:import href="html/autoidx-kosek.xsl"</xsl:text>
</xsl:message>
</xsl:if>
</xsl:template>
<!-- This template not used if html/autoidx-kimber.xsl is imported -->
<xsl:template name="generate-kimber-index">
<xsl:param name="scope" select="NOTANODE"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:if test="not(contains($vendor, 'SAXON '))">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
<xsl:text>Saxon version 6 or 8 XSLT processor.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="$kimber.imported = 0">
<xsl:message terminate="yes">
<xsl:text>ERROR: the 'kimber' index method requires the&#xA;</xsl:text>
<xsl:text>kimber index extensions be imported:&#xA;</xsl:text>
<xsl:text> xsl:import href="html/autoidx-kimber.xsl"</xsl:text>
</xsl:message>
</xsl:if>
</xsl:template>
<xsl:template match="indexterm" mode="index-div-basic">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" 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]">
<div class="indexdiv">
<xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
<h3>
<xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/>
</h3>
</xsl:if>
<dl>
<xsl:apply-templates select="key('letter', $key)[&scope;]
[count(.|key('primary', &primary;)
[&scope;][1])=1]"
mode="index-primary">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="indexterm" mode="index-symbol-div">
<xsl:param name="scope" select="/"/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" 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;)[1]) = 1]"
mode="index-primary">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="indexterm" mode="index-primary">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key" select="&primary;"/>
<xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
<dt>
<xsl:for-each select="$refs/primary">
<xsl:if test="@id or @xml:id">
<a name="{(@id|@xml:id)[1]}"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="primary"/>
<xsl:choose>
<xsl:when test="$index.links.to.section = 1">
<xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section', concat($key, &sep;, &section.id;))[&scope;][1])]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$refs[&scope;]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</xsl:if>
</dt>
<xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
<dd>
<dl>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</dd>
</xsl:if>
</xsl:template>
<xsl:template match="indexterm" mode="index-secondary">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
<xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
<dt>
<xsl:for-each select="$refs/secondary">
<xsl:if test="@id or @xml:id">
<a name="{(@id|@xml:id)[1]}"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="secondary"/>
<xsl:choose>
<xsl:when test="$index.links.to.section = 1">
<xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section', concat($key, &sep;, &section.id;))[&scope;][1])]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$refs[&scope;]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</xsl:if>
</dt>
<xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::seealso]">
<dd>
<dl>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</dd>
</xsl:if>
</xsl:template>
<xsl:template match="indexterm" mode="index-tertiary">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
<xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/>
<dt>
<xsl:for-each select="$refs/tertiary">
<xsl:if test="@id or @xml:id">
<a name="{(@id|@xml:id)[1]}"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="tertiary"/>
<xsl:choose>
<xsl:when test="$index.links.to.section = 1">
<xsl:for-each select="$refs[generate-id() = generate-id(key('tertiary-section', concat($key, &sep;, &section.id;))[&scope;][1])]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$refs[&scope;]">
<xsl:apply-templates select="." mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</xsl:if>
</dt>
<xsl:if test="$refs/seealso">
<dd>
<dl>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</dl>
</dd>
</xsl:if>
</xsl:template>
<xsl:template match="indexterm" mode="reference">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:param name="position"/>
<xsl:variable name="term.separator">
<xsl:call-template name="index.separator">
<xsl:with-param name="key" select="'index.term.separator'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="number.separator">
<xsl:call-template name="index.separator">
<xsl:with-param name="key" select="'index.number.separator'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="range.separator">
<xsl:call-template name="index.separator">
<xsl:with-param name="key" select="'index.range.separator'"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$position = 1">
<xsl:value-of select="$term.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$number.separator"/>
</xsl:otherwise>
</xsl:choose>
<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="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="&section;/titleabbrev and $index.prefer.titleabbrev != 0">
<xsl:apply-templates select="&section;" mode="titleabbrev.markup"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="&section;" mode="title.markup"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$index.links.to.section = 1">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="&section;"/>
<xsl:with-param name="context" select="//index[&scope;][1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
<xsl:with-param name="context" select="//index[&scope;][1]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="$title"/> <!-- text only -->
</a>
<xsl:variable name="id" select="(@id|@xml:id)[1]"/>
<xsl:if test="key('endofrange', $id)[&scope;]">
<xsl:apply-templates select="key('endofrange', $id)[&scope;][last()]"
mode="reference">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
<xsl:with-param name="separator" select="$range.separator"/>
</xsl:apply-templates>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="reference">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" 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('sections', $zone)"/>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target[1]"/>
<xsl:with-param name="context" select="//index[&scope;][1]"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target[1]" mode="index-title-content"/>
</a>
<xsl:text>, </xsl:text>
<xsl:call-template name="reference">
<xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="type" select="$type"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="zone" select="$zones"/>
<xsl:variable name="target" select="key('sections', $zone)"/>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target[1]"/>
<xsl:with-param name="context" select="//index[&scope;][1]"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target[1]" mode="index-title-content"/>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="indexterm" mode="index-see">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<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>
</xsl:template>
<xsl:template match="indexterm" mode="index-seealso">
<xsl:param name="scope" select="."/>
<xsl:param name="role" select="''"/>
<xsl:param name="type" select="''"/>
<xsl:for-each select="seealso">
<xsl:sort select="translate(., &lowercase;, &uppercase;)"/>
<dt>
<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="."/>
<xsl:text>)</xsl:text>
</dt>
</xsl:for-each>
</xsl:template>
<xsl:template match="*" mode="index-title-content">
<xsl:variable name="title">
<xsl:apply-templates select="&section;" mode="title.markup"/>
</xsl:variable>
<xsl:value-of select="$title"/>
</xsl:template>
<xsl:template name="index.separator">
<xsl:param name="key" select="''"/>
<xsl:param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:param>
<xsl:choose>
<xsl:when test="$key = 'index.term.separator'">
<xsl:choose>
<!-- Use the override if not blank -->
<xsl:when test="$index.term.separator != ''">
<xsl:copy-of select="$index.term.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="context">index</xsl:with-param>
<xsl:with-param name="name">term-separator</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$key = 'index.number.separator'">
<xsl:choose>
<!-- Use the override if not blank -->
<xsl:when test="$index.number.separator != ''">
<xsl:copy-of select="$index.number.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="context">index</xsl:with-param>
<xsl:with-param name="name">number-separator</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$key = 'index.range.separator'">
<xsl:choose>
<!-- Use the override if not blank -->
<xsl:when test="$index.range.separator != ''">
<xsl:copy-of select="$index.range.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="lang" select="$lang"/>
<xsl:with-param name="context">index</xsl:with-param>
<xsl:with-param name="name">range-separator</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,676 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: autotoc.xsl 8315 2009-03-11 21:33:31Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:variable name="toc.listitem.type">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">dt</xsl:when>
<xsl:otherwise>li</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- this is just hack because dl and ul aren't completely isomorphic -->
<xsl:variable name="toc.dd.type">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">dd</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:template name="make.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
<xsl:variable name="nodes.plus" select="$nodes | qandaset"/>
<xsl:variable name="toc.title">
<xsl:if test="$toc.title.p">
<p>
<b>
<xsl:call-template name="gentext">
<xsl:with-param name="key">TableofContents</xsl:with-param>
</xsl:call-template>
</b>
</p>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="$manual.toc != ''">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:variable name="toc" select="document($manual.toc, .)"/>
<xsl:variable name="tocentry" select="$toc//tocentry[@linkend=$id]"/>
<xsl:if test="$tocentry and $tocentry/*">
<div class="toc">
<xsl:copy-of select="$toc.title"/>
<xsl:element name="{$toc.list.type}">
<xsl:call-template name="manual-toc">
<xsl:with-param name="tocentry" select="$tocentry/*[1]"/>
</xsl:call-template>
</xsl:element>
</div>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$qanda.in.toc != 0">
<xsl:if test="$nodes.plus">
<div class="toc">
<xsl:copy-of select="$toc.title"/>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="$nodes.plus" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:element>
</div>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$nodes">
<div class="toc">
<xsl:copy-of select="$toc.title"/>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:element>
</div>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="make.lots">
<xsl:param name="toc.params" select="''"/>
<xsl:param name="toc"/>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:copy-of select="$toc"/>
</xsl:if>
<xsl:if test="contains($toc.params, 'figure')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'figure'"/>
<xsl:with-param name="nodes" select=".//figure"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains($toc.params, 'table')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'table'"/>
<xsl:with-param name="nodes" select=".//table"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains($toc.params, 'example')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'example'"/>
<xsl:with-param name="nodes" select=".//example"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains($toc.params, 'equation')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'equation'"/>
<xsl:with-param name="nodes" select=".//equation[title or info/title]"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="contains($toc.params, 'procedure')">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'procedure'"/>
<xsl:with-param name="nodes" select=".//procedure[title]"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- ====================================================================== -->
<xsl:template name="set.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:call-template name="make.toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
<xsl:with-param name="nodes" select="book|setindex"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="division.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:call-template name="make.toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
<xsl:with-param name="nodes" select="part|reference
|preface|chapter|appendix
|article
|bibliography|glossary|index
|refentry
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="component.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
<xsl:call-template name="make.toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
<xsl:with-param name="nodes" select="section|sect1
|simplesect[$simplesect.in.toc != 0]
|refentry
|article|bibliography|glossary
|appendix|index
|bridgehead[not(@renderas)
and $bridgehead.in.toc != 0]
|.//bridgehead[@renderas='sect1'
and $bridgehead.in.toc != 0]"/>
</xsl:call-template>
</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:call-template name="make.toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="toc.title.p" select="$toc.title.p"/>
<xsl:with-param name="nodes"
select="section|sect1|sect2|sect3|sect4|sect5|refentry
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="section.toc.separator">
<!-- Customize to output something between
section.toc and first output -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="subtoc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
<xsl:variable name="nodes.plus" select="$nodes | qandaset"/>
<xsl:variable name="subtoc">
<xsl:element name="{$toc.list.type}">
<xsl:choose>
<xsl:when test="$qanda.in.toc != 0">
<xsl:apply-templates mode="toc" select="$nodes.plus">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="toc" select="$nodes">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:variable>
<xsl:variable name="depth">
<xsl:choose>
<xsl:when test="local-name(.) = 'section'">
<xsl:value-of select="count(ancestor::section) + 1"/>
</xsl:when>
<xsl:when test="local-name(.) = 'sect1'">1</xsl:when>
<xsl:when test="local-name(.) = 'sect2'">2</xsl:when>
<xsl:when test="local-name(.) = 'sect3'">3</xsl:when>
<xsl:when test="local-name(.) = 'sect4'">4</xsl:when>
<xsl:when test="local-name(.) = 'sect5'">5</xsl:when>
<xsl:when test="local-name(.) = 'refsect1'">1</xsl:when>
<xsl:when test="local-name(.) = 'refsect2'">2</xsl:when>
<xsl:when test="local-name(.) = 'refsect3'">3</xsl:when>
<xsl:when test="local-name(.) = 'simplesect'">
<!-- sigh... -->
<xsl:choose>
<xsl:when test="local-name(..) = 'section'">
<xsl:value-of select="count(ancestor::section)"/>
</xsl:when>
<xsl:when test="local-name(..) = 'sect1'">2</xsl:when>
<xsl:when test="local-name(..) = 'sect2'">3</xsl:when>
<xsl:when test="local-name(..) = 'sect3'">4</xsl:when>
<xsl:when test="local-name(..) = 'sect4'">5</xsl:when>
<xsl:when test="local-name(..) = 'sect5'">6</xsl:when>
<xsl:when test="local-name(..) = 'refsect1'">2</xsl:when>
<xsl:when test="local-name(..) = 'refsect2'">3</xsl:when>
<xsl:when test="local-name(..) = 'refsect3'">4</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
<xsl:variable name="subtoc.list">
<xsl:choose>
<xsl:when test="$toc.dd.type = ''">
<xsl:copy-of select="$subtoc"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$toc.dd.type}">
<xsl:copy-of select="$subtoc"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$toc.listitem.type}">
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
<xsl:if test="$toc.listitem.type = 'li'
and $toc.section.depth > $depth and
( ($qanda.in.toc = 0 and count($nodes)&gt;0) or
($qanda.in.toc != 0 and count($nodes.plus)&gt;0) )
and $toc.max.depth > $depth.from.context">
<xsl:copy-of select="$subtoc.list"/>
</xsl:if>
</xsl:element>
<xsl:if test="$toc.listitem.type != 'li'
and $toc.section.depth > $depth and
( ($qanda.in.toc = 0 and count($nodes)&gt;0) or
($qanda.in.toc != 0 and count($nodes.plus)&gt;0) )
and $toc.max.depth > $depth.from.context">
<xsl:copy-of select="$subtoc.list"/>
</xsl:if>
</xsl:template>
<xsl:template name="toc.line">
<xsl:param name="toc-context" select="."/>
<xsl:param name="depth" select="1"/>
<xsl:param name="depth.from.context" select="8"/>
<span>
<xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
<!-- * if $autotoc.label.in.hyperlink is zero, then output the label -->
<!-- * before the hyperlinked title (as the DSSSL stylesheet does) -->
<xsl:if test="$autotoc.label.in.hyperlink = 0">
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:copy-of select="$label"/>
<xsl:if test="$label != ''">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
</xsl:if>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="context" select="$toc-context"/>
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<!-- * if $autotoc.label.in.hyperlink is non-zero, then output the label -->
<!-- * as part of the hyperlinked title -->
<xsl:if test="not($autotoc.label.in.hyperlink = 0)">
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:copy-of select="$label"/>
<xsl:if test="$label != ''">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
</xsl:if>
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</a>
</span>
</xsl:template>
<xsl:template match="book" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="part|reference
|preface|chapter|appendix
|article
|bibliography|glossary|index
|refentry
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="setindex" mode="toc">
<xsl:param name="toc-context" select="."/>
<!-- If the setindex tag is not empty, it should be it in the TOC -->
<xsl:if test="* or $generate.index != 0">
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="part|reference" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="appendix|chapter|article
|index|glossary|bibliography
|preface|reference|refentry
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="preface|chapter|appendix|article" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="section|sect1
|simplesect[$simplesect.in.toc != 0]
|refentry
|glossary|bibliography|index
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect1" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="sect2
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect2" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="sect3
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect3" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="sect4
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect4" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="sect5
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect5" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="simplesect" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="section" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="section|refentry
|simplesect[$simplesect.in.toc != 0]
|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="bridgehead" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:if test="$bridgehead.in.toc != 0">
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="bibliography|glossary" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="index" mode="toc">
<xsl:param name="toc-context" select="."/>
<!-- If the index tag is not empty, it should be it in the TOC -->
<xsl:if test="* or $generate.index != 0">
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="refentry" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:variable name="refmeta" select=".//refmeta"/>
<xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
<xsl:variable name="refnamediv" select=".//refnamediv"/>
<xsl:variable name="refname" select="$refnamediv//refname"/>
<xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$refentrytitle">
<xsl:apply-templates select="$refentrytitle[1]"
mode="titleabbrev.markup"/>
</xsl:when>
<xsl:when test="$refdesc">
<xsl:apply-templates select="$refdesc"
mode="titleabbrev.markup"/>
</xsl:when>
<xsl:when test="$refname">
<xsl:apply-templates select="$refname[1]"
mode="titleabbrev.markup"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$toc.listitem.type}">
<span class='refentrytitle'>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<xsl:copy-of select="$title"/>
</a>
</span>
<span class='refpurpose'>
<xsl:if test="$annotate.toc != 0">
<!-- * DocBook 5 says inlinemediaobject (among other things) -->
<!-- * is allowed in refpurpose; so we need to run -->
<!-- * apply-templates on refpurpose here, instead of value-of -->
<xsl:apply-templates select="refnamediv/refpurpose"/>
</xsl:if>
</span>
</xsl:element>
</xsl:template>
<xsl:template match="title" mode="toc">
<xsl:param name="toc-context" select="."/>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select=".."/>
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template name="manual-toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="tocentry"/>
<!-- be careful, we don't want to change the current document to the other tree! -->
<xsl:if test="$tocentry">
<xsl:variable name="node" select="key('id', $tocentry/@linkend)"/>
<xsl:element name="{$toc.listitem.type}">
<xsl:variable name="label">
<xsl:apply-templates select="$node" mode="label.markup"/>
</xsl:variable>
<xsl:copy-of select="$label"/>
<xsl:if test="$label != ''">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$node"/>
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$node" mode="titleabbrev.markup"/>
</a>
</xsl:element>
<xsl:if test="$tocentry/*">
<xsl:element name="{$toc.list.type}">
<xsl:call-template name="manual-toc">
<xsl:with-param name="tocentry" select="$tocentry/*[1]"/>
</xsl:call-template>
</xsl:element>
</xsl:if>
<xsl:if test="$tocentry/following-sibling::*">
<xsl:call-template name="manual-toc">
<xsl:with-param name="tocentry" select="$tocentry/following-sibling::*[1]"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="list.of.titles">
<xsl:param name="toc-context" select="."/>
<xsl:param name="titles" select="'table'"/>
<xsl:param name="nodes" select=".//table"/>
<xsl:if test="$nodes">
<div class="list-of-{$titles}s">
<p>
<b>
<xsl:call-template name="gentext">
<xsl:with-param name="key">
<xsl:choose>
<xsl:when test="$titles='table'">ListofTables</xsl:when>
<xsl:when test="$titles='figure'">ListofFigures</xsl:when>
<xsl:when test="$titles='equation'">ListofEquations</xsl:when>
<xsl:when test="$titles='example'">ListofExamples</xsl:when>
<xsl:when test="$titles='procedure'">ListofProcedures</xsl:when>
<xsl:otherwise>ListofUnknown</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</b>
</p>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</xsl:element>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="figure|table|example|equation|procedure" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:element name="{$toc.listitem.type}">
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:copy-of select="$label"/>
<xsl:if test="$label != ''">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</a>
</xsl:element>
</xsl:template>
<!-- Used only if qanda.in.toc parameter is non-zero -->
<xsl:template match="qandaset" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes" select="qandadiv | qandaentry"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="qandadiv|qandaentry" mode="toc">
<xsl:apply-templates select="." mode="qandatoc.mode"/>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,437 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: block.xsl 8441 2009-05-24 02:14:56Z abdelazer $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- What should we do about styling blockinfo? -->
<xsl:template match="blockinfo|info">
<!-- suppress -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="block.object">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="para">
<xsl:call-template name="paragraph">
<xsl:with-param name="class">
<xsl:if test="@role and $para.propagates.style != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="content">
<xsl:if test="position() = 1 and parent::listitem">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="parent::listitem"/>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="paragraph">
<xsl:param name="class" select="''"/>
<xsl:param name="content"/>
<xsl:variable name="p">
<p>
<xsl:choose>
<xsl:when test="$class != ''">
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="locale.html.attributes"/>
</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="$content"/>
</p>
</xsl:variable>
<xsl:choose>
<xsl:when test="$html.cleanup != 0">
<xsl:call-template name="unwrap.p">
<xsl:with-param name="p" select="$p"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$p"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="simpara">
<!-- see also listitem/simpara in lists.xsl -->
<p>
<xsl:call-template name="locale.html.attributes"/>
<xsl:if test="@role and $para.propagates.style != 0">
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="@role"/>
</xsl:apply-templates>
</xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="formalpara">
<xsl:call-template name="paragraph">
<xsl:with-param name="class">
<xsl:if test="@role and $para.propagates.style != 0">
<xsl:value-of select="@role"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="content">
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- Only use title from info -->
<xsl:template match="formalpara/info">
<xsl:apply-templates select="title"/>
</xsl:template>
<xsl:template match="formalpara/title|formalpara/info/title">
<xsl:variable name="titleStr">
<xsl:apply-templates/>
</xsl:variable>
<xsl:variable name="lastChar">
<xsl:if test="$titleStr != ''">
<xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/>
</xsl:if>
</xsl:variable>
<b>
<xsl:copy-of select="$titleStr"/>
<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>&#160;</xsl:text>
</b>
</xsl:template>
<xsl:template match="formalpara/para">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="blockquote">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="attribution">
<table border="0" width="100%"
cellspacing="0" cellpadding="0" class="blockquote"
summary="Block quote">
<tr>
<td width="10%" valign="top">&#160;</td>
<td width="80%" valign="top">
<xsl:apply-templates select="child::*[local-name(.)!='attribution']"/>
</td>
<td width="10%" valign="top">&#160;</td>
</tr>
<tr>
<td width="10%" valign="top">&#160;</td>
<td colspan="2" align="{$direction.align.end}" valign="top">
<xsl:text>--</xsl:text>
<xsl:apply-templates select="attribution"/>
</td>
</tr>
</table>
</xsl:when>
<xsl:otherwise>
<blockquote>
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates/>
</blockquote>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
<xsl:template match="blockquote/title|blockquote/info/title">
<div class="blockquote-title">
<p>
<b>
<xsl:apply-templates/>
</b>
</p>
</div>
</xsl:template>
<!-- Use an em dash per Chicago Manual of Style and https://sourceforge.net/tracker/index.php?func=detail&aid=2793878&group_id=21935&atid=373747 -->
<xsl:template match="epigraph">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates select="para|simpara|formalpara|literallayout"/>
<xsl:if test="attribution">
<div class="attribution">
<span>&#x2014;<xsl:apply-templates select="attribution"/></span>
</div>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="attribution">
<span>
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="abstract|sidebar">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="anchor"/>
<xsl:call-template name="formal.object.heading">
<xsl:with-param name="title">
<xsl:apply-templates select="." mode="title.markup">
<xsl:with-param name="allow-anchors" select="'1'"/>
</xsl:apply-templates>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="abstract/title|sidebar/title">
</xsl:template>
<xsl:template match="sidebar/sidebarinfo|sidebar/info"/>
<!-- ==================================================================== -->
<xsl:template match="msgset">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgentry">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="simplemsgentry">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msg">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msgmain">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgmain/title">
<b><xsl:apply-templates/></b>
</xsl:template>
<xsl:template match="msgsub">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgsub/title">
<b><xsl:apply-templates/></b>
</xsl:template>
<xsl:template match="msgrel">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msgrel/title">
<b><xsl:apply-templates/></b>
</xsl:template>
<xsl:template match="msgtext">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="msginfo">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msglevel">
<p>
<b>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgLevel'"/>
</xsl:call-template>
</b>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="msgorig">
<p>
<b>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgOrig'"/>
</xsl:call-template>
</b>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="msgaud">
<p>
<b>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'msgset'"/>
<xsl:with-param name="name" select="'MsgAud'"/>
</xsl:call-template>
</b>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="msgexplan">
<xsl:call-template name="block.object"/>
</xsl:template>
<xsl:template match="msgexplan/title">
<p><b><xsl:apply-templates/></b></p>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="revhistory">
<div>
<xsl:call-template name="common.html.attributes"/>
<table border="0" width="100%" summary="Revision history">
<tr>
<th align="{$direction.align.start}" valign="top" colspan="3">
<b>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RevHistory'"/>
</xsl:call-template>
</b>
</th>
</tr>
<xsl:apply-templates/>
</table>
</div>
</xsl:template>
<xsl:template match="revhistory/revision">
<xsl:variable name="revnumber" select="revnumber"/>
<xsl:variable name="revdate" select="date"/>
<xsl:variable name="revauthor" select="authorinitials|author"/>
<xsl:variable name="revremark" select="revremark|revdescription"/>
<tr>
<td align="{$direction.align.start}">
<xsl:if test="$revnumber">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'Revision'"/>
</xsl:call-template>
<xsl:call-template name="gentext.space"/>
<xsl:apply-templates select="$revnumber"/>
</xsl:if>
</td>
<td align="{$direction.align.start}">
<xsl:apply-templates select="$revdate"/>
</td>
<xsl:choose>
<xsl:when test="count($revauthor)=0">
<td align="{$direction.align.start}">
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat">nbsp</xsl:with-param>
</xsl:call-template>
</td>
</xsl:when>
<xsl:otherwise>
<td align="{$direction.align.start}">
<xsl:for-each select="$revauthor">
<xsl:apply-templates select="."/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</td>
</xsl:otherwise>
</xsl:choose>
</tr>
<xsl:if test="$revremark">
<tr>
<td align="{$direction.align.start}" colspan="3">
<xsl:apply-templates select="$revremark"/>
</td>
</tr>
</xsl:if>
</xsl:template>
<xsl:template match="revision/revnumber">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/date">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/authorinitials">
<xsl:text>, </xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/authorinitials[1]" priority="2">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/revremark">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="revision/revdescription">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="ackno|acknowledgements[parent::article]">
<p>
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates/>
</p>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="highlights">
<xsl:call-template name="block.object"/>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,201 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim"
xmlns:xverb="xalan://com.nwalsh.xalan.Verbatim"
xmlns:lxslt="http://xml.apache.org/xslt"
exclude-result-prefixes="sverb xverb lxslt"
version='1.0'>
<!-- ********************************************************************
$Id: callout.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<lxslt:component prefix="xverb"
functions="insertCallouts"/>
<xsl:template match="programlistingco|screenco">
<xsl:variable name="verbatim" select="programlisting|screen"/>
<xsl:choose>
<xsl:when test="$use.extensions != '0'
and $callouts.extension != '0'">
<xsl:variable name="rtf">
<xsl:apply-templates select="$verbatim">
<xsl:with-param name="suppress-numbers" select="'1'"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:variable name="rtf-with-callouts">
<xsl:choose>
<xsl:when test="function-available('sverb:insertCallouts')">
<xsl:copy-of select="sverb:insertCallouts(areaspec,$rtf)"/>
</xsl:when>
<xsl:when test="function-available('xverb:insertCallouts')">
<xsl:copy-of select="xverb:insertCallouts(areaspec,$rtf)"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>No insertCallouts function is available.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$verbatim/@linenumbering = 'numbered'
and $linenumbering.extension != '0'">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf-with-callouts"/>
<xsl:with-param name="pi.context"
select="programlisting|screen"/>
</xsl:call-template>
<xsl:apply-templates select="calloutlist"/>
</div>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:copy-of select="$rtf-with-callouts"/>
<xsl:apply-templates select="calloutlist"/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="areaspec|areaset|area">
</xsl:template>
<xsl:template match="areaset" mode="conumber">
<xsl:number count="area|areaset" format="1"/>
</xsl:template>
<xsl:template match="area" mode="conumber">
<xsl:number count="area|areaset" format="1"/>
</xsl:template>
<xsl:template match="co" name="co">
<!-- Support a single linkend in HTML -->
<xsl:variable name="targets" select="key('id', @linkends)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="@id or @xml:id">
<xsl:attribute name="name">
<xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="." mode="callout-bug"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="." mode="callout-bug"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="coref">
<!-- tricky; this relies on the fact that we can process the "co" that's -->
<!-- "over there" as if it were "right here" -->
<xsl:variable name="co" select="key('id', @linkend)"/>
<xsl:choose>
<xsl:when test="not($co)">
<xsl:message>
<xsl:text>Error: coref link is broken: </xsl:text>
<xsl:value-of select="@linkend"/>
</xsl:message>
</xsl:when>
<xsl:when test="local-name($co) != 'co'">
<xsl:message>
<xsl:text>Error: coref doesn't point to a co: </xsl:text>
<xsl:value-of select="@linkend"/>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$co"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="co" mode="callout-bug">
<xsl:call-template name="callout-bug">
<xsl:with-param name="conum">
<xsl:number count="co"
level="any"
from="programlisting|screen|literallayout|synopsis"
format="1"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="callout-bug">
<xsl:param name="conum" select='1'/>
<xsl:choose>
<xsl:when test="$callout.graphics != 0
and $conum &lt;= $callout.graphics.number.limit">
<img src="{$callout.graphics.path}{$conum}{$callout.graphics.extension}"
alt="{$conum}" border="0"/>
</xsl:when>
<xsl:when test="$callout.unicode != 0
and $conum &lt;= $callout.unicode.number.limit">
<xsl:choose>
<xsl:when test="$callout.unicode.start.character = 10102">
<xsl:choose>
<xsl:when test="$conum = 1">&#10102;</xsl:when>
<xsl:when test="$conum = 2">&#10103;</xsl:when>
<xsl:when test="$conum = 3">&#10104;</xsl:when>
<xsl:when test="$conum = 4">&#10105;</xsl:when>
<xsl:when test="$conum = 5">&#10106;</xsl:when>
<xsl:when test="$conum = 6">&#10107;</xsl:when>
<xsl:when test="$conum = 7">&#10108;</xsl:when>
<xsl:when test="$conum = 8">&#10109;</xsl:when>
<xsl:when test="$conum = 9">&#10110;</xsl:when>
<xsl:when test="$conum = 10">&#10111;</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Don't know how to generate Unicode callouts </xsl:text>
<xsl:text>when $callout.unicode.start.character is </xsl:text>
<xsl:value-of select="$callout.unicode.start.character"/>
</xsl:message>
<xsl:text>(</xsl:text>
<xsl:value-of select="$conum"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>(</xsl:text>
<xsl:value-of select="$conum"/>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,121 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- ********************************************************************
$Id: changebars.xsl 8128 2008-09-29 17:16:10Z mzjn $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:import href="docbook.xsl"/>
<xsl:param name="show.revisionflag" select="'1'"/>
<xsl:template name="system.head.content">
<xsl:param name="node" select="."/>
<style type="text/css">
<xsl:text>
div.added { background-color: #ffff99;
text-decoration: underline; }
div.deleted { text-decoration: line-through;
background-color: #FF7F7F; }
div.changed { background-color: #99ff99; }
div.off { }
span.added { background-color: #ffff99;
text-decoration: underline; }
span.deleted { text-decoration: line-through;
background-color: #FF7F7F; }
span.changed { background-color: #99ff99; }
span.off { }
</xsl:text>
</style>
</xsl:template>
<xsl:template match="*[@revisionflag]">
<xsl:call-template name="block.or.inline.revision"/>
</xsl:template>
<xsl:template name="block.or.inline.revision">
<xsl:param name="revisionflag" select="@revisionflag"/>
<xsl:choose>
<xsl:when test="local-name(.) = 'para'
or local-name(.) = 'formalpara'
or local-name(.) = 'simpara'
or local-name(.) = 'simplesect'
or local-name(.) = 'section'
or local-name(.) = 'sect1'
or local-name(.) = 'sect2'
or local-name(.) = 'sect3'
or local-name(.) = 'sect4'
or local-name(.) = 'sect5'
or local-name(.) = 'chapter'
or local-name(.) = 'preface'
or local-name(.) = 'itemizedlist'
or local-name(.) = 'orderedlist'
or local-name(.) = 'variablelist'
or local-name(.) = 'varlistentry'
or local-name(.) = 'informaltable'
or local-name(.) = 'informalexample'
or local-name(.) = 'note'
or local-name(.) = 'example'
or local-name(.) = 'mediaobject'
or local-name(.) = 'sidebar'
or local-name(.) = 'glossary'
or local-name(.) = 'glossentry'
or local-name(.) = 'bibliography'
or local-name(.) = 'index'
or local-name(.) = 'appendix'">
<div class='{$revisionflag}'>
<xsl:apply-imports/>
</div>
</xsl:when>
<xsl:when test="local-name(.) = 'phrase'
or local-name(.) = 'ulink'
or local-name(.) = 'link'
or local-name(.) = 'olink'
or local-name(.) = 'inlinemediaobject'
or local-name(.) = 'filename'
or local-name(.) = 'literal'
or local-name(.) = 'member'
or local-name(.) = 'term'
or local-name(.) = 'guilabel'
or local-name(.) = 'glossterm'
or local-name(.) = 'sgmltag'
or local-name(.) = 'tag'
or local-name(.) = 'quote'
or local-name(.) = 'emphasis'
or local-name(.) = 'command'
or local-name(.) = 'xref'">
<span class='{$revisionflag}'>
<xsl:apply-imports/>
</span>
</xsl:when>
<xsl:when test="local-name(.) = 'listitem'
or local-name(.) = 'entry'
or local-name(.) = 'title'">
<!-- nop; these are handled directly in the stylesheet -->
<xsl:apply-imports/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Revisionflag on unexpected element: </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> (Assuming block)</xsl:text>
</xsl:message>
<div class='{$revisionflag}'>
<xsl:apply-imports/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,99 @@
<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"
version="1.0"
exclude-result-prefixes="exsl cf">
<!-- ********************************************************************
$Id: chunk-changebars.xsl 8399 2009-04-08 07:37:42Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- This file is a variant of chunk.xsl, to be used for generating chunked
output with highlighting based on change markup. -->
<xsl:import href="changebars.xsl"/>
<xsl:import href="chunk-common.xsl"/>
<!-- This customization of "process-chunk-element" is needed in order to make change
highlighting be inherited by chunked children of an element with change markup. -->
<xsl:template name="process-chunk-element">
<xsl:param name="content">
<xsl:choose>
<xsl:when test="ancestor-or-self::*[@revisionflag] and $show.revisionflag != 0">
<xsl:variable name="revisionflag" select="ancestor-or-self::*[@revisionflag][1]/@revisionflag" />
<xsl:call-template name="block.or.inline.revision">
<xsl:with-param name="revisionflag" select="$revisionflag"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-imports/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:choose>
<xsl:when test="$chunk.fast != 0 and $exsl.node.set.available != 0">
<xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
<xsl:variable name="genid" select="generate-id()"/>
<xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
<xsl:variable name="prevdiv"
select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
<xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
<xsl:variable name="nextdiv"
select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
<xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
<xsl:choose>
<xsl:when test="$onechunk != 0 and parent::*">
<xsl:copy-of select="$content"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="process-chunk">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$onechunk != 0 and not(parent::*)">
<xsl:call-template name="chunk-all-sections">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$onechunk != 0">
<xsl:copy-of select="$content"/>
</xsl:when>
<xsl:when test="$chunk.first.sections = 0">
<xsl:call-template name="chunk-first-section-with-parent">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="chunk-all-sections">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:include href="chunk-code.xsl"/>
</xsl:stylesheet>

View File

@@ -0,0 +1,667 @@
<?xml version="1.0"?>
<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"
exclude-result-prefixes="exsl cf ng db"
version="1.0">
<!-- ********************************************************************
$Id: chunk-code.xsl 8345 2009-03-16 06:44:07Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="*" mode="chunk-filename">
<!-- returns the filename of a chunk -->
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:variable name="fn">
<xsl:apply-templates select="." mode="recursive-chunk-filename"/>
</xsl:variable>
<!--
<xsl:message>
<xsl:value-of select="$ischunk"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text>) </xsl:text>
<xsl:value-of select="$fn"/>
<xsl:text>, </xsl:text>
<xsl:call-template name="dbhtml-dir"/>
</xsl:message>
-->
<!-- 2003-11-25 by ndw:
The following test used to read test="$ischunk != 0 and $fn != ''"
I've removed the ischunk part of the test so that href.to.uri and
href.from.uri will be fully qualified even if the source or target
isn't a chunk. I *think* that if $fn != '' then it's appropriate
to put the directory on the front, even if the element isn't a
chunk. I could be wrong. -->
<xsl:if test="$fn != ''">
<xsl:call-template name="dbhtml-dir"/>
</xsl:if>
<xsl:value-of select="$fn"/>
<!-- You can't add the html.ext here because dbhtml filename= may already -->
<!-- have added it. It really does have to be handled in the recursive template -->
</xsl:template>
<xsl:template match="*" mode="recursive-chunk-filename">
<xsl:param name="recursive" select="false()"/>
<!-- returns the filename of a chunk -->
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:variable name="dbhtml-filename">
<xsl:call-template name="pi.dbhtml_filename"/>
</xsl:variable>
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="$dbhtml-filename != ''">
<xsl:value-of select="$dbhtml-filename"/>
</xsl:when>
<!-- if this is the root element, use the root.filename -->
<xsl:when test="not(parent::*) and $root.filename != ''">
<xsl:value-of select="$root.filename"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<!-- Special case -->
<xsl:when test="self::legalnotice and not($generate.legalnotice.link = 0)">
<xsl:choose>
<xsl:when test="(@id or @xml:id) and not($use.id.as.filename = 0)">
<!-- * if this legalnotice has an ID, then go ahead and use -->
<!-- * just the value of that ID as the basename for the file -->
<!-- * (that is, without prepending an "ln-" too it) -->
<xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<xsl:otherwise>
<!-- * otherwise, if this legalnotice does not have an ID, -->
<!-- * then we generate an ID... -->
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<!-- * ...and then we take that generated ID, prepend an -->
<!-- * "ln-" to it, and use that as the basename for the file -->
<xsl:value-of select="concat('ln-',$id,$html.ext)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- if there's no dbhtml filename, and if we're to use IDs as -->
<!-- filenames, then use the ID to generate the filename. -->
<xsl:when test="(@id or @xml:id) and $use.id.as.filename != 0">
<xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$ischunk='0'">
<!-- if called on something that isn't a chunk, walk up... -->
<xsl:choose>
<xsl:when test="count(parent::*)>0">
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="$recursive"/>
</xsl:apply-templates>
</xsl:when>
<!-- unless there is no up, in which case return "" -->
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="not($recursive) and $filename != ''">
<!-- if this chunk has an explicit name, use it -->
<xsl:value-of select="$filename"/>
</xsl:when>
<xsl:when test="self::set">
<xsl:value-of select="$root.filename"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::book">
<xsl:text>bk</xsl:text>
<xsl:number level="any" format="01"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::article">
<xsl:if test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:if>
<xsl:text>ar</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::preface">
<xsl:if test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:if>
<xsl:text>pr</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::chapter">
<xsl:if test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:if>
<xsl:text>ch</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::appendix">
<xsl:if test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:if>
<xsl:text>ap</xsl:text>
<xsl:number level="any" format="a" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::part">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>pt</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::reference">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>rn</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::refentry">
<xsl:choose>
<xsl:when test="parent::reference">
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>re</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::colophon">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>co</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::sect1
or self::sect2
or self::sect3
or self::sect4
or self::sect5
or self::section">
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
<xsl:text>s</xsl:text>
<xsl:number format="01"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::bibliography">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>bi</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::glossary">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>go</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::index">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>ix</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::setindex">
<xsl:text>si</xsl:text>
<xsl:number level="any" format="01" from="set"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>chunk-filename-error-</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:number level="any" format="01" from="set"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="processing-instruction('dbhtml')">
<!-- nop -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="*" mode="find.chunks">
<xsl:variable name="chunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$chunk != 0">
<cf:div id="{generate-id()}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="*" mode="find.chunks"/>
</cf:div>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*" mode="find.chunks"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/">
<!-- * Get a title for current doc so that we let the user -->
<!-- * know what document we are processing at this point. -->
<xsl:variable name="doc.title">
<xsl:call-template name="get.doc.title"/>
</xsl:variable>
<xsl:choose>
<!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
toss the namespace and continue. Use the docbook5 namespaced
stylesheets for DocBook5 if you don't want to use this feature.-->
<xsl:when test="$exsl.node.set.available != 0
and (*/self::ng:* or */self::db:*)">
<xsl:call-template name="log.message">
<xsl:with-param name="level">Note</xsl:with-param>
<xsl:with-param name="source" select="$doc.title"/>
<xsl:with-param name="context-desc">
<xsl:text>namesp. cut</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>stripped namespace before processing</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:variable name="nons">
<xsl:apply-templates mode="stripNS"/>
</xsl:variable>
<xsl:call-template name="log.message">
<xsl:with-param name="level">Note</xsl:with-param>
<xsl:with-param name="source" select="$doc.title"/>
<xsl:with-param name="context-desc">
<xsl:text>namesp. cut</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>processing stripped document</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="exsl:node-set($nons)"/>
</xsl:when>
<!-- Can't process unless namespace removed -->
<xsl:when test="*/self::ng:* or */self::db:*">
<xsl:message terminate="yes">
<xsl:text>Unable to strip the namespace from DB5 document,</xsl:text>
<xsl:text> cannot proceed.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$rootid != ''">
<xsl:choose>
<xsl:when test="count(key('id',$rootid)) = 0">
<xsl:message terminate="yes">
<xsl:text>ID '</xsl:text>
<xsl:value-of select="$rootid"/>
<xsl:text>' not found in document.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="key('id', $rootid)"
mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="key('id',$rootid)"
mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="key('id',$rootid)"
mode="collect.tex.math"/>
</xsl:if>
<xsl:if test="$generate.manifest != 0">
<xsl:call-template name="generate.manifest">
<xsl:with-param name="node" select="key('id',$rootid)"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="/" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="/" mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="/" mode="collect.tex.math"/>
</xsl:if>
<xsl:if test="$generate.manifest != 0">
<xsl:call-template name="generate.manifest">
<xsl:with-param name="node" select="/"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="process.root">
<xsl:apply-templates select="."/>
</xsl:template>
<!-- ====================================================================== -->
<xsl:template match="set|book|part|preface|chapter|appendix
|article
|reference|refentry
|book/glossary|article/glossary|part/glossary
|book/bibliography|article/bibliography|part/bibliography
|colophon">
<xsl:choose>
<xsl:when test="$onechunk != 0 and parent::*">
<xsl:apply-imports/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="process-chunk-element"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="not(parent::*)">
<xsl:call-template name="process-chunk-element"/>
</xsl:when>
<xsl:when test="$ischunk = 0">
<xsl:apply-imports/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="process-chunk-element"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="setindex
|book/index
|article/index
|part/index">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. -->
<xsl:if test="count(*)>0 or $generate.index != '0'">
<xsl:call-template name="process-chunk-element"/>
</xsl:if>
</xsl:template>
<!-- Resolve xml:base attributes -->
<xsl:template match="@fileref">
<!-- need a check for absolute urls -->
<xsl:choose>
<xsl:when test="contains(., ':')">
<!-- it has a uri scheme so it is an absolute uri -->
<xsl:value-of select="."/>
</xsl:when>
<xsl:when test="$keep.relative.image.uris != 0">
<!-- leave it alone -->
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<!-- its a relative uri -->
<xsl:call-template name="relative-uri">
<xsl:with-param name="destdir">
<xsl:call-template name="dbhtml-dir">
<xsl:with-param name="context" select=".."/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="set|book|part|preface|chapter|appendix
|article
|reference|refentry
|sect1|sect2|sect3|sect4|sect5
|section
|book/glossary|article/glossary|part/glossary
|book/bibliography|article/bibliography|part/bibliography
|colophon"
mode="enumerate-files">
<xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
<xsl:if test="$ischunk='1'">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir">
<xsl:if test="$manifest.in.base.dir = 0">
<xsl:value-of select="$base.dir"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="base.name">
<xsl:apply-templates mode="chunk-filename" select="."/>
</xsl:with-param>
</xsl:call-template>
<xsl:text>&#10;</xsl:text>
</xsl:if>
<xsl:apply-templates select="*" mode="enumerate-files"/>
</xsl:template>
<xsl:template match="book/index|article/index|part/index"
mode="enumerate-files">
<xsl:if test="$htmlhelp.output != 1">
<xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
<xsl:if test="$ischunk='1'">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir">
<xsl:if test="$manifest.in.base.dir = 0">
<xsl:value-of select="$base.dir"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="base.name">
<xsl:apply-templates mode="chunk-filename" select="."/>
</xsl:with-param>
</xsl:call-template>
<xsl:text>&#10;</xsl:text>
</xsl:if>
<xsl:apply-templates select="*" mode="enumerate-files"/>
</xsl:if>
</xsl:template>
<xsl:template match="legalnotice" mode="enumerate-files">
<xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
<xsl:if test="$generate.legalnotice.link != 0">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir">
<xsl:if test="$manifest.in.base.dir = 0">
<xsl:value-of select="$base.dir"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="base.name">
<xsl:apply-templates mode="chunk-filename" select="."/>
</xsl:with-param>
</xsl:call-template>
<xsl:text>&#10;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="mediaobject[imageobject] | inlinemediaobject[imageobject]" mode="enumerate-files">
<xsl:variable name="longdesc.uri">
<xsl:call-template name="longdesc.uri">
<xsl:with-param name="mediaobject"
select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="mediaobject" select="."/>
<xsl:if test="$html.longdesc != 0 and $mediaobject/textobject[not(phrase)]">
<xsl:call-template name="longdesc.uri">
<xsl:with-param name="mediaobject" select="$mediaobject"/>
</xsl:call-template>
<xsl:text>&#10;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="text()" mode="enumerate-files">
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
version="1.0"
exclude-result-prefixes="exsl">
<!-- ********************************************************************
$Id: chunk.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- First import the non-chunking templates that format elements
within each chunk file. In a customization, you should
create a separate non-chunking customization layer such
as mydocbook.xsl that imports the original docbook.xsl and
customizes any presentation templates. Then your chunking
customization should import mydocbook.xsl instead of
docbook.xsl. -->
<xsl:import href="docbook.xsl"/>
<!-- chunk-common.xsl contains all the named templates for chunking.
In a customization file, you import chunk-common.xsl, then
add any customized chunking templates of the same name.
They will have import precedence over the original
chunking templates in chunk-common.xsl. -->
<xsl:import href="chunk-common.xsl"/>
<!-- The manifest.xsl module is no longer imported because its
templates were moved into chunk-common and chunk-code -->
<!-- chunk-code.xsl contains all the chunking templates that use
a match attribute. In a customization it should be referenced
using <xsl:include> instead of <xsl:import>, and then add
any customized chunking templates with match attributes. But be sure
to add a priority="1" to such customized templates to resolve
its conflict with the original, since they have the
same import precedence.
Using xsl:include prevents adding another layer
of import precedence, which would cause any
customizations that use xsl:apply-imports to wrongly
apply the chunking version instead of the original
non-chunking version to format an element. -->
<xsl:include href="chunk-code.xsl"/>
</xsl:stylesheet>

View File

@@ -0,0 +1,439 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://icl.com/saxon"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="http://xml.apache.org/xalan/redirect"
xmlns:exsl="http://exslt.org/common"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
version="1.0"
exclude-result-prefixes="doc"
extension-element-prefixes="saxon redirect lxslt exsl">
<!-- ********************************************************************
$Id: chunker.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- This stylesheet works with XSLT implementations that support -->
<!-- exsl:document, saxon:output, or Xalan's redirect:write -->
<!-- Note: Only Saxon 6.4.2 or later is supported. -->
<xsl:param name="chunker.output.method" select="'html'"/>
<xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
<xsl:param name="chunker.output.indent" select="'no'"/>
<xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/>
<xsl:param name="chunker.output.standalone" select="'no'"/>
<xsl:param name="chunker.output.doctype-public" select="''"/>
<xsl:param name="chunker.output.doctype-system" select="''"/>
<xsl:param name="chunker.output.media-type" select="''"/>
<xsl:param name="chunker.output.cdata-section-elements" select="''"/>
<xsl:param name="chunker.output.quiet" select="0"/>
<xsl:param name="saxon.character.representation" select="'entity;decimal'"/>
<!-- ==================================================================== -->
<xsl:template name="make-relative-filename">
<xsl:param name="base.dir" select="'./'"/>
<xsl:param name="base.name" select="''"/>
<xsl:choose>
<!-- put Saxon first to work around a bug in libxslt -->
<xsl:when test="element-available('saxon:output')">
<!-- Saxon doesn't make the chunks relative -->
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:when>
<xsl:when test="element-available('exsl:document')">
<!-- EXSL document does make the chunks relative, I think -->
<xsl:choose>
<xsl:when test="count(parent::*) = 0">
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$base.name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="element-available('redirect:write')">
<!-- Xalan doesn't make the chunks relative -->
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>Don't know how to chunk with </xsl:text>
<xsl:value-of select="system-property('xsl:vendor')"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="write.chunk">
<xsl:param name="filename" select="''"/>
<xsl:param name="quiet" select="$chunker.output.quiet"/>
<xsl:param name="suppress-context-node-name" select="0"/>
<xsl:param name="message-prolog"/>
<xsl:param name="message-epilog"/>
<xsl:param name="method" select="$chunker.output.method"/>
<xsl:param name="encoding" select="$chunker.output.encoding"/>
<xsl:param name="indent" select="$chunker.output.indent"/>
<xsl:param name="omit-xml-declaration"
select="$chunker.output.omit-xml-declaration"/>
<xsl:param name="standalone" select="$chunker.output.standalone"/>
<xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
<xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
<xsl:param name="media-type" select="$chunker.output.media-type"/>
<xsl:param name="cdata-section-elements"
select="$chunker.output.cdata-section-elements"/>
<xsl:param name="content"/>
<xsl:if test="$quiet = 0">
<xsl:message>
<xsl:if test="not($message-prolog = '')">
<xsl:value-of select="$message-prolog"/>
</xsl:if>
<xsl:text>Writing </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:if test="name(.) != '' and $suppress-context-node-name = 0">
<xsl:text> for </xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:if test="@id or @xml:id">
<xsl:text>(</xsl:text>
<xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="not($message-epilog = '')">
<xsl:value-of select="$message-epilog"/>
</xsl:if>
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="element-available('exsl:document')">
<xsl:choose>
<!-- Handle the permutations ... -->
<xsl:when test="$media-type != ''">
<xsl:choose>
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-public="{$doctype-public}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-public="{$doctype-public}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:when>
<xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
<exsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</exsl:document>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="element-available('saxon:output')">
<xsl:choose>
<!-- Handle the permutations ... -->
<xsl:when test="$media-type != ''">
<xsl:choose>
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-public="{$doctype-public}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
media-type="{$media-type}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-public="{$doctype-public}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
doctype-system="{$doctype-system}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:otherwise><!-- $doctype-public = '' and $doctype-system = ''"> -->
<saxon:output saxon:character-representation="{$saxon.character.representation}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
omit-xml-declaration="{$omit-xml-declaration}"
cdata-section-elements="{$cdata-section-elements}"
standalone="{$standalone}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="element-available('redirect:write')">
<!-- Xalan uses redirect -->
<redirect:write file="{$filename}">
<xsl:copy-of select="$content"/>
</redirect:write>
</xsl:when>
<xsl:otherwise>
<!-- it doesn't matter since we won't be making chunks... -->
<xsl:message terminate="yes">
<xsl:text>Can't make chunks with </xsl:text>
<xsl:value-of select="system-property('xsl:vendor')"/>
<xsl:text>'s processor.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="write.chunk.with.doctype">
<xsl:param name="filename" select="''"/>
<xsl:param name="quiet" select="$chunker.output.quiet"/>
<xsl:param name="method" select="$chunker.output.method"/>
<xsl:param name="encoding" select="$chunker.output.encoding"/>
<xsl:param name="indent" select="$chunker.output.indent"/>
<xsl:param name="omit-xml-declaration"
select="$chunker.output.omit-xml-declaration"/>
<xsl:param name="standalone" select="$chunker.output.standalone"/>
<xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
<xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
<xsl:param name="media-type" select="$chunker.output.media-type"/>
<xsl:param name="cdata-section-elements"
select="$chunker.output.cdata-section-elements"/>
<xsl:param name="content"/>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="$filename"/>
<xsl:with-param name="quiet" select="$quiet"/>
<xsl:with-param name="method" select="$method"/>
<xsl:with-param name="encoding" select="$encoding"/>
<xsl:with-param name="indent" select="$indent"/>
<xsl:with-param name="omit-xml-declaration" select="$omit-xml-declaration"/>
<xsl:with-param name="standalone" select="$standalone"/>
<xsl:with-param name="doctype-public" select="$doctype-public"/>
<xsl:with-param name="doctype-system" select="$doctype-system"/>
<xsl:with-param name="media-type" select="$media-type"/>
<xsl:with-param name="cdata-section-elements" select="$cdata-section-elements"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="write.text.chunk">
<xsl:param name="filename" select="''"/>
<xsl:param name="quiet" select="$chunker.output.quiet"/>
<xsl:param name="suppress-context-node-name" select="0"/>
<xsl:param name="message-prolog"/>
<xsl:param name="message-epilog"/>
<xsl:param name="method" select="'text'"/>
<xsl:param name="encoding" select="$chunker.output.encoding"/>
<xsl:param name="media-type" select="$chunker.output.media-type"/>
<xsl:param name="content"/>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="$filename"/>
<xsl:with-param name="quiet" select="$quiet"/>
<xsl:with-param name="suppress-context-node-name" select="$suppress-context-node-name"/>
<xsl:with-param name="message-prolog" select="$message-prolog"/>
<xsl:with-param name="message-epilog" select="$message-epilog"/>
<xsl:with-param name="method" select="$method"/>
<xsl:with-param name="encoding" select="$encoding"/>
<xsl:with-param name="indent" select="'no'"/>
<xsl:with-param name="omit-xml-declaration" select="'no'"/>
<xsl:with-param name="standalone" select="'no'"/>
<xsl:with-param name="doctype-public"/>
<xsl:with-param name="doctype-system"/>
<xsl:with-param name="media-type" select="$media-type"/>
<xsl:with-param name="cdata-section-elements"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,72 @@
<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"
version="1.0"
exclude-result-prefixes="cf exsl">
<!-- ********************************************************************
$Id: chunkfast.xsl 8345 2009-03-16 06:44:07Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:import href="chunk.xsl"/>
<xsl:param name="chunk.fast" select="1"/>
<xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
<!-- ==================================================================== -->
<xsl:template name="process-chunk-element">
<xsl:choose>
<xsl:when test="$chunk.fast != 0 and $exsl.node.set.available != 0">
<xsl:variable name="genid" select="generate-id()"/>
<xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
<xsl:variable name="prevdiv"
select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
<xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
<xsl:variable name="nextdiv"
select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
<xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
<xsl:choose>
<xsl:when test="$onechunk != 0 and parent::*">
<xsl:apply-imports/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="process-chunk">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$onechunk != 0 and not(parent::*)">
<xsl:call-template name="chunk-all-sections"/>
</xsl:when>
<xsl:when test="$onechunk != 0">
<xsl:apply-imports/>
</xsl:when>
<xsl:when test="$chunk.first.sections = 0">
<xsl:call-template name="chunk-first-section-with-parent"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="chunk-all-sections"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,544 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
version="1.0"
exclude-result-prefixes="doc">
<!-- ********************************************************************
$Id: chunktoc.xsl 8399 2009-04-08 07:37:42Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:import href="docbook.xsl"/>
<xsl:import href="chunk-common.xsl"/>
<xsl:template name="chunk">
<xsl:param name="node" select="."/>
<!-- returns 1 if $node is a chunk -->
<xsl:variable name="id">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$node"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="chunks" select="document($chunk.toc,/)"/>
<xsl:choose>
<xsl:when test="$chunks//tocentry[@linkend=$id]">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="*" mode="chunk-filename">
<!-- returns the filename of a chunk -->
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:variable name="chunks" select="document($chunk.toc,/)"/>
<xsl:variable name="chunk" select="$chunks//tocentry[@linkend=$id]"/>
<xsl:variable name="filename">
<xsl:call-template name="pi.dbhtml_filename">
<xsl:with-param name="node" select="$chunk"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$chunk">
<xsl:value-of select="$filename"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="parent::*" mode="chunk-filename"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="process-chunk">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:variable name="chunks" select="document($chunk.toc,/)"/>
<xsl:variable name="chunk" select="$chunks//tocentry[@linkend=$id]"/>
<xsl:variable name="prev-id"
select="($chunk/preceding::tocentry
|$chunk/ancestor::tocentry)[last()]/@linkend"/>
<xsl:variable name="next-id"
select="($chunk/following::tocentry
|$chunk/child::tocentry)[1]/@linkend"/>
<xsl:variable name="prev" select="key('id',$prev-id)"/>
<xsl:variable name="next" select="key('id',$next-id)"/>
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:variable name="chunkfn">
<xsl:if test="$ischunk='1'">
<xsl:apply-templates mode="chunk-filename" select="."/>
</xsl:if>
</xsl:variable>
<xsl:variable name="filename">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir" select="$base.dir"/>
<xsl:with-param name="base.name" select="$chunkfn"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$ischunk = 0">
<xsl:apply-imports/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="$filename"/>
<xsl:with-param name="content">
<xsl:call-template name="chunk-element-content">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="quiet" select="$chunk.quietly"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="set">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="book">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="book/appendix">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="book/glossary">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="book/bibliography">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="dedication" mode="dedication">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="preface|chapter">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="part|reference">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="refentry">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="colophon">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="article">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="article/appendix">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="article/glossary">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="article/bibliography">
<xsl:call-template name="process-chunk"/>
</xsl:template>
<xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$ischunk != 0">
<xsl:call-template name="process-chunk"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-imports/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="setindex
|book/index
|article/index">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. -->
<xsl:if test="count(*)>0 or $generate.index != '0'">
<xsl:call-template name="process-chunk"/>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="/">
<!-- * Get a title for current doc so that we let the user -->
<!-- * know what document we are processing at this point. -->
<xsl:variable name="doc.title">
<xsl:call-template name="get.doc.title"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$chunk.toc = ''">
<xsl:message terminate="yes">
<xsl:text>The chunk.toc file is not set.</xsl:text>
</xsl:message>
</xsl:when>
<!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
toss the namespace and continue. Use the docbook5 namespaced
stylesheets for DocBook5 if you don't want to use this feature.-->
<!-- include extra test for Xalan quirk -->
<xsl:when test="$exsl.node.set.available != 0
and (*/self::ng:* or */self::db:*)">
<xsl:call-template name="log.message">
<xsl:with-param name="level">Note</xsl:with-param>
<xsl:with-param name="source" select="$doc.title"/>
<xsl:with-param name="context-desc">
<xsl:text>namesp. cut</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>stripped namespace before processing</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:variable name="nons">
<xsl:apply-templates mode="stripNS"/>
</xsl:variable>
<xsl:call-template name="log.message">
<xsl:with-param name="level">Note</xsl:with-param>
<xsl:with-param name="source" select="$doc.title"/>
<xsl:with-param name="context-desc">
<xsl:text>namesp. cut</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>processing stripped document</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="exsl:node-set($nons)"/>
</xsl:when>
<!-- Can't process unless namespace removed -->
<xsl:when test="*/self::ng:* or */self::db:*">
<xsl:message terminate="yes">
<xsl:text>Unable to strip the namespace from DB5 document,</xsl:text>
<xsl:text> cannot proceed.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$rootid != ''">
<xsl:choose>
<xsl:when test="count(key('id',$rootid)) = 0">
<xsl:message terminate="yes">
<xsl:text>ID '</xsl:text>
<xsl:value-of select="$rootid"/>
<xsl:text>' not found in document.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="key('id', $rootid)"
mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="key('id',$rootid)"
mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="key('id',$rootid)"
mode="collect.tex.math"/>
</xsl:if>
<xsl:if test="$generate.manifest != 0">
<xsl:call-template name="generate.manifest">
<xsl:with-param name="node" select="key('id',$rootid)"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="/" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="/" mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="/" mode="collect.tex.math"/>
</xsl:if>
<xsl:if test="$generate.manifest != 0">
<xsl:call-template name="generate.manifest">
<xsl:with-param name="node" select="/"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="process.root">
<xsl:apply-templates select="."/>
</xsl:template>
<xsl:template name="make.lots">
<xsl:param name="toc.params" select="''"/>
<xsl:param name="toc"/>
<xsl:variable name="lots">
<xsl:if test="contains($toc.params, 'toc')">
<xsl:copy-of select="$toc"/>
</xsl:if>
<xsl:if test="contains($toc.params, 'figure')">
<xsl:choose>
<xsl:when test="$chunk.separate.lots != '0'">
<xsl:call-template name="make.lot.chunk">
<xsl:with-param name="type" select="'figure'"/>
<xsl:with-param name="lot">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'figure'"/>
<xsl:with-param name="nodes" select=".//figure"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'figure'"/>
<xsl:with-param name="nodes" select=".//figure"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="contains($toc.params, 'table')">
<xsl:choose>
<xsl:when test="$chunk.separate.lots != '0'">
<xsl:call-template name="make.lot.chunk">
<xsl:with-param name="type" select="'table'"/>
<xsl:with-param name="lot">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'table'"/>
<xsl:with-param name="nodes" select=".//table"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'table'"/>
<xsl:with-param name="nodes" select=".//table"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="contains($toc.params, 'example')">
<xsl:choose>
<xsl:when test="$chunk.separate.lots != '0'">
<xsl:call-template name="make.lot.chunk">
<xsl:with-param name="type" select="'example'"/>
<xsl:with-param name="lot">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'example'"/>
<xsl:with-param name="nodes" select=".//example"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'example'"/>
<xsl:with-param name="nodes" select=".//example"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="contains($toc.params, 'equation')">
<xsl:choose>
<xsl:when test="$chunk.separate.lots != '0'">
<xsl:call-template name="make.lot.chunk">
<xsl:with-param name="type" select="'equation'"/>
<xsl:with-param name="lot">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'equation'"/>
<xsl:with-param name="nodes" select=".//equation"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'equation'"/>
<xsl:with-param name="nodes" select=".//equation"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="contains($toc.params, 'procedure')">
<xsl:choose>
<xsl:when test="$chunk.separate.lots != '0'">
<xsl:call-template name="make.lot.chunk">
<xsl:with-param name="type" select="'procedure'"/>
<xsl:with-param name="lot">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'procedure'"/>
<xsl:with-param name="nodes" select=".//procedure[title]"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'procedure'"/>
<xsl:with-param name="nodes" select=".//procedure[title]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:if test="string($lots) != ''">
<xsl:choose>
<xsl:when test="$chunk.tocs.and.lots != 0 and not(parent::*)">
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir" select="$base.dir"/>
<xsl:with-param name="base.name">
<xsl:call-template name="dbhtml-dir"/>
<xsl:apply-templates select="." mode="recursive-chunk-filename">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
<xsl:text>-toc</xsl:text>
<xsl:value-of select="$html.ext"/>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="content">
<xsl:call-template name="chunk-element-content">
<xsl:with-param name="prev" select="/foo"/>
<xsl:with-param name="next" select="/foo"/>
<xsl:with-param name="nav.context" select="'toc'"/>
<xsl:with-param name="content">
<h1>
<xsl:apply-templates select="." mode="object.title.markup"/>
</h1>
<xsl:copy-of select="$lots"/>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="quiet" select="$chunk.quietly"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$lots"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="make.lot.chunk">
<xsl:param name="type" select="''"/>
<xsl:param name="lot"/>
<xsl:if test="string($lot) != ''">
<xsl:variable name="filename">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir" select="$base.dir"/>
<xsl:with-param name="base.name">
<xsl:call-template name="dbhtml-dir"/>
<xsl:value-of select="$type"/>
<xsl:text>-toc</xsl:text>
<xsl:value-of select="$html.ext"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.name">
<xsl:call-template name="dbhtml-dir"/>
<xsl:value-of select="$type"/>
<xsl:text>-toc</xsl:text>
<xsl:value-of select="$html.ext"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="$filename"/>
<xsl:with-param name="content">
<xsl:call-template name="chunk-element-content">
<xsl:with-param name="prev" select="/foo"/>
<xsl:with-param name="next" select="/foo"/>
<xsl:with-param name="nav.context" select="'toc'"/>
<xsl:with-param name="content">
<xsl:copy-of select="$lot"/>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="quiet" select="$chunk.quietly"/>
</xsl:call-template>
<!-- And output a link to this file -->
<div>
<xsl:attribute name="class">
<xsl:text>ListofTitles</xsl:text>
</xsl:attribute>
<a href="{$href}">
<xsl:call-template name="gentext">
<xsl:with-param name="key">
<xsl:choose>
<xsl:when test="$type='table'">ListofTables</xsl:when>
<xsl:when test="$type='figure'">ListofFigures</xsl:when>
<xsl:when test="$type='equation'">ListofEquations</xsl:when>
<xsl:when test="$type='example'">ListofExamples</xsl:when>
<xsl:when test="$type='procedure'">ListofProcedures</xsl:when>
<xsl:otherwise>ListofUnknown</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</a>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,425 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: component.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template name="component.title">
<xsl:param name="node" select="."/>
<xsl:variable name="level">
<xsl:choose>
<xsl:when test="ancestor::section">
<xsl:value-of select="count(ancestor::section)+1"/>
</xsl:when>
<xsl:when test="ancestor::sect5">6</xsl:when>
<xsl:when test="ancestor::sect4">5</xsl:when>
<xsl:when test="ancestor::sect3">4</xsl:when>
<xsl:when test="ancestor::sect2">3</xsl:when>
<xsl:when test="ancestor::sect1">2</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Let's handle the case where a component (bibliography, for example)
occurs inside a section; will we need parameters for this? -->
<xsl:element name="h{$level+1}">
<xsl:attribute name="class">title</xsl:attribute>
<xsl:if test="$generate.id.attributes = 0">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:apply-templates select="$node" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</xsl:element>
</xsl:template>
<xsl:template name="component.subtitle">
<xsl:param name="node" select="."/>
<xsl:variable name="subtitle"
select="($node/docinfo/subtitle
|$node/info/subtitle
|$node/prefaceinfo/subtitle
|$node/chapterinfo/subtitle
|$node/appendixinfo/subtitle
|$node/articleinfo/subtitle
|$node/artheader/subtitle
|$node/subtitle)[1]"/>
<xsl:if test="$subtitle">
<h3 class="subtitle">
<i>
<xsl:apply-templates select="$node" mode="object.subtitle.markup"/>
</i>
</h3>
</xsl:if>
</xsl:template>
<xsl:template name="component.separator">
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="dedication" mode="dedication">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="dedication.titlepage"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="dedication/title|dedication/info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::dedication[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dedication/subtitle|dedication/info/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::dedication[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dedication"></xsl:template> <!-- see mode="dedication" -->
<xsl:template match="dedication/title"></xsl:template>
<xsl:template match="dedication/subtitle"></xsl:template>
<xsl:template match="dedication/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="acknowledgements" mode="acknowledgements">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="acknowledgements.titlepage"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="acknowledgements/title|acknowledgements/info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="acknowledgements/subtitle|acknowledgements/info/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="acknowledgements"></xsl:template> <!-- see mode="acknowledgements" -->
<xsl:template match="acknowledgements/title"></xsl:template>
<xsl:template match="acknowledgements/subtitle"></xsl:template>
<xsl:template match="acknowledgements/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="colophon">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="component.separator"/>
<xsl:call-template name="component.title"/>
<xsl:call-template name="component.subtitle"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="colophon/title"></xsl:template>
<xsl:template match="colophon/subtitle"></xsl:template>
<xsl:template match="colophon/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="preface">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="component.separator"/>
<xsl:call-template name="preface.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="component.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="preface/title" mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::preface[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="preface/subtitle
|preface/prefaceinfo/subtitle
|preface/info/subtitle
|preface/docinfo/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::preface[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="preface/docinfo|prefaceinfo"></xsl:template>
<xsl:template match="preface/info"></xsl:template>
<xsl:template match="preface/title"></xsl:template>
<xsl:template match="preface/titleabbrev"></xsl:template>
<xsl:template match="preface/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="chapter">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="component.separator"/>
<xsl:call-template name="chapter.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="component.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="chapter/title|chapter/chapterinfo/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::chapter[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="chapter/subtitle
|chapter/chapterinfo/subtitle
|chapter/info/subtitle
|chapter/docinfo/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::chapter[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="chapter/docinfo|chapterinfo"></xsl:template>
<xsl:template match="chapter/info"></xsl:template>
<xsl:template match="chapter/title"></xsl:template>
<xsl:template match="chapter/titleabbrev"></xsl:template>
<xsl:template match="chapter/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="appendix">
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="parent::article and $ischunk = 0">
<xsl:call-template name="section.heading">
<xsl:with-param name="level" select="1"/>
<xsl:with-param name="title">
<xsl:apply-templates select="." mode="object.title.markup"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="component.separator"/>
<xsl:call-template name="appendix.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="component.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:if test="not(parent::article) or $ischunk != 0">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="appendix/title|appendix/appendixinfo/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::appendix[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="appendix/subtitle
|appendix/appendixinfo/subtitle
|appendix/info/subtitle
|appendix/docinfo/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::appendix[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="appendix/docinfo|appendixinfo"></xsl:template>
<xsl:template match="appendix/info"></xsl:template>
<xsl:template match="appendix/title"></xsl:template>
<xsl:template match="appendix/titleabbrev"></xsl:template>
<xsl:template match="appendix/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="article">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="article.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="make.lots">
<xsl:with-param name="toc.params" select="$toc.params"/>
<xsl:with-param name="toc">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="article/title|article/articleinfo/title" mode="titlepage.mode" priority="2">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor::article[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="article/subtitle
|article/articleinfo/subtitle
|article/info/subtitle
|article/artheader/subtitle"
mode="titlepage.mode" priority="2">
<xsl:call-template name="component.subtitle">
<xsl:with-param name="node" select="ancestor::article[1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="article/artheader|article/articleinfo"></xsl:template>
<xsl:template match="article/info"></xsl:template>
<xsl:template match="article/title"></xsl:template>
<xsl:template match="article/titleabbrev"></xsl:template>
<xsl:template match="article/subtitle"></xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,217 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: division.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="set">
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="language.attribute"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="set.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="make.lots">
<xsl:with-param name="toc.params" select="$toc.params"/>
<xsl:with-param name="toc">
<xsl:call-template name="set.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="set/setinfo"></xsl:template>
<xsl:template match="set/title"></xsl:template>
<xsl:template match="set/titleabbrev"></xsl:template>
<xsl:template match="set/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="book">
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="book.titlepage"/>
<xsl:apply-templates select="dedication" mode="dedication"/>
<xsl:apply-templates select="acknowledgements" mode="acknowledgements"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="make.lots">
<xsl:with-param name="toc.params" select="$toc.params"/>
<xsl:with-param name="toc">
<xsl:call-template name="division.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="book/bookinfo"></xsl:template>
<xsl:template match="book/info"></xsl:template>
<xsl:template match="book/title"></xsl:template>
<xsl:template match="book/titleabbrev"></xsl:template>
<xsl:template match="book/subtitle"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="part">
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="part.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not(partintro) and contains($toc.params, 'toc')">
<xsl:call-template name="division.toc"/>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="part" mode="make.part.toc">
<xsl:call-template name="division.toc"/>
</xsl:template>
<xsl:template match="reference" mode="make.part.toc">
<xsl:call-template name="division.toc"/>
</xsl:template>
<xsl:template match="part/docinfo"></xsl:template>
<xsl:template match="part/partinfo"></xsl:template>
<xsl:template match="part/info"></xsl:template>
<xsl:template match="part/title"></xsl:template>
<xsl:template match="part/titleabbrev"></xsl:template>
<xsl:template match="part/subtitle"></xsl:template>
<xsl:template match="partintro">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="partintro.titlepage"/>
<xsl:apply-templates/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="parent::*"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')">
<!-- not ancestor::part because partintro appears in reference -->
<xsl:apply-templates select="parent::*" mode="make.part.toc"/>
</xsl:if>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="partintro/title"></xsl:template>
<xsl:template match="partintro/titleabbrev"></xsl:template>
<xsl:template match="partintro/subtitle"></xsl:template>
<xsl:template match="partintro/title" mode="partintro.title.mode">
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="partintro/subtitle" mode="partintro.title.mode">
<h3>
<i><xsl:apply-templates/></i>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="book" mode="division.number">
<xsl:number from="set" count="book" format="1."/>
</xsl:template>
<xsl:template match="part" mode="division.number">
<xsl:number from="book" count="part" format="I."/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="division.title">
<xsl:param name="node" select="."/>
<h1>
<xsl:attribute name="class">title</xsl:attribute>
<xsl:if test="$generate.id.attributes = 0">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:apply-templates select="$node" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</h1>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,481 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ng="http://docbook.org/docbook-ng"
xmlns:db="http://docbook.org/ns/docbook"
xmlns:exsl="http://exslt.org/common"
xmlns:exslt="http://exslt.org/common"
exclude-result-prefixes="db ng exsl exslt"
version='1.0'>
<xsl:output method="html"
encoding="ISO-8859-1"
indent="no"/>
<!-- ********************************************************************
$Id: docbook.xsl 8399 2009-04-08 07:37:42Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:include href="../VERSION"/>
<xsl:include href="param.xsl"/>
<xsl:include href="../lib/lib.xsl"/>
<xsl:include href="../common/l10n.xsl"/>
<xsl:include href="../common/common.xsl"/>
<xsl:include href="../common/utility.xsl"/>
<xsl:include href="../common/labels.xsl"/>
<xsl:include href="../common/titles.xsl"/>
<xsl:include href="../common/subtitles.xsl"/>
<xsl:include href="../common/gentext.xsl"/>
<xsl:include href="../common/targets.xsl"/>
<xsl:include href="../common/olink.xsl"/>
<xsl:include href="../common/pi.xsl"/>
<xsl:include href="autotoc.xsl"/>
<xsl:include href="autoidx.xsl"/>
<xsl:include href="lists.xsl"/>
<xsl:include href="callout.xsl"/>
<xsl:include href="verbatim.xsl"/>
<xsl:include href="graphics.xsl"/>
<xsl:include href="xref.xsl"/>
<xsl:include href="formal.xsl"/>
<xsl:include href="table.xsl"/>
<xsl:include href="htmltbl.xsl"/>
<xsl:include href="sections.xsl"/>
<xsl:include href="inline.xsl"/>
<xsl:include href="footnote.xsl"/>
<xsl:include href="html.xsl"/>
<xsl:include href="info.xsl"/>
<xsl:include href="keywords.xsl"/>
<xsl:include href="division.xsl"/>
<xsl:include href="toc.xsl"/>
<xsl:include href="index.xsl"/>
<xsl:include href="refentry.xsl"/>
<xsl:include href="math.xsl"/>
<xsl:include href="admon.xsl"/>
<xsl:include href="component.xsl"/>
<xsl:include href="biblio.xsl"/>
<xsl:include href="biblio-iso690.xsl"/>
<xsl:include href="glossary.xsl"/>
<xsl:include href="block.xsl"/>
<xsl:include href="task.xsl"/>
<xsl:include href="qandaset.xsl"/>
<xsl:include href="synop.xsl"/>
<xsl:include href="titlepage.xsl"/>
<xsl:include href="titlepage.templates.xsl"/>
<xsl:include href="pi.xsl"/>
<xsl:include href="ebnf.xsl"/>
<xsl:include href="chunker.xsl"/>
<xsl:include href="html-rtf.xsl"/>
<xsl:include href="annotations.xsl"/>
<xsl:include href="../common/stripns.xsl"/>
<xsl:param name="stylesheet.result.type" select="'html'"/>
<xsl:param name="htmlhelp.output" select="0"/>
<!-- ==================================================================== -->
<xsl:key name="id" match="*" use="@id|@xml:id"/>
<xsl:key name="gid" match="*" use="generate-id()"/>
<!-- ==================================================================== -->
<xsl:template match="*">
<xsl:message>
<xsl:text>Element </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> in namespace '</xsl:text>
<xsl:value-of select="namespace-uri(.)"/>
<xsl:text>' encountered</xsl:text>
<xsl:if test="parent::*">
<xsl:text> in </xsl:text>
<xsl:value-of select="name(parent::*)"/>
</xsl:if>
<xsl:text>, but no template matches.</xsl:text>
</xsl:message>
<span style="color: red">
<xsl:text>&lt;</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>&gt;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&lt;/</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>&gt;</xsl:text>
</span>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template name="body.attributes">
<xsl:attribute name="bgcolor">white</xsl:attribute>
<xsl:attribute name="text">black</xsl:attribute>
<xsl:attribute name="link">#0000FF</xsl:attribute>
<xsl:attribute name="vlink">#840084</xsl:attribute>
<xsl:attribute name="alink">#0000FF</xsl:attribute>
<xsl:if test="starts-with($writing.mode, 'rl')">
<xsl:attribute name="dir">rtl</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="head.content">
<xsl:param name="node" select="."/>
<xsl:param name="title">
<xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
</xsl:param>
<title>
<xsl:copy-of select="$title"/>
</title>
<xsl:if test="$html.stylesheet != ''">
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$link.mailto.url != ''">
<link rev="made"
href="{$link.mailto.url}"/>
</xsl:if>
<xsl:if test="$html.base != ''">
<base href="{$html.base}"/>
</xsl:if>
<meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
<xsl:if test="$generate.meta.abstract != 0">
<xsl:variable name="info" select="(articleinfo
|bookinfo
|prefaceinfo
|chapterinfo
|appendixinfo
|sectioninfo
|sect1info
|sect2info
|sect3info
|sect4info
|sect5info
|referenceinfo
|refentryinfo
|partinfo
|info
|docinfo)[1]"/>
<xsl:if test="$info and $info/abstract">
<meta name="description">
<xsl:attribute name="content">
<xsl:for-each select="$info/abstract[1]/*">
<xsl:value-of select="normalize-space(.)"/>
<xsl:if test="position() &lt; last()">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:attribute>
</meta>
</xsl:if>
</xsl:if>
<xsl:if test="($draft.mode = 'yes' or
($draft.mode = 'maybe' and
ancestor-or-self::*[@status][1]/@status = 'draft'))
and $draft.watermark.image != ''">
<style type="text/css"><xsl:text>
body { background-image: url('</xsl:text>
<xsl:value-of select="$draft.watermark.image"/><xsl:text>');
background-repeat: no-repeat;
background-position: top left;
/* The following properties make the watermark "fixed" on the page. */
/* I think that's just a bit too distracting for the reader... */
/* background-attachment: fixed; */
/* background-position: center center; */
}</xsl:text>
</style>
</xsl:if>
<xsl:apply-templates select="." mode="head.keywords.content"/>
</xsl:template>
<xsl:template name="output.html.stylesheets">
<xsl:param name="stylesheets" select="''"/>
<xsl:choose>
<xsl:when test="contains($stylesheets, ' ')">
<link rel="stylesheet" href="{substring-before($stylesheets, ' ')}">
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$stylesheets != ''">
<link rel="stylesheet" href="{$stylesheets}">
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="head.keywords.content">
<xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="setinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="artheader/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect1info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect2info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect3info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect4info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect5info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sectioninfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
<xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="info/keywordset" mode="html.header"/>
<xsl:if test="$inherit.keywords != 0
and parent::*">
<xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
</xsl:if>
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="system.head.content">
<xsl:param name="node" select="."/>
<!-- FIXME: When chunking, only the annotations actually used
in this chunk should be referenced. I don't think it
does any harm to reference them all, but it adds
unnecessary bloat to each chunk. -->
<xsl:if test="$annotation.support != 0 and //annotation">
<xsl:call-template name="add.annotation.links"/>
<script type="text/javascript">
<xsl:text>&#10;// Create PopupWindow objects</xsl:text>
<xsl:for-each select="//annotation">
<xsl:text>&#10;var popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text> = new PopupWindow("popup-</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>");&#10;</xsl:text>
<xsl:text>popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>.offsetY = 15;&#10;</xsl:text>
<xsl:text>popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>.autoHide();&#10;</xsl:text>
</xsl:for-each>
</script>
<style type="text/css">
<xsl:value-of select="$annotation.css"/>
</style>
</xsl:if>
<!-- system.head.content is like user.head.content, except that
it is called before head.content. This is important because it
means, for example, that <style> elements output by system.head.content
have a lower CSS precedence than the users stylesheet. -->
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="user.preroot">
<!-- Pre-root output, can be used to output comments and PIs. -->
<!-- This must not output any element content! -->
</xsl:template>
<xsl:template name="user.head.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.header.navigation">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.header.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.footer.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.footer.navigation">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template match="/">
<!-- * Get a title for current doc so that we let the user -->
<!-- * know what document we are processing at this point. -->
<xsl:variable name="doc.title">
<xsl:call-template name="get.doc.title"/>
</xsl:variable>
<xsl:choose>
<!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
toss the namespace and continue. Use the docbook5 namespaced
stylesheets for DocBook5 if you don't want to use this feature.-->
<!-- include extra test for Xalan quirk -->
<xsl:when test="$exsl.node.set.available != 0
and (*/self::ng:* or */self::db:*)">
<xsl:call-template name="log.message">
<xsl:with-param name="level">Note</xsl:with-param>
<xsl:with-param name="source" select="$doc.title"/>
<xsl:with-param name="context-desc">
<xsl:text>namesp. cut</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>stripped namespace before processing</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:variable name="nons">
<xsl:apply-templates mode="stripNS"/>
</xsl:variable>
<!--
<xsl:message>Saving stripped document.</xsl:message>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="'/tmp/stripped.xml'"/>
<xsl:with-param name="method" select="'xml'"/>
<xsl:with-param name="content">
<xsl:copy-of select="exsl:node-set($nons)"/>
</xsl:with-param>
</xsl:call-template>
-->
<xsl:call-template name="log.message">
<xsl:with-param name="level">Note</xsl:with-param>
<xsl:with-param name="source" select="$doc.title"/>
<xsl:with-param name="context-desc">
<xsl:text>namesp. cut</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>processing stripped document</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="exsl:node-set($nons)"/>
</xsl:when>
<!-- Can't process unless namespace removed -->
<xsl:when test="*/self::ng:* or */self::db:*">
<xsl:message terminate="yes">
<xsl:text>Unable to strip the namespace from DB5 document,</xsl:text>
<xsl:text> cannot proceed.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$rootid != ''">
<xsl:choose>
<xsl:when test="count(key('id',$rootid)) = 0">
<xsl:message terminate="yes">
<xsl:text>ID '</xsl:text>
<xsl:value-of select="$rootid"/>
<xsl:text>' not found in document.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="key('id', $rootid)"
mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="key('id',$rootid)"
mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="key('id',$rootid)"
mode="collect.tex.math"/>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="/" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="/" mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="/" mode="collect.tex.math"/>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="process.root">
<xsl:variable name="doc" select="self::*"/>
<xsl:call-template name="user.preroot"/>
<xsl:call-template name="root.messages"/>
<html>
<head>
<xsl:call-template name="system.head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:call-template name="head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:call-template name="user.head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
</head>
<body>
<xsl:call-template name="body.attributes"/>
<xsl:call-template name="user.header.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:apply-templates select="."/>
<xsl:call-template name="user.footer.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
</body>
</html>
<xsl:value-of select="$html.append"/>
</xsl:template>
<xsl:template name="root.messages">
<!-- redefine this any way you'd like to output messages -->
<!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="chunk">
<xsl:param name="node" select="."/>
<!-- The default is that we are not chunking... -->
<xsl:text>0</xsl:text>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,329 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
exclude-result-prefixes="doc"
version='1.0'>
<!-- ********************************************************************
$Id: ebnf.xsl 8178 2008-12-15 22:26:38Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<doc:reference xmlns="">
<referenceinfo>
<releaseinfo role="meta">
$Id: ebnf.xsl 8178 2008-12-15 22:26:38Z bobstayton $
</releaseinfo>
<author><surname>Walsh</surname>
<firstname>Norman</firstname></author>
<copyright><year>1999</year><year>2000</year>
<holder>Norman Walsh</holder>
</copyright>
</referenceinfo>
<title>HTML EBNF Reference</title>
<partintro>
<section><title>Introduction</title>
<para>This is technical reference documentation for the DocBook XSL
Stylesheets; it documents (some of) the parameters, templates, and
other elements of the stylesheets.</para>
<para>This reference describes the templates and parameters relevant
to formatting EBNF markup.</para>
<para>This is not intended to be <quote>user</quote> documentation.
It is provided for developers writing customization layers for the
stylesheets, and for anyone who's interested in <quote>how it
works</quote>.</para>
<para>Although I am trying to be thorough, this documentation is known
to be incomplete. Don't forget to read the source, too :-)</para>
</section>
</partintro>
</doc:reference>
<!-- ==================================================================== -->
<xsl:template match="productionset">
<table width="100%" cellpadding="5">
<xsl:if test="$ebnf.table.bgcolor != ''">
<xsl:attribute name="bgcolor">
<xsl:value-of select="$ebnf.table.bgcolor"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$ebnf.table.border != 0">
<xsl:attribute name="border">1</xsl:attribute>
</xsl:if>
<xsl:attribute name="class">
<xsl:value-of select="local-name(.)"/>
</xsl:attribute>
<xsl:attribute name="summary">
<xsl:text>EBNF</xsl:text>
<xsl:if test="title">
<xsl:text> for </xsl:text>
<xsl:value-of select="title"/>
</xsl:if>
</xsl:attribute>
<xsl:if test="title">
<tr>
<th align="{$direction.align.start}" valign="top">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="title"/>
</th>
</tr>
</xsl:if>
<tr>
<td>
<table border="0" width="99%" cellpadding="0">
<xsl:if test="$ebnf.table.bgcolor != ''">
<xsl:attribute name="bgcolor">
<xsl:value-of select="$ebnf.table.bgcolor"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="class">
<xsl:value-of select="local-name(.)"/>
</xsl:attribute>
<xsl:attribute name="summary">EBNF productions</xsl:attribute>
<xsl:apply-templates select="production|productionrecap"/>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="productionset/title">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="production">
<xsl:param name="recap" select="false()"/>
<tr>
<td align="{$direction.align.start}" valign="top" width="3%">
<xsl:text>[</xsl:text>
<xsl:number count="production" level="any"/>
<xsl:text>]</xsl:text>
</td>
<td align="{$direction.align.end}" valign="top" width="10%">
<xsl:choose>
<xsl:when test="$recap">
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="lhs"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="lhs"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td valign="top" width="5%" align="center">
<xsl:copy-of select="$ebnf.assignment"/>
</td>
<td valign="top" width="52%">
<xsl:apply-templates select="rhs"/>
<xsl:copy-of select="$ebnf.statement.terminator"/>
</td>
<td align="{$direction.align.start}" valign="top" width="30%">
<xsl:choose>
<xsl:when test="rhs/lineannotation|constraint">
<xsl:apply-templates select="rhs/lineannotation" mode="rhslo"/>
<xsl:apply-templates select="constraint"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>&#160;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template match="productionrecap">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:if test="count($targets)=0">
<xsl:message>
<xsl:text>Error: no ID for productionrecap linkend: </xsl:text>
<xsl:value-of select="@linkend"/>
<xsl:text>.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="count($targets)>1">
<xsl:message>
<xsl:text>Warning: multiple "IDs" for productionrecap linkend: </xsl:text>
<xsl:value-of select="@linkend"/>
<xsl:text>.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:apply-templates select="$target">
<xsl:with-param name="recap" select="true()"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="lhs">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="rhs">
<xsl:apply-templates/>
<xsl:if test="following-sibling::rhs">
<xsl:text> |</xsl:text>
<br/>
</xsl:if>
</xsl:template>
<xsl:template match="nonterminal">
<xsl:variable name="linkend">
<xsl:call-template name="xpointer.idref">
<xsl:with-param name="xpointer" select="@def"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="$linkend"/>
</xsl:call-template>
<xsl:call-template name="check.idref.targets">
<xsl:with-param name="linkend" select="$linkend"/>
<xsl:with-param name="element-list">production</xsl:with-param>
</xsl:call-template>
<!-- If you don't provide content, you can't point outside this doc. -->
<xsl:choose>
<xsl:when test="*|text()"><!--nop--></xsl:when>
<xsl:otherwise>
<xsl:if test="$linkend = ''">
<xsl:message>
<xsl:text>Non-terminals with no content must point to </xsl:text>
<xsl:text>production elements in the current document.</xsl:text>
</xsl:message>
<xsl:message>
<xsl:text>Invalid xpointer for empty nt: </xsl:text>
<xsl:value-of select="@def"/>
</xsl:message>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="href">
<xsl:choose>
<xsl:when test="$linkend != ''">
<xsl:variable name="targets" select="key('id',$linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@def"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="{$href}">
<xsl:choose>
<xsl:when test="*|text()">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$linkend != ''">
<xsl:variable name="targets" select="key('id',$linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:apply-templates select="$target/lhs"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>???</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
<xsl:template match="rhs/lineannotation">
<!--nop-->
</xsl:template>
<xsl:template match="rhs/lineannotation" mode="rhslo">
<xsl:text>/*&#160;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&#160;*/</xsl:text>
<br/>
</xsl:template>
<xsl:template match="constraint">
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:call-template>
<xsl:call-template name="check.idref.targets">
<xsl:with-param name="linkend" select="@linkend"/>
<xsl:with-param name="element-list">constraintdef</xsl:with-param>
</xsl:call-template>
<xsl:variable name="href">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:variable>
<xsl:text>[&#160;</xsl:text>
<xsl:choose>
<xsl:when test="@role">
<xsl:value-of select="@role"/>
<xsl:text>: </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:if test="$target/@role">
<xsl:value-of select="$target/@role"/>
<xsl:text>: </xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<a href="{$href}">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:apply-templates select="$target" mode="title.markup"/>
</a>
<xsl:text>&#160;]</xsl:text>
<xsl:if test="following-sibling::constraint">
<br/>
</xsl:if>
</xsl:template>
<xsl:template match="constraintdef">
<div>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="constraintdef/title">
<p><b><xsl:apply-templates/></b></p>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,310 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="exsl"
version='1.0'>
<!-- ********************************************************************
$Id: footnote.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:template match="footnote">
<xsl:variable name="name">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:variable name="href">
<xsl:text>#ftn.</xsl:text>
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="ancestor::tgroup">
<sup>
<xsl:text>[</xsl:text>
<a name="{$name}" href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="." mode="footnote.number"/>
</a>
<xsl:text>]</xsl:text>
</sup>
</xsl:when>
<xsl:otherwise>
<sup>
<xsl:text>[</xsl:text>
<a name="{$name}" href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="." mode="footnote.number"/>
</a>
<xsl:text>]</xsl:text>
</sup>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="footnoteref">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="footnote" select="$targets[1]"/>
<xsl:if test="not(local-name($footnote) = 'footnote')">
<xsl:message terminate="yes">
ERROR: A footnoteref element has a linkend that points to an element that is not a footnote.
Typically this happens when an id attribute is accidentally applied to the child of a footnote element.
target element: <xsl:value-of select="local-name($footnote)"/>
linkend/id: <xsl:value-of select="@linkend"/>
</xsl:message>
</xsl:if>
<xsl:variable name="target.href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$footnote"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href">
<xsl:value-of select="substring-before($target.href, '#')"/>
<xsl:text>#ftn.</xsl:text>
<xsl:value-of select="substring-after($target.href, '#')"/>
</xsl:variable>
<sup>
<xsl:text>[</xsl:text>
<a href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="$footnote" mode="footnote.number"/>
</a>
<xsl:text>]</xsl:text>
</sup>
</xsl:template>
<xsl:template match="footnote" mode="footnote.number">
<xsl:choose>
<xsl:when test="string-length(@label) != 0">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="ancestor::tgroup">
<xsl:variable name="tfnum">
<xsl:number level="any" from="table|informaltable" format="1"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($table.footnote.number.symbols) &gt;= $tfnum">
<xsl:value-of select="substring($table.footnote.number.symbols, $tfnum, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:number level="any" from="tgroup"
format="{$table.footnote.number.format}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="pfoot" select="preceding::footnote[not(@label)]"/>
<xsl:variable name="ptfoot" select="preceding::tgroup//footnote"/>
<xsl:variable name="fnum" select="count($pfoot) - count($ptfoot) + 1"/>
<xsl:choose>
<xsl:when test="string-length($footnote.number.symbols) &gt;= $fnum">
<xsl:value-of select="substring($footnote.number.symbols, $fnum, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:number value="$fnum" format="{$footnote.number.format}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="footnote/para[1]|footnote/simpara[1]" priority="2">
<!-- this only works if the first thing in a footnote is a para, -->
<!-- which is ok, because it usually is. -->
<xsl:variable name="name">
<xsl:text>ftn.</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="ancestor::footnote"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href">
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="ancestor::footnote"/>
</xsl:call-template>
</xsl:variable>
<p>
<xsl:call-template name="locale.html.attributes"/>
<xsl:if test="@role and $para.propagates.style != 0">
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="@role"/>
</xsl:apply-templates>
</xsl:if>
<sup>
<xsl:text>[</xsl:text>
<a name="{$name}" href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="ancestor::footnote"
mode="footnote.number"/>
</a>
<xsl:text>] </xsl:text>
</sup>
<xsl:apply-templates/>
</p>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="*" mode="footnote.body.number">
<xsl:variable name="name">
<xsl:text>ftn.</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="ancestor::footnote"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="href">
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="ancestor::footnote"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="footnote.mark">
<sup>
<xsl:text>[</xsl:text>
<a name="{$name}" href="{$href}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="ancestor::footnote"
mode="footnote.number"/>
</a>
<xsl:text>] </xsl:text>
</sup>
</xsl:variable>
<xsl:variable name="html">
<xsl:apply-templates select="."/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0">
<xsl:variable name="html-nodes" select="exsl:node-set($html)"/>
<xsl:choose>
<xsl:when test="$html-nodes//p">
<xsl:apply-templates select="$html-nodes" mode="insert.html.p">
<xsl:with-param name="mark" select="$footnote.mark"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$html-nodes" mode="insert.html.text">
<xsl:with-param name="mark" select="$footnote.mark"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$html"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!--
<xsl:template name="count-element-from">
<xsl:param name="from" select=".."/>
<xsl:param name="to" select="."/>
<xsl:param name="count" select="0"/>
<xsl:param name="list" select="$from/following::*[local-name(.)=local-name($to)]
|$from/descendant-or-self::*[local-name(.)=local-name($to)]"/>
<xsl:choose>
<xsl:when test="not($list)">
<xsl:text>-1</xsl:text>
</xsl:when>
<xsl:when test="$list[1] = $to">
<xsl:value-of select="$count + 1"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-->
<!-- ==================================================================== -->
<xsl:template name="process.footnotes">
<xsl:variable name="footnotes" select=".//footnote"/>
<xsl:variable name="table.footnotes"
select=".//tgroup//footnote"/>
<!-- Only bother to do this if there's at least one non-table footnote -->
<xsl:if test="count($footnotes)>count($table.footnotes)">
<div class="footnotes">
<br/>
<hr width="100" align="{$direction.align.start}"/>
<xsl:apply-templates select="$footnotes" mode="process.footnote.mode"/>
</div>
</xsl:if>
<xsl:if test="$annotation.support != 0 and //annotation">
<div class="annotation-list">
<div class="annotation-nocss">
<p>The following annotations are from this essay. You are seeing
them here because your browser doesnt support the user-interface
techniques used to make them appear as popups on modern browsers.</p>
</div>
<xsl:apply-templates select="//annotation"
mode="annotation-popup"/>
</div>
</xsl:if>
</xsl:template>
<xsl:template name="process.chunk.footnotes">
<!-- nop -->
</xsl:template>
<xsl:template match="footnote" name="process.footnote" mode="process.footnote.mode">
<xsl:choose>
<xsl:when test="local-name(*[1]) = 'para' or local-name(*[1]) = 'simpara'">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:when test="$html.cleanup != 0 and
$exsl.node.set.available != 0">
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates select="*[1]" mode="footnote.body.number"/>
<xsl:apply-templates select="*[position() &gt; 1]"/>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Warning: footnote number may not be generated </xsl:text>
<xsl:text>correctly; </xsl:text>
<xsl:value-of select="local-name(*[1])"/>
<xsl:text> unexpected as first child of footnote.</xsl:text>
</xsl:message>
<div>
<xsl:call-template name="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="tgroup//footnote"
mode="process.footnote.mode">
</xsl:template>
<xsl:template match="footnote" mode="table.footnote.mode">
<xsl:call-template name="process.footnote"/>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,404 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: formal.xsl 8310 2009-03-11 08:29:45Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:param name="formal.object.break.after">1</xsl:param>
<xsl:template name="formal.object">
<xsl:param name="placement" select="'before'"/>
<xsl:param name="class">
<xsl:apply-templates select="." mode="class.value"/>
</xsl:param>
<xsl:call-template name="id.warning"/>
<xsl:variable name="content">
<div class="{$class}">
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$placement = 'before'">
<xsl:call-template name="formal.object.heading"/>
<div class="{$class}-contents">
<xsl:apply-templates/>
</div>
<!-- HACK: This doesn't belong inside formal.object; it
should be done by the table template, but I want
the link to be inside the DIV, so... -->
<xsl:if test="local-name(.) = 'table'">
<xsl:call-template name="table.longdesc"/>
</xsl:if>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
<div class="{$class}-contents"><xsl:apply-templates/></div>
<!-- HACK: This doesn't belong inside formal.object; it
should be done by the table template, but I want
the link to be inside the DIV, so... -->
<xsl:if test="local-name(.) = 'table'">
<xsl:call-template name="table.longdesc"/>
</xsl:if>
<xsl:call-template name="formal.object.heading"/>
</xsl:otherwise>
</xsl:choose>
</div>
<xsl:if test="not($formal.object.break.after = '0')">
<br class="{$class}-break"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="floatstyle">
<xsl:call-template name="floatstyle"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$floatstyle != ''">
<xsl:call-template name="floater">
<xsl:with-param name="class"><xsl:value-of
select="$class"/>-float</xsl:with-param>
<xsl:with-param name="floatstyle" select="$floatstyle"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="formal.object.heading">
<xsl:param name="object" select="."/>
<xsl:param name="title">
<xsl:apply-templates select="$object" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</xsl:param>
<p class="title">
<b>
<xsl:copy-of select="$title"/>
</b>
</p>
</xsl:template>
<xsl:template name="informal.object">
<xsl:param name="class" select="local-name(.)"/>
<xsl:variable name="content">
<div class="{$class}">
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
<!-- HACK: This doesn't belong inside formal.object; it
should be done by the table template, but I want
the link to be inside the DIV, so... -->
<xsl:if test="local-name(.) = 'informaltable'">
<xsl:call-template name="table.longdesc"/>
</xsl:if>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
</div>
</xsl:variable>
<xsl:variable name="floatstyle">
<xsl:call-template name="floatstyle"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$floatstyle != ''">
<xsl:call-template name="floater">
<xsl:with-param name="class"><xsl:value-of
select="$class"/>-float</xsl:with-param>
<xsl:with-param name="floatstyle" select="$floatstyle"/>
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="semiformal.object">
<xsl:param name="placement" select="'before'"/>
<xsl:param name="class" select="local-name(.)"/>
<xsl:choose>
<xsl:when test="title">
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="informal.object">
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="figure">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="table">
<xsl:choose>
<xsl:when test="tgroup|mediaobject|graphic">
<xsl:call-template name="calsTable"/>
</xsl:when>
<xsl:otherwise>
<!-- do not use xsl:copy because of XHTML's needs -->
<xsl:element name="table" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
<xsl:call-template name="htmlTable"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="calsTable">
<xsl:if test="tgroup/tbody/tr
|tgroup/thead/tr
|tgroup/tfoot/tr">
<xsl:message terminate="yes">Broken table: tr descendent of CALS Table.</xsl:message>
</xsl:if>
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
<xsl:with-param name="class">
<xsl:choose>
<xsl:when test="@tabstyle">
<!-- hack, this will only ever occur on table, not example -->
<xsl:value-of select="@tabstyle"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="local-name(.)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="htmlTable">
<xsl:if test="tgroup/tbody/row
|tgroup/thead/row
|tgroup/tfoot/row">
<xsl:message terminate="yes">Broken table: row descendent of HTML table.</xsl:message>
</xsl:if>
<xsl:apply-templates mode="htmlTable"/>
</xsl:template>
<xsl:template match="example">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="equation">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="figure/title"></xsl:template>
<xsl:template match="figure/titleabbrev"></xsl:template>
<xsl:template match="table/title"></xsl:template>
<xsl:template match="table/titleabbrev"></xsl:template>
<xsl:template match="table/textobject"></xsl:template>
<xsl:template match="example/title"></xsl:template>
<xsl:template match="example/titleabbrev"></xsl:template>
<xsl:template match="equation/title"></xsl:template>
<xsl:template match="equation/titleabbrev"></xsl:template>
<xsl:template match="informalfigure">
<xsl:call-template name="informal.object"/>
</xsl:template>
<xsl:template match="informalexample">
<xsl:call-template name="informal.object"/>
</xsl:template>
<xsl:template match="informaltable">
<xsl:choose>
<xsl:when test="tgroup|mediaobject|graphic">
<xsl:call-template name="informal.object">
<xsl:with-param name="class">
<xsl:choose>
<xsl:when test="@tabstyle">
<xsl:value-of select="@tabstyle"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="local-name(.)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:element name="table" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
<xsl:call-template name="htmlTable"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="informaltable/textobject"></xsl:template>
<xsl:template name="table.longdesc">
<!-- HACK: This doesn't belong inside formal.objectt; it should be done by -->
<!-- the table template, but I want the link to be inside the DIV, so... -->
<xsl:variable name="longdesc.uri">
<xsl:call-template name="longdesc.uri">
<xsl:with-param name="mediaobject" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="irrelevant">
<!-- write.longdesc returns the filename ... -->
<xsl:call-template name="write.longdesc">
<xsl:with-param name="mediaobject" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$html.longdesc != 0 and $html.longdesc.link != 0
and textobject[not(phrase)]">
<xsl:call-template name="longdesc.link">
<xsl:with-param name="longdesc.uri" select="$longdesc.uri"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="informalequation">
<xsl:call-template name="informal.object"/>
</xsl:template>
<xsl:template name="floatstyle">
<xsl:if test="(@float and @float != '0') or @floatstyle != ''">
<xsl:choose>
<xsl:when test="@floatstyle != ''">
<xsl:value-of select="@floatstyle"/>
</xsl:when>
<xsl:when test="@float = '1'">
<xsl:value-of select="$default.float.class"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@float"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="floater">
<xsl:param name="content"/>
<xsl:param name="class" select="'float'"/>
<xsl:param name="floatstyle" select="'left'"/>
<div class="{$class}">
<xsl:if test="$floatstyle = 'left' or $floatstyle = 'right'">
<xsl:attribute name="style">
<xsl:text>float: </xsl:text>
<xsl:value-of select="$floatstyle"/>
<xsl:text>;</xsl:text>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</div>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,492 @@
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY % common.entities SYSTEM "../common/entities.ent">
%common.entities;
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink='http://www.w3.org/1999/xlink'
exclude-result-prefixes="xlink"
version='1.0'>
<!-- ********************************************************************
$Id: glossary.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="glossary">
&setup-language-variable;
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="glossary.titlepage"/>
<xsl:choose>
<xsl:when test="glossdiv">
<xsl:apply-templates select="(glossdiv[1]/preceding-sibling::*)"/>
</xsl:when>
<xsl:when test="glossentry">
<xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="glossdiv">
<xsl:apply-templates select="glossdiv"/>
</xsl:when>
<xsl:when test="glossentry">
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:apply-templates select="glossentry">
<xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="glossentry"/>
</xsl:otherwise>
</xsl:choose>
</dl>
</xsl:when>
<xsl:otherwise>
<!-- empty glossary -->
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="glossary/glossaryinfo"></xsl:template>
<xsl:template match="glossary/info"></xsl:template>
<xsl:template match="glossary/title"></xsl:template>
<xsl:template match="glossary/subtitle"></xsl:template>
<xsl:template match="glossary/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="glosslist">
&setup-language-variable;
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="anchor"/>
<xsl:if test="blockinfo/title|info/title|title">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:apply-templates select="glossentry">
<xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="glossentry"/>
</xsl:otherwise>
</xsl:choose>
</dl>
</div>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="glossdiv">
&setup-language-variable;
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:apply-templates select="glossentry">
<xsl:sort lang="{$language}"
select="translate(glossterm, $lowercase,
$uppercase)"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="glossentry"/>
</xsl:otherwise>
</xsl:choose>
</dl>
</div>
</xsl:template>
<xsl:template match="glossdiv/title">
<h3>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<!--
GlossEntry ::=
GlossTerm, Acronym?, Abbrev?,
(IndexTerm)*,
RevHistory?,
(GlossSee | GlossDef+)
-->
<xsl:template match="glossentry">
<xsl:choose>
<xsl:when test="$glossentry.show.acronym = 'primary'">
<dt>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="acronym|abbrev">
<xsl:apply-templates select="acronym|abbrev"/>
<xsl:text> (</xsl:text>
<xsl:apply-templates select="glossterm"/>
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="glossterm"/>
</xsl:otherwise>
</xsl:choose>
</dt>
</xsl:when>
<xsl:when test="$glossentry.show.acronym = 'yes'">
<dt>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="glossterm"/>
<xsl:if test="acronym|abbrev">
<xsl:text> (</xsl:text>
<xsl:apply-templates select="acronym|abbrev"/>
<xsl:text>)</xsl:text>
</xsl:if>
</dt>
</xsl:when>
<xsl:otherwise>
<dt>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional">
<xsl:choose>
<xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="glossterm"/>
</dt>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="indexterm|revhistory|glosssee|glossdef"/>
</xsl:template>
<xsl:template match="glossentry/glossterm">
<xsl:apply-templates/>
<xsl:if test="following-sibling::glossterm">, </xsl:if>
</xsl:template>
<xsl:template match="glossentry/acronym">
<xsl:apply-templates/>
<xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
</xsl:template>
<xsl:template match="glossentry/abbrev">
<xsl:apply-templates/>
<xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
</xsl:template>
<xsl:template match="glossentry/revhistory">
</xsl:template>
<xsl:template match="glossentry/glosssee">
<xsl:variable name="otherterm" select="@otherterm"/>
<xsl:variable name="targets" select="key('id', $otherterm)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="xlink" select="@xlink:href"/>
<dd>
<p>
<xsl:variable name="template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'glossary'"/>
<xsl:with-param name="name" select="'see'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target" mode="xref-to"/>
</a>
</xsl:when>
<xsl:when test="$xlink">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$otherterm != '' and not($target)">
<xsl:message>
<xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
<xsl:value-of select="$otherterm"/>
</xsl:message>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="template" select="$template"/>
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
</p>
</dd>
</xsl:template>
<xsl:template match="glossentry/glossdef">
<dd>
<xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
<xsl:if test="glossseealso">
<p>
<xsl:variable name="template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'glossary'"/>
<xsl:with-param name="name" select="'seealso'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="title">
<xsl:apply-templates select="glossseealso"/>
</xsl:variable>
<xsl:call-template name="substitute-markup">
<xsl:with-param name="template" select="$template"/>
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
</p>
</xsl:if>
</dd>
</xsl:template>
<xsl:template match="glossseealso">
<xsl:variable name="otherterm" select="@otherterm"/>
<xsl:variable name="targets" select="key('id', $otherterm)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="xlink" select="@xlink:href"/>
<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="$target" mode="xref-to"/>
</a>
</xsl:when>
<xsl:when test="$xlink">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$otherterm != '' and not($target)">
<xsl:message>
<xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
<xsl:value-of select="$otherterm"/>
</xsl:message>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="position() = last()"/>
<xsl:otherwise>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'glossary'"/>
<xsl:with-param name="name" select="'seealso-separator'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- Glossary collection -->
<xsl:template match="glossary[@role='auto']" priority="2">
&setup-language-variable;
<xsl:variable name="terms"
select="//glossterm[not(parent::glossdef)]|//firstterm"/>
<xsl:variable name="collection" select="document($glossary.collection, .)"/>
<xsl:call-template name="id.warning"/>
<xsl:if test="$glossary.collection = ''">
<xsl:message>
<xsl:text>Warning: processing automatic glossary </xsl:text>
<xsl:text>without a glossary.collection file.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:if test="not($collection) and $glossary.collection != ''">
<xsl:message>
<xsl:text>Warning: processing automatic glossary but unable to </xsl:text>
<xsl:text>open glossary.collection file '</xsl:text>
<xsl:value-of select="$glossary.collection"/>
<xsl:text>'</xsl:text>
</xsl:message>
</xsl:if>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="glossary.titlepage"/>
<xsl:choose>
<xsl:when test="glossdiv and $collection//glossdiv">
<xsl:for-each select="$collection//glossdiv">
<!-- first see if there are any in this div -->
<xsl:variable name="exist.test">
<xsl:for-each select="glossentry">
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:value-of select="glossterm"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$exist.test != ''">
<xsl:apply-templates select="." mode="auto-glossary">
<xsl:with-param name="terms" select="$terms"/>
</xsl:apply-templates>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:for-each select="$collection//glossentry">
<xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:apply-templates select="." mode="auto-glossary"/>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$collection//glossentry">
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:apply-templates select="." mode="auto-glossary"/>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</dl>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="*" mode="auto-glossary">
<!-- pop back out to the default mode for most elements -->
<xsl:apply-templates select="."/>
</xsl:template>
<xsl:template match="glossdiv" mode="auto-glossary">
<xsl:param name="terms" select="."/>
&setup-language-variable;
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
<dl>
<xsl:choose>
<xsl:when test="$glossary.sort != 0">
<xsl:for-each select="glossentry">
<xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>!
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:apply-templates select="." mode="auto-glossary"/>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="glossentry">
<xsl:variable name="cterm" select="glossterm"/>
<xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
<xsl:apply-templates select="." mode="auto-glossary"/>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</dl>
</div>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl"
version='1.0'>
<!-- ********************************************************************
$Id: highlight.xsl 8419 2009-04-29 20:37:52Z kosek $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
and other information.
******************************************************************** -->
<xsl:import href="../highlighting/common.xsl"/>
<xsl:template match='xslthl:keyword' mode="xslthl">
<b class="hl-keyword"><xsl:apply-templates mode="xslthl"/></b>
</xsl:template>
<xsl:template match='xslthl:string' mode="xslthl">
<b class="hl-string"><i style="color:red"><xsl:apply-templates mode="xslthl"/></i></b>
</xsl:template>
<xsl:template match='xslthl:comment' mode="xslthl">
<i class="hl-comment" style="color: silver"><xsl:apply-templates mode="xslthl"/></i>
</xsl:template>
<xsl:template match='xslthl:directive' mode="xslthl">
<span class="hl-directive" style="color: maroon"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:tag' mode="xslthl">
<b class="hl-tag" style="color: #000096"><xsl:apply-templates mode="xslthl"/></b>
</xsl:template>
<xsl:template match='xslthl:attribute' mode="xslthl">
<span class="hl-attribute" style="color: #F5844C"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:value' mode="xslthl">
<span class="hl-value" style="color: #993300"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:html' mode="xslthl">
<b><i style="color: red"><xsl:apply-templates mode="xslthl"/></i></b>
</xsl:template>
<xsl:template match='xslthl:xslt' mode="xslthl">
<b style="color: #0066FF"><xsl:apply-templates mode="xslthl"/></b>
</xsl:template>
<!-- Not emitted since XSLTHL 2.0 -->
<xsl:template match='xslthl:section' mode="xslthl">
<b><xsl:apply-templates mode="xslthl"/></b>
</xsl:template>
<xsl:template match='xslthl:number' mode="xslthl">
<span class="hl-number"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:annotation' mode="xslthl">
<i><span class="hl-annotation" style="color: gray"><xsl:apply-templates mode="xslthl"/></span></i>
</xsl:template>
<!-- Not sure which element will be in final XSLTHL 2.0 -->
<xsl:template match='xslthl:doccomment|xslthl:doctype' mode="xslthl">
<b class="hl-tag" style="color: blue"><xsl:apply-templates mode="xslthl"/></b>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,336 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:set="http://exslt.org/sets"
exclude-result-prefixes="exsl set"
version="1.0">
<!-- ********************************************************************
$Id: html-rtf.xsl 8345 2009-03-16 06:44:07Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- This module contains templates that match against HTML nodes. It is used
to post-process result tree fragments for some sorts of cleanup.
These templates can only ever be fired by a processor that supports
exslt:node-set(). -->
<!-- ==================================================================== -->
<!-- insert.html.p mode templates insert a particular RTF at the beginning
of the first paragraph in the primary RTF. -->
<xsl:template match="/" mode="insert.html.p">
<xsl:param name="mark" select="'?'"/>
<xsl:apply-templates mode="insert.html.p">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="insert.html.p">
<xsl:param name="mark" select="'?'"/>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="insert.html.p">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template xmlns:html="http://www.w3.org/1999/xhtml"
match="html:p|p" mode="insert.html.p">
<xsl:param name="mark" select="'?'"/>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:if test="not(preceding::p|preceding::html:p)">
<xsl:copy-of select="$mark"/>
</xsl:if>
<xsl:apply-templates mode="insert.html.p">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()" mode="insert.html.p">
<xsl:param name="mark" select="'?'"/>
<xsl:copy/>
</xsl:template>
<!-- ==================================================================== -->
<!-- insert.html.text mode templates insert a particular RTF at the beginning
of the first text-node in the primary RTF. -->
<xsl:template match="/" mode="insert.html.text">
<xsl:param name="mark" select="'?'"/>
<xsl:apply-templates mode="insert.html.text">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="insert.html.text">
<xsl:param name="mark" select="'?'"/>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="insert.html.text">
<xsl:with-param name="mark" select="$mark"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()" mode="insert.html.text">
<xsl:param name="mark" select="'?'"/>
<xsl:if test="not(preceding::text())">
<xsl:copy-of select="$mark"/>
</xsl:if>
<xsl:copy/>
</xsl:template>
<xsl:template match="processing-instruction()|comment()" mode="insert.html.text">
<xsl:param name="mark" select="'?'"/>
<xsl:copy/>
</xsl:template>
<!-- ==================================================================== -->
<!-- unwrap.p mode templates remove blocks from HTML p elements (and
other places where blocks aren't allowed) -->
<xsl:template name="unwrap.p">
<xsl:param name="p"/>
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0
and function-available('set:leading')
and function-available('set:trailing')">
<xsl:apply-templates select="exsl:node-set($p)" mode="unwrap.p"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$p"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template xmlns:html="http://www.w3.org/1999/xhtml"
match="html:p|p" mode="unwrap.p">
<!-- xmlns:html is necessary for the xhtml stylesheet case -->
<xsl:variable name="blocks" xmlns:html="http://www.w3.org/1999/xhtml"
select="address|blockquote|div|hr|h1|h2|h3|h4|h5|h6
|layer|p|pre|table|dl|menu|ol|ul|form
|html:address|html:blockquote|html:div|html:hr
|html:h1|html:h2|html:h3|html:h4|html:h5|html:h6
|html:layer|html:p|html:pre|html:table|html:dl
|html:menu|html:ol|html:ul|html:form"/>
<xsl:choose>
<xsl:when test="$blocks">
<xsl:call-template name="unwrap.p.nodes">
<xsl:with-param name="wrap" select="."/>
<xsl:with-param name="first" select="1"/>
<xsl:with-param name="nodes" select="node()"/>
<xsl:with-param name="blocks" select="$blocks"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="unwrap.p"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="unwrap.p">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="unwrap.p"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()" mode="unwrap.p">
<xsl:copy/>
</xsl:template>
<xsl:template name="unwrap.p.nodes">
<xsl:param name="wrap" select="."/>
<xsl:param name="first" select="0"/>
<xsl:param name="nodes"/>
<xsl:param name="blocks"/>
<xsl:variable name="block" select="$blocks[1]"/>
<!-- This template should never get called if these functions aren't available -->
<!-- but this test is still necessary so that processors don't choke on the -->
<!-- function calls if they don't support the set: functions -->
<xsl:if test="function-available('set:leading')
and function-available('set:trailing')">
<xsl:choose>
<xsl:when test="$blocks">
<xsl:variable name="leading" select="set:leading($nodes,$block)"/>
<xsl:variable name="trailing" select="set:trailing($nodes,$block)"/>
<xsl:if test="(($wrap/@id or $wrap/@xml:id)
and $first = 1) or $leading">
<xsl:element name="{local-name($wrap)}" namespace="{namespace-uri($wrap)}">
<xsl:for-each select="$wrap/@*">
<xsl:if test="$first != 0 or local-name(.) != 'id'">
<xsl:copy/>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="$leading" mode="unwrap.p"/>
</xsl:element>
</xsl:if>
<xsl:apply-templates select="$block" mode="unwrap.p"/>
<xsl:if test="$trailing">
<xsl:call-template name="unwrap.p.nodes">
<xsl:with-param name="wrap" select="$wrap"/>
<xsl:with-param name="nodes" select="$trailing"/>
<xsl:with-param name="blocks" select="$blocks[position() &gt; 1]"/>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="(($wrap/@id or $wrap/@xml:id) and $first = 1) or $nodes">
<xsl:element name="{local-name($wrap)}" namespace="{namespace-uri($wrap)}">
<xsl:for-each select="$wrap/@*">
<xsl:if test="$first != 0 or local-name(.) != 'id'">
<xsl:copy/>
</xsl:if>
</xsl:for-each>
<xsl:apply-templates select="$nodes" mode="unwrap.p"/>
</xsl:element>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<!-- make.verbatim.mode replaces spaces and newlines -->
<xsl:template match="/" mode="make.verbatim.mode">
<xsl:apply-templates mode="make.verbatim.mode"/>
</xsl:template>
<xsl:template match="*" mode="make.verbatim.mode">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="make.verbatim.mode"/>
</xsl:copy>
</xsl:template>
<xsl:template match="processing-instruction()|comment()" mode="make.verbatim.mode">
<xsl:copy/>
</xsl:template>
<xsl:template match="text()" mode="make.verbatim.mode">
<xsl:variable name="text" select="translate(., ' ', '&#160;')"/>
<xsl:choose>
<xsl:when test="not(contains($text, '&#xA;'))">
<xsl:value-of select="$text"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="len" select="string-length($text)"/>
<xsl:choose>
<xsl:when test="$len = 1">
<br/><xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="half" select="$len div 2"/>
<xsl:call-template name="make-verbatim-recursive">
<xsl:with-param name="text" select="substring($text, 1, $half)"/>
</xsl:call-template>
<xsl:call-template name="make-verbatim-recursive">
<xsl:with-param name="text"
select="substring($text, ($half + 1), $len)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="make-verbatim-recursive">
<xsl:param name="text" select="''"/>
<xsl:choose>
<xsl:when test="not(contains($text, '&#xA;'))">
<xsl:value-of select="$text"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="len" select="string-length($text)"/>
<xsl:choose>
<xsl:when test="$len = 1">
<br/><xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="half" select="$len div 2"/>
<xsl:call-template name="make-verbatim-recursive">
<xsl:with-param name="text" select="substring($text, 1, $half)"/>
</xsl:call-template>
<xsl:call-template name="make-verbatim-recursive">
<xsl:with-param name="text"
select="substring($text, ($half + 1), $len)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- remove.empty.div mode templates remove empty blocks -->
<xsl:template name="remove.empty.div">
<xsl:param name="div"/>
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0">
<xsl:apply-templates select="exsl:node-set($div)" mode="remove.empty.div"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$div"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template xmlns:html="http://www.w3.org/1999/xhtml"
match="html:p|p|html:div|div" mode="remove.empty.div">
<xsl:if test="node()">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="remove.empty.div"/>
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="*" mode="remove.empty.div">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="remove.empty.div"/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|processing-instruction()|comment()" mode="remove.empty.div">
<xsl:copy/>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,370 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: html.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- These variables set the align attribute value for HTML output based on
the writing-mode specified in the gentext file for the document's lang. -->
<xsl:variable name="direction.align.start">
<xsl:choose>
<xsl:when test="starts-with($writing.mode, 'lr')">left</xsl:when>
<xsl:when test="starts-with($writing.mode, 'rl')">right</xsl:when>
<xsl:otherwise>left</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="direction.align.end">
<xsl:choose>
<xsl:when test="starts-with($writing.mode, 'lr')">right</xsl:when>
<xsl:when test="starts-with($writing.mode, 'rl')">left</xsl:when>
<xsl:otherwise>right</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="direction.mode">
<xsl:choose>
<xsl:when test="starts-with($writing.mode, 'lr')">ltr</xsl:when>
<xsl:when test="starts-with($writing.mode, 'rl')">rtl</xsl:when>
<xsl:otherwise>ltr</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- The generate.html.title template is currently used for generating HTML -->
<!-- "title" attributes for some inline elements only, but not for any -->
<!-- block elements. It is called in eleven places in the inline.xsl -->
<!-- file. But it's called by all the inline.* templates (e.g., -->
<!-- inline.boldseq), which in turn are called by other (element) -->
<!-- templates, so it results, currently, in supporting generation of the -->
<!-- HTML "title" attribute for a total of about 92 elements. -->
<!-- You can use mode="html.title.attribute" to get a title for -->
<!-- an element specified by a param, including targets of cross references. -->
<xsl:template name="generate.html.title">
<xsl:apply-templates select="." mode="html.title.attribute"/>
</xsl:template>
<!-- Generate a title attribute for the context node -->
<xsl:template match="*" mode="html.title.attribute">
<xsl:variable name="is.title">
<xsl:call-template name="gentext.template.exists">
<xsl:with-param name="context" select="'title'"/>
<xsl:with-param name="name" select="local-name(.)"/>
<xsl:with-param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is.title-numbered">
<xsl:call-template name="gentext.template.exists">
<xsl:with-param name="context" select="'title-numbered'"/>
<xsl:with-param name="name" select="local-name(.)"/>
<xsl:with-param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is.title-unnumbered">
<xsl:call-template name="gentext.template.exists">
<xsl:with-param name="context" select="'title-unnumbered'"/>
<xsl:with-param name="name" select="local-name(.)"/>
<xsl:with-param name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="has.title.markup">
<xsl:apply-templates select="." mode="title.markup">
<xsl:with-param name="verbose" select="0"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:variable name="gentext.title">
<xsl:if test="$has.title.markup != '???TITLE???' and
($is.title != 0 or
$is.title-numbered != 0 or
$is.title-unnumbered != 0)">
<xsl:apply-templates select="."
mode="object.title.markup.textonly"/>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($gentext.title) != 0">
<xsl:attribute name="title">
<xsl:value-of select="$gentext.title"/>
</xsl:attribute>
</xsl:when>
<!-- Fall back to alt if available -->
<xsl:when test="alt">
<xsl:attribute name="title">
<xsl:value-of select="normalize-space(alt)"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="qandaentry" mode="html.title.attribute">
<xsl:apply-templates select="question" mode="html.title.attribute"/>
</xsl:template>
<xsl:template match="question" mode="html.title.attribute">
<xsl:variable name="label.text">
<xsl:apply-templates select="." mode="qanda.label"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($label.text) != 0">
<xsl:attribute name="title">
<xsl:value-of select="$label.text"/>
</xsl:attribute>
</xsl:when>
<!-- Fall back to alt if available -->
<xsl:when test="alt">
<xsl:attribute name="title">
<xsl:value-of select="normalize-space(alt)"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="dir">
<xsl:param name="inherit" select="0"/>
<xsl:variable name="dir">
<xsl:choose>
<xsl:when test="@dir">
<xsl:value-of select="@dir"/>
</xsl:when>
<xsl:when test="$inherit != 0">
<xsl:value-of select="ancestor::*/@dir[1]"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:if test="$dir != ''">
<xsl:attribute name="dir">
<xsl:value-of select="$dir"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="anchor">
<xsl:param name="node" select="."/>
<xsl:param name="conditional" select="1"/>
<xsl:variable name="id">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$node"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id">
<a name="{$id}"/>
</xsl:if>
</xsl:template>
<xsl:template name="href.target.uri">
<xsl:param name="context" select="."/>
<xsl:param name="object" select="."/>
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$object"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="href.target">
<xsl:param name="context" select="."/>
<xsl:param name="object" select="."/>
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$object"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="href.target.with.base.dir">
<xsl:param name="context" select="."/>
<xsl:param name="object" select="."/>
<xsl:if test="$manifest.in.base.dir = 0">
<xsl:value-of select="$base.dir"/>
</xsl:if>
<xsl:call-template name="href.target">
<xsl:with-param name="context" select="$context"/>
<xsl:with-param name="object" select="$object"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="dingbat">
<xsl:param name="dingbat">bullet</xsl:param>
<xsl:call-template name="dingbat.characters">
<xsl:with-param name="dingbat" select="$dingbat"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="dingbat.characters">
<!-- now that I'm using the real serializer, all that dingbat malarky -->
<!-- isn't necessary anymore... -->
<xsl:param name="dingbat">bullet</xsl:param>
<xsl:choose>
<xsl:when test="$dingbat='bullet'">&#x2022;</xsl:when>
<xsl:when test="$dingbat='copyright'">&#x00A9;</xsl:when>
<xsl:when test="$dingbat='trademark'">&#x2122;</xsl:when>
<xsl:when test="$dingbat='trade'">&#x2122;</xsl:when>
<xsl:when test="$dingbat='registered'">&#x00AE;</xsl:when>
<xsl:when test="$dingbat='service'">(SM)</xsl:when>
<xsl:when test="$dingbat='nbsp'">&#x00A0;</xsl:when>
<xsl:when test="$dingbat='ldquo'">&#x201C;</xsl:when>
<xsl:when test="$dingbat='rdquo'">&#x201D;</xsl:when>
<xsl:when test="$dingbat='lsquo'">&#x2018;</xsl:when>
<xsl:when test="$dingbat='rsquo'">&#x2019;</xsl:when>
<xsl:when test="$dingbat='em-dash'">&#x2014;</xsl:when>
<xsl:when test="$dingbat='mdash'">&#x2014;</xsl:when>
<xsl:when test="$dingbat='en-dash'">&#x2013;</xsl:when>
<xsl:when test="$dingbat='ndash'">&#x2013;</xsl:when>
<xsl:otherwise>
<xsl:text>&#x2022;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="id.warning">
<xsl:if test="$id.warnings != 0 and not(@id) and not(@xml:id) and parent::*">
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="title">
<xsl:value-of select="title[1]"/>
</xsl:when>
<xsl:when test="substring(local-name(*[1]),
string-length(local-name(*[1])-3) = 'info')
and *[1]/title">
<xsl:value-of select="*[1]/title[1]"/>
</xsl:when>
<xsl:when test="refmeta/refentrytitle">
<xsl:value-of select="refmeta/refentrytitle"/>
</xsl:when>
<xsl:when test="refnamediv/refname">
<xsl:value-of select="refnamediv/refname[1]"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:message>
<xsl:text>ID recommended on </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:if test="$title != ''">
<xsl:text>: </xsl:text>
<xsl:choose>
<xsl:when test="string-length($title) &gt; 40">
<xsl:value-of select="substring($title,1,40)"/>
<xsl:text>...</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:message>
</xsl:if>
</xsl:template>
<xsl:template name="generate.class.attribute">
<xsl:param name="class" select="local-name(.)"/>
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="$class"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="class.attribute">
<xsl:param name="class" select="local-name(.)"/>
<!-- permit customization of class attributes -->
<!-- Use element name by default -->
<xsl:attribute name="class">
<xsl:apply-templates select="." mode="class.value">
<xsl:with-param name="class" select="$class"/>
</xsl:apply-templates>
</xsl:attribute>
</xsl:template>
<xsl:template match="*" mode="class.value">
<xsl:param name="class" select="local-name(.)"/>
<!-- permit customization of class value only -->
<!-- Use element name by default -->
<xsl:value-of select="$class"/>
</xsl:template>
<!-- Apply common attributes such as class, lang, dir -->
<xsl:template name="common.html.attributes">
<xsl:param name="inherit" select="0"/>
<xsl:param name="class" select="local-name(.)"/>
<xsl:apply-templates select="." mode="common.html.attributes">
<xsl:with-param name="class" select="$class"/>
<xsl:with-param name="inherit" select="$inherit"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*" mode="common.html.attributes">
<xsl:param name="class" select="local-name(.)"/>
<xsl:param name="inherit" select="0"/>
<xsl:call-template name="generate.html.lang"/>
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="$inherit"/>
</xsl:call-template>
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="$class"/>
</xsl:apply-templates>
<xsl:call-template name="generate.html.title"/>
</xsl:template>
<!-- Apply common attributes not including class -->
<xsl:template name="locale.html.attributes">
<xsl:apply-templates select="." mode="locale.html.attributes"/>
</xsl:template>
<xsl:template match="*" mode="locale.html.attributes">
<xsl:call-template name="generate.html.lang"/>
<xsl:call-template name="dir"/>
<xsl:call-template name="generate.html.title"/>
</xsl:template>
<!-- Pass through any lang attributes -->
<xsl:template name="generate.html.lang">
<xsl:apply-templates select="." mode="html.lang.attribute"/>
</xsl:template>
<xsl:template match="*" mode="html.lang.attribute">
<!-- match the attribute name to the output type -->
<xsl:choose>
<xsl:when test="@lang and $stylesheet.result.type = 'html'">
<xsl:attribute name="lang">
<xsl:value-of select="@lang"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="@lang and $stylesheet.result.type = 'xhtml'">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@lang"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="@xml:lang and $stylesheet.result.type = 'html'">
<xsl:attribute name="lang">
<xsl:value-of select="@xml:lang"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="@xml:lang and $stylesheet.result.type = 'xhtml'">
<xsl:attribute name="xml:lang">
<xsl:value-of select="@xml:lang"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,138 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- ********************************************************************
$Id: htmltbl.xsl 8310 2009-03-11 08:29:45Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="colgroup" mode="htmlTable">
<xsl:element name="{local-name()}" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:apply-templates mode="htmlTable"/>
</xsl:element>
</xsl:template>
<xsl:template match="col" mode="htmlTable">
<xsl:element name="{local-name()}" namespace="">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
</xsl:element>
</xsl:template>
<xsl:template match="caption" mode="htmlTable">
<!-- do not use xsl:copy because of XHTML's needs -->
<caption>
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:apply-templates select=".." mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</caption>
</xsl:template>
<xsl:template match="tbody|thead|tfoot|tr" mode="htmlTable">
<xsl:element name="{local-name(.)}">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:apply-templates mode="htmlTable"/>
</xsl:element>
</xsl:template>
<xsl:template match="th|td" mode="htmlTable">
<xsl:element name="{local-name(.)}">
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
<xsl:apply-templates/> <!-- *not* mode=htmlTable -->
</xsl:element>
</xsl:template>
<!-- don't copy through DocBook-specific attributes on HTML table markup -->
<!-- default behavior is to not copy through because there are more
DocBook attributes than HTML attributes -->
<xsl:template mode="htmlTableAtt" match="@*"/>
<!-- copy these through -->
<xsl:template mode="htmlTableAtt"
match="@abbr
| @align
| @axis
| @bgcolor
| @border
| @cellpadding
| @cellspacing
| @char
| @charoff
| @class
| @colspan
| @dir
| @frame
| @headers
| @height
| @lang
| @nowrap
| @onclick
| @ondblclick
| @onkeydown
| @onkeypress
| @onkeyup
| @onmousedown
| @onmousemove
| @onmouseout
| @onmouseover
| @onmouseup
| @rowspan
| @rules
| @span
| @style
| @summary
| @title
| @valign
| @valign
| @width
| @xml:lang">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="@span|@rowspan|@colspan" mode="htmlTableAtt">
<!-- No need to copy through the DTD's default value "1" of the attribute -->
<xsl:if test="number(.) != 1">
<xsl:attribute name="{local-name(.)}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<!-- map floatstyle to HTML float values -->
<xsl:template match="@floatstyle" mode="htmlTableAtt">
<xsl:attribute name="style">
<xsl:text>float: </xsl:text>
<xsl:choose>
<xsl:when test="contains(., 'left')">left</xsl:when>
<xsl:when test="contains(., 'right')">right</xsl:when>
<xsl:when test="contains(., 'start')">
<xsl:value-of select="$direction.align.start"/>
</xsl:when>
<xsl:when test="contains(., 'end')">
<xsl:value-of select="$direction.align.end"/>
</xsl:when>
<xsl:when test="contains(., 'inside')">
<xsl:value-of select="$direction.align.start"/>
</xsl:when>
<xsl:when test="contains(., 'outside')">
<xsl:value-of select="$direction.align.end"/>
</xsl:when>
<xsl:when test="contains(., 'before')">none</xsl:when>
<xsl:when test="contains(., 'none')">none</xsl:when>
</xsl:choose>
<xsl:text>;</xsl:text>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,288 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: index.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="index">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. Unless generate.index -->
<!-- is non-zero, in which case, this is where the automatically -->
<!-- generated index should go. -->
<xsl:call-template name="id.warning"/>
<xsl:if test="count(*)>0 or $generate.index != '0'">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="index.titlepage"/>
<xsl:choose>
<xsl:when test="indexdiv">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[not(self::indexentry)]"/>
<!-- Because it's actually valid for Index to have neither any -->
<!-- Indexdivs nor any Indexentries, we need to check and make -->
<!-- sure that at least one Indexentry exists, and generate a -->
<!-- wrapper dl if there is at least one; otherwise, do nothing. -->
<xsl:if test="indexentry">
<!-- The indexentry template assumes a parent dl wrapper has -->
<!-- been generated; for Indexes that have Indexdivs, the dl -->
<!-- wrapper is generated by the indexdiv template; however, -->
<!-- for Indexes that lack Indexdivs, if we don't generate a -->
<!-- dl here, HTML output will not be valid. -->
<dl>
<xsl:apply-templates select="indexentry"/>
</dl>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
<xsl:call-template name="generate-index">
<xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="setindex">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. Unless generate.index -->
<!-- is non-zero, in which case, this is where the automatically -->
<!-- generated index should go. -->
<xsl:call-template name="id.warning"/>
<xsl:if test="count(*)>0 or $generate.index != '0'">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="setindex.titlepage"/>
<xsl:apply-templates/>
<xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
<xsl:call-template name="generate-index">
<xsl:with-param name="scope" select="/"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="index/indexinfo"></xsl:template>
<xsl:template match="index/info"></xsl:template>
<xsl:template match="index/title"></xsl:template>
<xsl:template match="index/subtitle"></xsl:template>
<xsl:template match="index/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexdiv">
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="*[not(self::indexentry)]"/>
<dl>
<xsl:apply-templates select="indexentry"/>
</dl>
</div>
</xsl:template>
<xsl:template match="indexdiv/title">
<h3>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexterm">
<!-- this one must have a name, even if it doesn't have an ID -->
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<a class="indexterm" name="{$id}"/>
</xsl:template>
<xsl:template match="primary|secondary|tertiary|see|seealso">
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexentry">
<xsl:apply-templates select="primaryie"/>
</xsl:template>
<xsl:template match="primaryie">
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<xsl:apply-templates select="following-sibling::seeie
[not(preceding-sibling::secondaryie)]"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie
[not(preceding-sibling::secondaryie)]"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::secondaryie"
mode="indexentry"/>
</dd>
</xsl:template>
<!-- Handled in mode to convert flat list to structured output -->
<xsl:template match="secondaryie">
</xsl:template>
<xsl:template match="tertiaryie">
</xsl:template>
<xsl:template match="seeie|seealsoie">
</xsl:template>
<xsl:template match="secondaryie" mode="indexentry">
<dl>
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<!-- select following see* elements up to next secondaryie or tertiary or end -->
<xsl:variable name="after.this"
select="following-sibling::*"/>
<xsl:variable name="next.entry"
select="(following-sibling::secondaryie|following-sibling::tertiaryie)[1]"/>
<xsl:variable name="before.entry"
select="$next.entry/preceding-sibling::*"/>
<xsl:variable name="see.intersection"
select="$after.this[count(.|$before.entry) = count($before.entry)]
[self::seeie or self::seealsoie]"/>
<xsl:choose>
<xsl:when test="count($see.intersection) != 0">
<xsl:apply-templates select="$see.intersection" mode="indexentry"/>
</xsl:when>
<xsl:when test="count($next.entry) = 0">
<xsl:apply-templates select="following-sibling::seeie"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
<!-- now process any tertiaryie before the next secondaryie -->
<xsl:variable name="before.next.secondary"
select="following-sibling::secondaryie[1]/preceding-sibling::*"/>
<xsl:variable name="tertiary.intersection"
select="$after.this[count(.|$before.next.secondary) =
count($before.next.secondary)]
[not(self::seeie) and not(self::seealsoie)]"/>
<xsl:choose>
<xsl:when test="count($tertiary.intersection) != 0">
<xsl:apply-templates select="$tertiary.intersection"
mode="indexentry"/>
</xsl:when>
<xsl:when test="not(following-sibling::secondaryie)">
<xsl:apply-templates select="following-sibling::tertiaryie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
</dd>
</dl>
</xsl:template>
<xsl:template match="tertiaryie" mode="indexentry">
<dl>
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<!-- select following see* elements up to next secondaryie or tertiary or end -->
<xsl:variable name="after.this"
select="following-sibling::*"/>
<xsl:variable name="next.entry"
select="(following-sibling::secondaryie|following-sibling::tertiaryie)[1]"/>
<xsl:variable name="before.entry"
select="$next.entry/preceding-sibling::*"/>
<xsl:variable name="see.intersection"
select="$after.this[count(.|$before.entry) = count($before.entry)]
[self::seeie or self::seealsoie]"/>
<xsl:choose>
<xsl:when test="count($see.intersection) != 0">
<xsl:apply-templates select="$see.intersection" mode="indexentry"/>
</xsl:when>
<xsl:when test="count($next.entry) = 0">
<xsl:apply-templates select="following-sibling::seeie"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
</dd>
</dl>
</xsl:template>
<xsl:template match="seeie" mode="indexentry">
<dt>
<xsl:text>(</xsl:text>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'see'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text>)</xsl:text>
</dt>
</xsl:template>
<xsl:template match="seealsoie" mode="indexentry">
<div>
<xsl:text>(</xsl:text>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'seealso'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text>)</xsl:text>
</div>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,43 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: info.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- These templates define the "default behavior" for info
elements. Even if you don't process the *info wrappers,
some of these elements are needed because the elements are
processed from named templates that are called with modes.
Since modes aren't sticky, these rules apply.
(TODO: clarify this comment) -->
<!-- ==================================================================== -->
<!-- called from named templates in a given mode -->
<xsl:template match="corpauthor">
<span>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="jobtitle">
<span>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: keywords.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:template match="keywordset"></xsl:template>
<xsl:template match="subjectset"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="keywordset" mode="html.header">
<meta name="keywords">
<xsl:attribute name="content">
<xsl:apply-templates select="keyword" mode="html.header"/>
</xsl:attribute>
</meta>
</xsl:template>
<xsl:template match="keyword" mode="html.header">
<xsl:apply-templates/>
<xsl:if test="following-sibling::keyword">, </xsl:if>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,86 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
version="1.0"
exclude-result-prefixes="doc">
<!-- ********************************************************************
$Id: maketoc.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:import href="docbook.xsl"/>
<xsl:import href="chunk.xsl"/>
<xsl:output method="xml" indent="no" encoding='utf-8'/>
<xsl:param name="toc.list.type" select="'tocentry'"/>
<!-- refentry in autotoc.xsl does not use subtoc, so must
handle it explicitly here. -->
<xsl:template match="refentry" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="subtoc">
<xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
<xsl:variable name="filename">
<xsl:apply-templates select="." mode="chunk-filename"/>
</xsl:variable>
<xsl:variable name="chunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:if test="$chunk != 0">
<xsl:call-template name="indent-spaces"/>
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<tocentry linkend="{$id}">
<xsl:processing-instruction name="dbhtml">
<xsl:text>filename="</xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>"</xsl:text>
</xsl:processing-instruction>
<xsl:text>&#xA;</xsl:text>
<xsl:apply-templates mode="toc" select="$nodes"/>
<xsl:call-template name="indent-spaces"/>
</tocentry>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="indent-spaces">
<xsl:param name="node" select="."/>
<xsl:text> </xsl:text>
<xsl:if test="$node/parent::*">
<xsl:call-template name="indent-spaces">
<xsl:with-param name="node" select="$node/parent::*"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="/" priority="-1">
<xsl:text>&#xA;</xsl:text>
<toc role="chunk-toc">
<xsl:text>&#xA;</xsl:text>
<xsl:apply-templates select="/" mode="toc"/>
</toc>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,22 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
version="1.0"
exclude-result-prefixes="doc">
<!-- ********************************************************************
$Id: manifest.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- OBSOLETE. The templates from this file were moved to -->
<!-- chunk-common.xsl and chunk-code.xsl. -->
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,270 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="mml"
version='1.0'>
<!-- ********************************************************************
$Id: math.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:template match="inlineequation">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="alt">
</xsl:template>
<xsl:template match="mathphrase">
<span>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<!-- "Support" for MathML -->
<xsl:template match="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<!-- Support for TeX math in alt -->
<xsl:template match="*" mode="collect.tex.math">
<xsl:call-template name="write.text.chunk">
<xsl:with-param name="filename" select="$tex.math.file"/>
<xsl:with-param name="method" select="'text'"/>
<xsl:with-param name="content">
<xsl:choose>
<xsl:when test="$tex.math.in.alt = 'plain'">
<xsl:call-template name="tex.math.plain.head"/>
<xsl:apply-templates select="." mode="collect.tex.math.plain"/>
<xsl:call-template name="tex.math.plain.tail"/>
</xsl:when>
<xsl:when test="$tex.math.in.alt = 'latex'">
<xsl:call-template name="tex.math.latex.head"/>
<xsl:apply-templates select="." mode="collect.tex.math.latex"/>
<xsl:call-template name="tex.math.latex.tail"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
Unsupported TeX math notation:
<xsl:value-of select="$tex.math.in.alt"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="encoding" select="$chunker.output.encoding"/>
</xsl:call-template>
</xsl:template>
<!-- PlainTeX -->
<xsl:template name="tex.math.plain.head">
<xsl:text>\nopagenumbers &#xA;</xsl:text>
</xsl:template>
<xsl:template name="tex.math.plain.tail">
<xsl:text>\bye &#xA;</xsl:text>
</xsl:template>
<xsl:template match="inlineequation" mode="collect.tex.math.plain">
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="graphic">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select="graphic"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="select.mediaobject.filename">
<xsl:with-param name="olist" select="inlinemediaobject/*"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="output.delims">
<xsl:call-template name="tex.math.output.delims"/>
</xsl:variable>
<xsl:variable name="tex" select="alt[@role='tex'] | inlinemediaobject/textobject[@role='tex']"/>
<xsl:if test="$tex">
<xsl:text>\special{dvi2bitmap outputfile </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>} &#xA;</xsl:text>
<xsl:if test="$output.delims != 0">
<xsl:text>$</xsl:text>
</xsl:if>
<xsl:value-of select="$tex"/>
<xsl:if test="$output.delims != 0">
<xsl:text>$ &#xA;</xsl:text>
</xsl:if>
<xsl:text>\vfill\eject &#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="equation|informalequation" mode="collect.tex.math.plain">
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="graphic">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select="graphic"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="select.mediaobject.filename">
<xsl:with-param name="olist" select="mediaobject/*"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="output.delims">
<xsl:call-template name="tex.math.output.delims"/>
</xsl:variable>
<xsl:variable name="tex" select="alt[@role='tex'] | mediaobject/textobject[@role='tex']"/>
<xsl:if test="$tex">
<xsl:text>\special{dvi2bitmap outputfile </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>} &#xA;</xsl:text>
<xsl:if test="$output.delims != 0">
<xsl:text>$$</xsl:text>
</xsl:if>
<xsl:value-of select="$tex"/>
<xsl:if test="$output.delims != 0">
<xsl:text>$$ &#xA;</xsl:text>
</xsl:if>
<xsl:text>\vfill\eject &#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="text()" mode="collect.tex.math.plain"/>
<!-- LaTeX -->
<xsl:template name="tex.math.latex.head">
<xsl:text>\documentclass{article} &#xA;</xsl:text>
<xsl:text>\pagestyle{empty} &#xA;</xsl:text>
<xsl:text>\begin{document} &#xA;</xsl:text>
</xsl:template>
<xsl:template name="tex.math.latex.tail">
<xsl:text>\end{document} &#xA;</xsl:text>
</xsl:template>
<xsl:template match="inlineequation" mode="collect.tex.math.latex">
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="graphic">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select="graphic"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="select.mediaobject.filename">
<xsl:with-param name="olist" select="inlinemediaobject/*"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="output.delims">
<xsl:call-template name="tex.math.output.delims"/>
</xsl:variable>
<xsl:variable name="tex" select="alt[@role='tex'] | inlinemediaobject/textobject[@role='tex']"/>
<xsl:if test="$tex">
<xsl:text>\special{dvi2bitmap outputfile </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>} &#xA;</xsl:text>
<xsl:if test="$output.delims != 0">
<xsl:text>$</xsl:text>
</xsl:if>
<xsl:value-of select="$tex"/>
<xsl:if test="$output.delims != 0">
<xsl:text>$ &#xA;</xsl:text>
</xsl:if>
<xsl:text>\newpage &#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="equation|informalequation" mode="collect.tex.math.latex">
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="graphic">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select="graphic"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="select.mediaobject.filename">
<xsl:with-param name="olist" select="mediaobject/*"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="output.delims">
<xsl:call-template name="tex.math.output.delims"/>
</xsl:variable>
<xsl:variable name="tex" select="alt[@role='tex'] | mediaobject/textobject[@role='tex']"/>
<xsl:if test="$tex">
<xsl:text>\special{dvi2bitmap outputfile </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>} &#xA;</xsl:text>
<xsl:if test="$output.delims != 0">
<xsl:text>$$</xsl:text>
</xsl:if>
<xsl:value-of select="$tex"/>
<xsl:if test="$output.delims != 0">
<xsl:text>$$ &#xA;</xsl:text>
</xsl:if>
<xsl:text>\newpage &#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="text()" mode="collect.tex.math.latex"/>
<!-- Extracting image filename from mediaobject and graphic elements -->
<xsl:template name="select.mediaobject.filename">
<xsl:param name="olist"
select="imageobject|imageobjectco
|videoobject|audioobject|textobject"/>
<xsl:variable name="mediaobject.index">
<xsl:call-template name="select.mediaobject.index">
<xsl:with-param name="olist" select="$olist"/>
<xsl:with-param name="count" select="1"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$mediaobject.index != ''">
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object"
select="$olist[position() = $mediaobject.index]"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="tex.math.output.delims">
<xsl:variable name="pi.delims">
<xsl:call-template name="pi.dbtex_delims">
<xsl:with-param name="node" select="descendant-or-self::*"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="result">
<xsl:choose>
<xsl:when test="$pi.delims = 'no'">0</xsl:when>
<xsl:when test="$pi.delims = '' and $tex.math.delims = 0">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$result"/>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,202 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://icl.com/saxon"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="http://xml.apache.org/xalan/redirect"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
version="1.1"
exclude-result-prefixes="doc"
extension-element-prefixes="saxon redirect lxslt">
<!-- ********************************************************************
$Id: oldchunker.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- This stylesheet works with Saxon and Xalan; for XT use xtchunker.xsl -->
<!-- ==================================================================== -->
<xsl:param name="default.encoding" select="'ISO-8859-1'" doc:type='string'/>
<doc:param name="default.encoding" xmlns="">
<refpurpose>Encoding used in generated HTML pages</refpurpose>
<refdescription>
<para>This encoding is used in files generated by chunking stylesheet. Currently
only Saxon is able to change output encoding.
</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="saxon.character.representation" select="'entity;decimal'" doc:type='string'/>
<doc:param name="saxon.character.representation" xmlns="">
<refpurpose>Saxon character representation used in generated HTML pages</refpurpose>
<refdescription>
<para>This character representation is used in files generated by chunking stylesheet. If
you want to suppress entity references for characters with direct representation
in default.encoding, set this parameter to value <literal>native</literal>.
</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:template name="make-relative-filename">
<xsl:param name="base.dir" select="'./'"/>
<xsl:param name="base.name" select="''"/>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:choose>
<xsl:when test="contains($vendor, 'SAXON')">
<!-- Saxon doesn't make the chunks relative -->
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:when>
<xsl:when test="contains($vendor, 'Apache')">
<!-- Xalan doesn't make the chunks relative -->
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>Chunking isn't supported with </xsl:text>
<xsl:value-of select="$vendor"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="write.chunk">
<xsl:param name="filename" select="''"/>
<xsl:param name="method" select="'html'"/>
<xsl:param name="encoding" select="$default.encoding"/>
<xsl:param name="indent" select="'no'"/>
<xsl:param name="content" select="''"/>
<xsl:message>
<xsl:text>Writing </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:if test="name(.) != ''">
<xsl:text> for </xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:if test="@id">
<xsl:text>(</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:if>
</xsl:message>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:choose>
<xsl:when test="contains($vendor, 'SAXON 6.2')">
<!-- Saxon 6.2.x uses xsl:document -->
<xsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
saxon:character-representation="{$saxon.character.representation}">
<xsl:copy-of select="$content"/>
</xsl:document>
</xsl:when>
<xsl:when test="contains($vendor, 'SAXON')">
<!-- Saxon uses saxon:output -->
<saxon:output file="{$filename}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
saxon:character-representation="{$saxon.character.representation}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="contains($vendor, 'Apache')">
<!-- Xalan uses redirect -->
<redirect:write file="{$filename}">
<xsl:copy-of select="$content"/>
</redirect:write>
</xsl:when>
<xsl:otherwise>
<!-- it doesn't matter since we won't be making chunks... -->
<xsl:message terminate="yes">
<xsl:text>Can't make chunks with </xsl:text>
<xsl:value-of select="$vendor"/>
<xsl:text>'s processor.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="write.chunk.with.doctype">
<xsl:param name="filename" select="''"/>
<xsl:param name="method" select="'html'"/>
<xsl:param name="encoding" select="$default.encoding"/>
<xsl:param name="indent" select="'no'"/>
<xsl:param name="doctype-public" select="''"/>
<xsl:param name="doctype-system" select="''"/>
<xsl:param name="content" select="''"/>
<xsl:message>
<xsl:text>Writing </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:if test="name(.) != ''">
<xsl:text> for </xsl:text>
<xsl:value-of select="name(.)"/>
</xsl:if>
</xsl:message>
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:choose>
<xsl:when test="contains($vendor, 'SAXON 6.2')">
<!-- Saxon 6.2.x uses xsl:document -->
<xsl:document href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
saxon:character-representation="{$saxon.character.representation}">
<xsl:copy-of select="$content"/>
</xsl:document>
</xsl:when>
<xsl:when test="contains($vendor, 'SAXON')">
<!-- Saxon uses saxon:output -->
<saxon:output file="{$filename}"
href="{$filename}"
method="{$method}"
encoding="{$encoding}"
indent="{$indent}"
doctype-public="{$doctype-public}"
doctype-system="{$doctype-system}"
saxon:character-representation="{$saxon.character.representation}">
<xsl:copy-of select="$content"/>
</saxon:output>
</xsl:when>
<xsl:when test="contains($vendor, 'Apache')">
<!-- Xalan uses redirect -->
<redirect:write file="{$filename}">
<xsl:copy-of select="$content"/>
</redirect:write>
</xsl:when>
<xsl:otherwise>
<!-- it doesn't matter since we won't be making chunks... -->
<xsl:message terminate="yes">
<xsl:text>Can't make chunks with </xsl:text>
<xsl:value-of select="$vendor"/>
<xsl:text>'s processor.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
version="1.0"
exclude-result-prefixes="doc">
<!-- ********************************************************************
$Id: onechunk.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:import href="chunk.xsl"/>
<!-- Ok, using the onechunk parameter makes this all work again. -->
<!-- It does have the disadvantage that it only works for documents that have -->
<!-- a root element that is considered a chunk by the chunk.xsl stylesheet. -->
<!-- Ideally, onechunk would let anything be a chunk. But not today. -->
<xsl:param name="onechunk" select="1"/>
<xsl:param name="suppress.navigation">1</xsl:param>
<xsl:template name="href.target.uri">
<xsl:param name="object" select="."/>
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$object"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

10584
nping/docs/xsl/html/param.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,429 @@
<?xml version="1.0" encoding="ASCII"?>
<!-- This file is generated from param.xweb -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- ********************************************************************
$Id: param.xweb 8345 2009-03-16 06:44:07Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<xsl:param name="admon.graphics.extension">.png</xsl:param>
<xsl:param name="admon.graphics" select="0"/>
<xsl:param name="admon.graphics.path">images/</xsl:param>
<xsl:param name="admon.style">
<xsl:value-of select="concat('margin-', $direction.align.start, ': 0.5in; margin-', $direction.align.end, ': 0.5in;')"/>
</xsl:param>
<xsl:param name="admon.textlabel" select="1"/>
<xsl:param name="annotate.toc" select="1"/>
<xsl:param name="annotation.css">
/* ======================================================================
Annotations
*/
div.annotation-list { visibility: hidden;
}
div.annotation-nocss { position: absolute;
visibility: hidden;
}
div.annotation-popup { position: absolute;
z-index: 4;
visibility: hidden;
padding: 0px;
margin: 2px;
border-style: solid;
border-width: 1px;
width: 200px;
background-color: white;
}
div.annotation-title { padding: 1px;
font-weight: bold;
border-bottom-style: solid;
border-bottom-width: 1px;
color: white;
background-color: black;
}
div.annotation-body { padding: 2px;
}
div.annotation-body p { margin-top: 0px;
padding-top: 0px;
}
div.annotation-close { position: absolute;
top: 2px;
right: 2px;
}
</xsl:param>
<xsl:param name="annotation.js">
<xsl:text>http://docbook.sourceforge.net/release/script/AnchorPosition.js http://docbook.sourceforge.net/release/script/PopupWindow.js</xsl:text></xsl:param>
<xsl:param name="annotation.graphic.open">http://docbook.sourceforge.net/release/images/annot-open.png</xsl:param>
<xsl:param name="annotation.graphic.close">
http://docbook.sourceforge.net/release/images/annot-close.png</xsl:param>
<xsl:param name="annotation.support" select="0"/>
<xsl:param name="appendix.autolabel">A</xsl:param>
<xsl:param name="author.othername.in.middle" select="1"/>
<xsl:param name="autotoc.label.separator">. </xsl:param>
<xsl:param name="autotoc.label.in.hyperlink" select="1"/>
<xsl:param name="base.dir"/>
<xsl:param name="biblioentry.item.separator">. </xsl:param>
<xsl:param name="bibliography.collection">http://docbook.sourceforge.net/release/bibliography/bibliography.xml</xsl:param>
<xsl:param name="bibliography.numbered" select="0"/>
<xsl:param name="bibliography.style">normal</xsl:param>
<xsl:param name="blurb.on.titlepage.enabled" select="0"/>
<xsl:param name="bridgehead.in.toc" select="0"/>
<xsl:param name="callout.defaultcolumn">60</xsl:param>
<xsl:param name="callout.graphics.extension">.png</xsl:param>
<xsl:param name="callout.graphics" select="1"/>
<xsl:param name="callout.graphics.number.limit">15</xsl:param>
<xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
<xsl:param name="callout.list.table" select="1"/>
<xsl:param name="callout.unicode" select="0"/>
<xsl:param name="callout.unicode.number.limit">10</xsl:param>
<xsl:param name="callout.unicode.start.character">10102</xsl:param>
<xsl:param name="callouts.extension" select="1"/>
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="chunk.append"/>
<xsl:param name="chunk.first.sections" select="0"/>
<xsl:param name="chunk.quietly" select="0"/>
<xsl:param name="chunk.section.depth" select="1"/>
<xsl:param name="chunk.toc"/>
<xsl:param name="chunk.tocs.and.lots" select="0"/>
<xsl:param name="chunk.tocs.and.lots.has.title" select="1"/>
<xsl:param name="chunk.separate.lots" select="0"/>
<xsl:param name="citerefentry.link" select="0"/>
<xsl:param name="collect.xref.targets">no</xsl:param>
<xsl:param name="component.label.includes.part.label" select="0"/>
<xsl:param name="contrib.inline.enabled">1</xsl:param>
<xsl:param name="css.decoration" select="1"/>
<xsl:param name="current.docid"/>
<xsl:param name="default.float.class">
<xsl:choose>
<xsl:when test="contains($stylesheet.result.type,'html')">left</xsl:when>
<xsl:otherwise>before</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="default.image.width"/>
<xsl:param name="default.table.width"/>
<xsl:param name="default.table.frame">all</xsl:param>
<xsl:param name="draft.mode">maybe</xsl:param>
<xsl:param name="draft.watermark.image">http://docbook.sourceforge.net/release/images/draft.png</xsl:param>
<xsl:param name="ebnf.table.bgcolor">#F5DCB3</xsl:param>
<xsl:param name="ebnf.table.border" select="1"/>
<xsl:param name="ebnf.assignment">
<code>::=</code>
</xsl:param>
<xsl:param name="ebnf.statement.terminator"/>
<xsl:param name="eclipse.autolabel" select="0"/>
<xsl:param name="eclipse.plugin.name">DocBook Online Help Sample</xsl:param>
<xsl:param name="eclipse.plugin.id">com.example.help</xsl:param>
<xsl:param name="eclipse.plugin.provider">Example provider</xsl:param>
<xsl:param name="editedby.enabled">1</xsl:param>
<xsl:param name="email.delimiters.enabled" select="1"/>
<xsl:param name="emphasis.propagates.style" select="1"/>
<xsl:param name="entry.propagates.style" select="1"/>
<xsl:param name="exsl.node.set.available">
<xsl:choose>
<xsl:when xmlns:exsl="http://exslt.org/common" exsl:foo="" test="function-available('exsl:node-set') or contains(system-property('xsl:vendor'), 'Apache Software Foundation')">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="firstterm.only.link" select="0"/>
<xsl:param name="footer.rule" select="1"/>
<xsl:param name="footnote.number.format">1</xsl:param>
<xsl:param name="footnote.number.symbols"/>
<xsl:param name="formal.procedures" select="1"/>
<xsl:param name="formal.title.placement">
figure before
example before
equation before
table before
procedure before
task before
</xsl:param>
<xsl:param name="funcsynopsis.decoration" select="1"/>
<xsl:param name="funcsynopsis.style">kr</xsl:param>
<xsl:param name="function.parens" select="0"/>
<xsl:param name="generate.id.attributes" select="0"/>
<xsl:param name="generate.index" select="1"/>
<xsl:param name="generate.legalnotice.link" select="0"/>
<xsl:param name="generate.revhistory.link" select="0"/>
<xsl:param name="generate.manifest" select="0"/>
<xsl:param name="generate.meta.abstract" select="1"/>
<xsl:param name="generate.section.toc.level" select="0"/>
<xsl:param name="generate.toc">
appendix toc,title
article/appendix nop
article toc,title
book toc,title,figure,table,example,equation
chapter toc,title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
sect1 toc
sect2 toc
sect3 toc
sect4 toc
sect5 toc
section toc
set toc,title
</xsl:param>
<xsl:param name="glossary.collection"/>
<xsl:param name="glossary.sort" select="0"/>
<xsl:param name="glossentry.show.acronym">no</xsl:param>
<xsl:param name="glossterm.auto.link" select="0"/>
<xsl:param name="graphic.default.extension"/>
<xsl:param name="graphicsize.extension" select="1"/>
<xsl:param name="graphicsize.use.img.src.path" select="0"/>
<xsl:param name="header.rule" select="1"/>
<xsl:param name="highlight.default.language"/>
<xsl:param name="highlight.source" select="0"/>
<xsl:param name="highlight.xslthl.config"/>
<xsl:param name="html.append"/>
<xsl:param name="html.base"/>
<xsl:param name="html.cellpadding"/>
<xsl:param name="html.cellspacing"/>
<xsl:param name="html.cleanup" select="1"/>
<xsl:param name="html.ext">.html</xsl:param>
<xsl:param name="html.extra.head.links" select="0"/>
<xsl:param name="html.head.legalnotice.link.types">copyright</xsl:param>
<xsl:param name="html.head.legalnotice.link.multiple" select="1"/>
<xsl:param name="html.longdesc" select="1"/>
<xsl:param name="html.longdesc.link" select="$html.longdesc"/>
<xsl:param name="html.stylesheet"/>
<xsl:param name="html.stylesheet.type">text/css</xsl:param>
<xsl:param name="htmlhelp.alias.file">alias.h</xsl:param>
<xsl:param name="htmlhelp.autolabel" select="0"/>
<xsl:param name="htmlhelp.button.back" select="1"/>
<xsl:param name="htmlhelp.button.forward" select="0"/>
<xsl:param name="htmlhelp.button.hideshow" select="1"/>
<xsl:param name="htmlhelp.button.home" select="0"/>
<xsl:param name="htmlhelp.button.home.url"/>
<xsl:param name="htmlhelp.button.jump1" select="0"/>
<xsl:param name="htmlhelp.button.jump1.title">User1</xsl:param>
<xsl:param name="htmlhelp.button.jump1.url"/>
<xsl:param name="htmlhelp.button.jump2" select="0"/>
<xsl:param name="htmlhelp.button.jump2.title">User2</xsl:param>
<xsl:param name="htmlhelp.button.jump2.url"/>
<xsl:param name="htmlhelp.button.locate" select="0"/>
<xsl:param name="htmlhelp.button.next" select="1"/>
<xsl:param name="htmlhelp.button.options" select="1"/>
<xsl:param name="htmlhelp.button.prev" select="1"/>
<xsl:param name="htmlhelp.button.print" select="1"/>
<xsl:param name="htmlhelp.button.refresh" select="0"/>
<xsl:param name="htmlhelp.button.stop" select="0"/>
<xsl:param name="htmlhelp.button.zoom" select="0"/>
<xsl:param name="htmlhelp.chm">htmlhelp.chm</xsl:param>
<xsl:param name="htmlhelp.default.topic"/>
<xsl:param name="htmlhelp.display.progress" select="1"/>
<xsl:param name="htmlhelp.encoding">iso-8859-1</xsl:param>
<xsl:param name="htmlhelp.enhanced.decompilation" select="0"/>
<xsl:param name="htmlhelp.enumerate.images" select="0"/>
<xsl:param name="htmlhelp.force.map.and.alias" select="0"/>
<xsl:param name="htmlhelp.hhc.binary" select="1"/>
<xsl:param name="htmlhelp.hhc.folders.instead.books" select="1"/>
<xsl:param name="htmlhelp.hhc">toc.hhc</xsl:param>
<xsl:param name="htmlhelp.hhc.section.depth">5</xsl:param>
<xsl:param name="htmlhelp.hhc.show.root" select="1"/>
<xsl:param name="htmlhelp.hhc.width"/>
<xsl:param name="htmlhelp.hhk">index.hhk</xsl:param>
<xsl:param name="htmlhelp.hhp">htmlhelp.hhp</xsl:param>
<xsl:param name="htmlhelp.hhp.tail"/>
<xsl:param name="htmlhelp.hhp.window">Main</xsl:param>
<xsl:param name="htmlhelp.hhp.windows"/>
<xsl:param name="htmlhelp.map.file">context.h</xsl:param>
<xsl:param name="htmlhelp.only" select="0"/>
<xsl:param name="htmlhelp.remember.window.position" select="0"/>
<xsl:param name="htmlhelp.show.advanced.search" select="0"/>
<xsl:param name="htmlhelp.show.favorities" select="0"/>
<xsl:param name="htmlhelp.show.menu" select="0"/>
<xsl:param name="htmlhelp.show.toolbar.text" select="1"/>
<xsl:param name="htmlhelp.title"/>
<xsl:param name="htmlhelp.use.hhk" select="0"/>
<xsl:param name="htmlhelp.window.geometry"/>
<xsl:param name="img.src.path"/>
<xsl:param name="id.warnings" select="0"/>
<xsl:param name="index.method">basic</xsl:param>
<xsl:param name="index.on.role" select="0"/>
<xsl:param name="index.links.to.section" select="1"/>
<xsl:param name="index.on.type" select="0"/>
<xsl:param name="index.number.separator"/>
<xsl:param name="index.term.separator"/>
<xsl:param name="index.range.separator"/>
<xsl:param name="index.prefer.titleabbrev" select="0"/>
<xsl:param name="ignore.image.scaling" select="0"/>
<xsl:param name="inherit.keywords" select="1"/>
<xsl:param name="insert.xref.page.number">no</xsl:param>
<xsl:param name="javahelp.encoding">iso-8859-1</xsl:param>
<xsl:param name="keep.relative.image.uris" select="1"/>
<xsl:param name="l10n.gentext.default.language">en</xsl:param>
<xsl:param name="l10n.gentext.language"/>
<xsl:param name="l10n.gentext.use.xref.language" select="0"/>
<xsl:param name="l10n.lang.value.rfc.compliant" select="1"/>
<xsl:param name="label.from.part" select="0"/>
<xsl:param name="linenumbering.everyNth">5</xsl:param>
<xsl:param name="linenumbering.extension" select="1"/>
<xsl:param name="linenumbering.separator"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="linenumbering.width">3</xsl:param>
<xsl:param name="link.mailto.url"/>
<xsl:param name="make.graphic.viewport" select="1"/>
<xsl:param name="make.single.year.ranges" select="0"/>
<xsl:param name="make.valid.html" select="0"/>
<xsl:param name="make.year.ranges" select="0"/>
<xsl:param name="manifest">HTML.manifest</xsl:param>
<xsl:param name="manifest.in.base.dir" select="0"/>
<xsl:param name="manual.toc"/>
<xsl:param name="menuchoice.menu.separator"> &#8594; </xsl:param>
<xsl:param name="menuchoice.separator">+</xsl:param>
<xsl:param name="navig.graphics.extension">.gif</xsl:param>
<xsl:param name="navig.graphics" select="0"/>
<xsl:param name="navig.graphics.path">images/</xsl:param>
<xsl:param name="navig.showtitles">1</xsl:param>
<xsl:param name="nominal.image.depth" select="4 * $pixels.per.inch"/>
<xsl:param name="nominal.image.width" select="6 * $pixels.per.inch"/>
<xsl:param name="nominal.table.width">6in</xsl:param>
<xsl:param name="olink.base.uri"/>
<xsl:param name="olink.debug" select="0"/>
<xsl:attribute-set name="olink.properties">
<xsl:attribute name="show-destination">replace</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="insert.olink.page.number">no</xsl:param>
<xsl:param name="insert.olink.pdf.frag" select="0"/>
<xsl:param name="prefer.internal.olink" select="0"/>
<xsl:param name="olink.lang.fallback.sequence"/>
<xsl:param name="olink.doctitle">no</xsl:param>
<xsl:param name="olink.fragid">fragid=</xsl:param>
<xsl:param name="olink.outline.ext">.olink</xsl:param>
<xsl:param name="olink.pubid">pubid</xsl:param>
<xsl:param name="olink.resolver">/cgi-bin/olink</xsl:param>
<xsl:param name="olink.sysid">sysid</xsl:param>
<xsl:param name="abstract.notitle.enabled" select="0"/>
<xsl:param name="othercredit.like.author.enabled">0</xsl:param>
<xsl:param name="para.propagates.style" select="1"/>
<xsl:param name="part.autolabel">I</xsl:param>
<xsl:param name="phrase.propagates.style" select="1"/>
<xsl:param name="pixels.per.inch">90</xsl:param>
<xsl:param name="points.per.em">10</xsl:param>
<xsl:param name="preface.autolabel" select="0"/>
<xsl:param name="preferred.mediaobject.role"/>
<xsl:param name="process.empty.source.toc" select="0"/>
<xsl:param name="process.source.toc" select="0"/>
<xsl:param name="profile.arch"/>
<xsl:param name="profile.audience"/>
<xsl:param name="profile.attribute"/>
<xsl:param name="profile.condition"/>
<xsl:param name="profile.conformance"/>
<xsl:param name="profile.lang"/>
<xsl:param name="profile.os"/>
<xsl:param name="profile.revision"/>
<xsl:param name="profile.revisionflag"/>
<xsl:param name="profile.role"/>
<xsl:param name="profile.security"/>
<xsl:param name="profile.separator">;</xsl:param>
<xsl:param name="profile.status"/>
<xsl:param name="profile.userlevel"/>
<xsl:param name="profile.value"/>
<xsl:param name="profile.vendor"/>
<xsl:param name="profile.wordsize"/>
<xsl:param name="punct.honorific">.</xsl:param>
<xsl:param name="qanda.defaultlabel">number</xsl:param>
<xsl:param name="qanda.inherit.numeration" select="1"/>
<xsl:param name="qanda.in.toc" select="0"/>
<xsl:param name="qanda.nested.in.toc" select="0"/>
<xsl:param name="qandadiv.autolabel" select="1"/>
<xsl:param name="refentry.generate.name" select="1"/>
<xsl:param name="refentry.generate.title" select="0"/>
<xsl:param name="refentry.separator" select="1"/>
<xsl:param name="refentry.xref.manvolnum" select="1"/>
<xsl:param name="reference.autolabel">I</xsl:param>
<xsl:param name="refclass.suppress" select="0"/>
<xsl:param name="root.filename">index</xsl:param>
<xsl:param name="rootid"/>
<xsl:param name="runinhead.default.title.end.punct">.</xsl:param>
<xsl:param name="runinhead.title.end.punct">.!?:</xsl:param>
<xsl:param name="section.autolabel" select="0"/>
<xsl:param name="section.autolabel.max.depth">8</xsl:param>
<xsl:param name="section.label.includes.component.label" select="0"/>
<xsl:param name="segmentedlist.as.table" select="0"/>
<xsl:param name="shade.verbatim" select="0"/>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="bgcolor">#E0E0E0</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="show.comments" select="1"/>
<xsl:param name="show.revisionflag" select="0"/>
<xsl:param name="simplesect.in.toc" select="0"/>
<xsl:param name="spacing.paras" select="0"/>
<xsl:param name="suppress.footer.navigation">0</xsl:param>
<xsl:param name="suppress.header.navigation" select="0"/>
<xsl:param name="suppress.navigation" select="0"/>
<xsl:param name="table.borders.with.css" select="0"/>
<xsl:param name="table.cell.border.color"/>
<xsl:param name="table.cell.border.style">solid</xsl:param>
<xsl:param name="table.cell.border.thickness">0.5pt</xsl:param>
<xsl:param name="table.footnote.number.format">a</xsl:param>
<xsl:param name="table.footnote.number.symbols"/>
<xsl:param name="table.frame.border.color"/>
<xsl:param name="table.frame.border.style">solid</xsl:param>
<xsl:param name="table.frame.border.thickness">0.5pt</xsl:param>
<xsl:param name="tablecolumns.extension" select="1"/>
<xsl:param name="target.database.document">olinkdb.xml</xsl:param>
<xsl:param name="targets.filename">target.db</xsl:param>
<xsl:param name="textdata.default.encoding"/>
<xsl:param name="tex.math.delims" select="1"/>
<xsl:param name="tex.math.file">tex-math-equations.tex</xsl:param>
<xsl:param name="tex.math.in.alt"/>
<xsl:param name="textinsert.extension" select="1"/>
<xsl:param name="toc.list.type">dl</xsl:param>
<xsl:param name="toc.section.depth">2</xsl:param>
<xsl:param name="toc.max.depth">8</xsl:param>
<xsl:param name="ulink.target">_top</xsl:param>
<xsl:param name="use.embed.for.svg" select="0"/>
<xsl:param name="use.extensions" select="0"/>
<xsl:param name="use.id.as.filename" select="0"/>
<xsl:param name="use.local.olink.style" select="0"/>
<xsl:param name="use.role.as.xrefstyle" select="1"/>
<xsl:param name="use.role.for.mediaobject" select="1"/>
<xsl:param name="use.svg" select="1"/>
<xsl:param name="variablelist.as.table" select="0"/>
<xsl:param name="variablelist.term.separator">, </xsl:param>
<xsl:param name="variablelist.term.break.after">0</xsl:param>
<xsl:param name="writing.mode">
<xsl:call-template name="gentext">
<xsl:with-param name="key">writing-mode</xsl:with-param>
<xsl:with-param name="lang">
<xsl:call-template name="l10n.language">
<xsl:with-param name="target" select="/*[1]"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<xsl:param name="xref.with.number.and.title" select="1"/>
<xsl:param name="xref.label-title.separator">: </xsl:param>
<xsl:param name="xref.label-page.separator"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="xref.title-page.separator"><xsl:text> </xsl:text></xsl:param>
</xsl:stylesheet>

1113
nping/docs/xsl/html/pi.xml Normal file

File diff suppressed because it is too large Load Diff

1263
nping/docs/xsl/html/pi.xsl Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,608 @@
<?xml version="1.0" encoding="US-ASCII"?>
<!--This file was created automatically by xsl2profile-->
<!--from the DocBook XSL stylesheets.-->
<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:exslt="http://exslt.org/common" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="exsl cf ng db exslt" version="1.0">
<!-- ********************************************************************
$Id: chunk-code.xsl 8345 2009-03-16 06:44:07Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="*" mode="chunk-filename">
<!-- returns the filename of a chunk -->
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:variable name="fn">
<xsl:apply-templates select="." mode="recursive-chunk-filename"/>
</xsl:variable>
<!--
<xsl:message>
<xsl:value-of select="$ischunk"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text>) </xsl:text>
<xsl:value-of select="$fn"/>
<xsl:text>, </xsl:text>
<xsl:call-template name="dbhtml-dir"/>
</xsl:message>
-->
<!-- 2003-11-25 by ndw:
The following test used to read test="$ischunk != 0 and $fn != ''"
I've removed the ischunk part of the test so that href.to.uri and
href.from.uri will be fully qualified even if the source or target
isn't a chunk. I *think* that if $fn != '' then it's appropriate
to put the directory on the front, even if the element isn't a
chunk. I could be wrong. -->
<xsl:if test="$fn != ''">
<xsl:call-template name="dbhtml-dir"/>
</xsl:if>
<xsl:value-of select="$fn"/>
<!-- You can't add the html.ext here because dbhtml filename= may already -->
<!-- have added it. It really does have to be handled in the recursive template -->
</xsl:template>
<xsl:template match="*" mode="recursive-chunk-filename">
<xsl:param name="recursive" select="false()"/>
<!-- returns the filename of a chunk -->
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:variable name="dbhtml-filename">
<xsl:call-template name="pi.dbhtml_filename"/>
</xsl:variable>
<xsl:variable name="filename">
<xsl:choose>
<xsl:when test="$dbhtml-filename != ''">
<xsl:value-of select="$dbhtml-filename"/>
</xsl:when>
<!-- if this is the root element, use the root.filename -->
<xsl:when test="not(parent::*) and $root.filename != ''">
<xsl:value-of select="$root.filename"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<!-- Special case -->
<xsl:when test="self::legalnotice and not($generate.legalnotice.link = 0)">
<xsl:choose>
<xsl:when test="(@id or @xml:id) and not($use.id.as.filename = 0)">
<!-- * if this legalnotice has an ID, then go ahead and use -->
<!-- * just the value of that ID as the basename for the file -->
<!-- * (that is, without prepending an "ln-" too it) -->
<xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<xsl:otherwise>
<!-- * otherwise, if this legalnotice does not have an ID, -->
<!-- * then we generate an ID... -->
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<!-- * ...and then we take that generated ID, prepend an -->
<!-- * "ln-" to it, and use that as the basename for the file -->
<xsl:value-of select="concat('ln-',$id,$html.ext)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- if there's no dbhtml filename, and if we're to use IDs as -->
<!-- filenames, then use the ID to generate the filename. -->
<xsl:when test="(@id or @xml:id) and $use.id.as.filename != 0">
<xsl:value-of select="(@id|@xml:id)[1]"/>
<xsl:value-of select="$html.ext"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$ischunk='0'">
<!-- if called on something that isn't a chunk, walk up... -->
<xsl:choose>
<xsl:when test="count(parent::*)&gt;0">
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="$recursive"/>
</xsl:apply-templates>
</xsl:when>
<!-- unless there is no up, in which case return "" -->
<xsl:otherwise/>
</xsl:choose>
</xsl:when>
<xsl:when test="not($recursive) and $filename != ''">
<!-- if this chunk has an explicit name, use it -->
<xsl:value-of select="$filename"/>
</xsl:when>
<xsl:when test="self::set">
<xsl:value-of select="$root.filename"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::book">
<xsl:text>bk</xsl:text>
<xsl:number level="any" format="01"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::article">
<xsl:if test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:if>
<xsl:text>ar</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::preface">
<xsl:if test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:if>
<xsl:text>pr</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::chapter">
<xsl:if test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:if>
<xsl:text>ch</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::appendix">
<xsl:if test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:if>
<xsl:text>ap</xsl:text>
<xsl:number level="any" format="a" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::part">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>pt</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::reference">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>rn</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::refentry">
<xsl:choose>
<xsl:when test="parent::reference">
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>re</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::colophon">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>co</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::sect1 or self::sect2 or self::sect3 or self::sect4 or self::sect5 or self::section">
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
<xsl:text>s</xsl:text>
<xsl:number format="01"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::bibliography">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>bi</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::glossary">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>go</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::index">
<xsl:choose>
<xsl:when test="/set">
<!-- in a set, make sure we inherit the right book info... -->
<xsl:apply-templates mode="recursive-chunk-filename" select="parent::*">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:text>ix</xsl:text>
<xsl:number level="any" format="01" from="book"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:when test="self::setindex">
<xsl:text>si</xsl:text>
<xsl:number level="any" format="01" from="set"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>chunk-filename-error-</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:number level="any" format="01" from="set"/>
<xsl:if test="not($recursive)">
<xsl:value-of select="$html.ext"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="processing-instruction('dbhtml')">
<!-- nop -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="*" mode="find.chunks">
<xsl:variable name="chunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$chunk != 0">
<cf:div id="{generate-id()}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:apply-templates select="*" mode="find.chunks"/>
</cf:div>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*" mode="find.chunks"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xslo:include xmlns:xslo="http://www.w3.org/1999/XSL/Transform" href="../profiling/profile-mode.xsl"/><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content"><xslo:choose><xslo:when test="*/self::ng:* or */self::db:*"><xslo:message>Note: namesp. cut : stripped namespace before processing</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>Note: namesp. cut : processing stripped document</xslo:message><xslo:apply-templates select="exslt:node-set($stripped-content)" mode="profile"/></xslo:when><xslo:otherwise><xslo:apply-templates select="/" mode="profile"/></xslo:otherwise></xslo:choose></xslo:variable><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" select="exslt:node-set($profiled-content)"/><xsl:template match="/">
<!-- * Get a title for current doc so that we let the user -->
<!-- * know what document we are processing at this point. -->
<xsl:variable name="doc.title">
<xsl:call-template name="get.doc.title"/>
</xsl:variable>
<xsl:choose>
<!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
toss the namespace and continue. Use the docbook5 namespaced
stylesheets for DocBook5 if you don't want to use this feature.-->
<xsl:when test="false()"/>
<!-- Can't process unless namespace removed -->
<xsl:when test="false()"/>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$rootid != ''">
<xsl:choose>
<xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
<xsl:message terminate="yes">
<xsl:text>ID '</xsl:text>
<xsl:value-of select="$rootid"/>
<xsl:text>' not found in document.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
<xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
</xsl:if>
<xsl:if test="$generate.manifest != 0">
<xsl:call-template name="generate.manifest">
<xsl:with-param name="node" select="key('id',$rootid)"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
<xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
</xsl:if>
<xsl:if test="$generate.manifest != 0">
<xsl:call-template name="generate.manifest">
<xsl:with-param name="node" select="$profiled-nodes"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="process.root">
<xsl:apply-templates select="."/>
</xsl:template>
<!-- ====================================================================== -->
<xsl:template match="set|book|part|preface|chapter|appendix |article |reference|refentry |book/glossary|article/glossary|part/glossary |book/bibliography|article/bibliography|part/bibliography |colophon">
<xsl:choose>
<xsl:when test="$onechunk != 0 and parent::*">
<xsl:apply-imports/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="process-chunk-element"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="sect1|sect2|sect3|sect4|sect5|section">
<xsl:variable name="ischunk">
<xsl:call-template name="chunk"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="not(parent::*)">
<xsl:call-template name="process-chunk-element"/>
</xsl:when>
<xsl:when test="$ischunk = 0">
<xsl:apply-imports/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="process-chunk-element"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="setindex |book/index |article/index |part/index">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. -->
<xsl:if test="count(*)&gt;0 or $generate.index != '0'">
<xsl:call-template name="process-chunk-element"/>
</xsl:if>
</xsl:template>
<!-- Resolve xml:base attributes -->
<xsl:template match="@fileref">
<!-- need a check for absolute urls -->
<xsl:choose>
<xsl:when test="contains(., ':')">
<!-- it has a uri scheme so it is an absolute uri -->
<xsl:value-of select="."/>
</xsl:when>
<xsl:when test="$keep.relative.image.uris != 0">
<!-- leave it alone -->
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<!-- its a relative uri -->
<xsl:call-template name="relative-uri">
<xsl:with-param name="destdir">
<xsl:call-template name="dbhtml-dir">
<xsl:with-param name="context" select=".."/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="set|book|part|preface|chapter|appendix |article |reference|refentry |sect1|sect2|sect3|sect4|sect5 |section |book/glossary|article/glossary|part/glossary |book/bibliography|article/bibliography|part/bibliography |colophon" mode="enumerate-files">
<xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
<xsl:if test="$ischunk='1'">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir">
<xsl:if test="$manifest.in.base.dir = 0">
<xsl:value-of select="$base.dir"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="base.name">
<xsl:apply-templates mode="chunk-filename" select="."/>
</xsl:with-param>
</xsl:call-template>
<xsl:text>
</xsl:text>
</xsl:if>
<xsl:apply-templates select="*" mode="enumerate-files"/>
</xsl:template>
<xsl:template match="book/index|article/index|part/index" mode="enumerate-files">
<xsl:if test="$htmlhelp.output != 1">
<xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable>
<xsl:if test="$ischunk='1'">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir">
<xsl:if test="$manifest.in.base.dir = 0">
<xsl:value-of select="$base.dir"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="base.name">
<xsl:apply-templates mode="chunk-filename" select="."/>
</xsl:with-param>
</xsl:call-template>
<xsl:text>
</xsl:text>
</xsl:if>
<xsl:apply-templates select="*" mode="enumerate-files"/>
</xsl:if>
</xsl:template>
<xsl:template match="legalnotice" mode="enumerate-files">
<xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
<xsl:if test="$generate.legalnotice.link != 0">
<xsl:call-template name="make-relative-filename">
<xsl:with-param name="base.dir">
<xsl:if test="$manifest.in.base.dir = 0">
<xsl:value-of select="$base.dir"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="base.name">
<xsl:apply-templates mode="chunk-filename" select="."/>
</xsl:with-param>
</xsl:call-template>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="mediaobject[imageobject] | inlinemediaobject[imageobject]" mode="enumerate-files">
<xsl:variable name="longdesc.uri">
<xsl:call-template name="longdesc.uri">
<xsl:with-param name="mediaobject" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="mediaobject" select="."/>
<xsl:if test="$html.longdesc != 0 and $mediaobject/textobject[not(phrase)]">
<xsl:call-template name="longdesc.uri">
<xsl:with-param name="mediaobject" select="$mediaobject"/>
</xsl:call-template>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="text()" mode="enumerate-files">
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,52 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
version="1.0"
exclude-result-prefixes="exsl">
<!-- ********************************************************************
$Id: profile-chunk.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<!-- First import the non-chunking templates that format elements
within each chunk file. In a customization, you should
create a separate non-chunking customization layer such
as mydocbook.xsl that imports the original docbook.xsl and
customizes any presentation templates. Then your chunking
customization should import mydocbook.xsl instead of
docbook.xsl. -->
<xsl:import href="docbook.xsl"/>
<!-- chunk-common.xsl contains all the named templates for chunking.
In a customization file, you import chunk-common.xsl, then
add any customized chunking templates of the same name.
They will have import precedence over the original
chunking templates in chunk-common.xsl. -->
<xsl:import href="chunk-common.xsl"/>
<!-- The manifest.xsl module is no longer imported because its
templates were moved into chunk-common and chunk-code -->
<!-- chunk-code.xsl contains all the chunking templates that use
a match attribute. In a customization it should be referenced
using <xsl:include> instead of <xsl:import>, and then add
any customized chunking templates with match attributes. But be sure
to add a priority="1" to such customized templates to resolve
its conflict with the original, since they have the
same import precedence.
Using xsl:include prevents adding another layer
of import precedence, which would cause any
customizations that use xsl:apply-imports to wrongly
apply the chunking version instead of the original
non-chunking version to format an element. -->
<xsl:include href="profile-chunk-code.xsl"/>
</xsl:stylesheet>

View File

@@ -0,0 +1,414 @@
<?xml version="1.0" encoding="US-ASCII"?>
<!--This file was created automatically by xsl2profile-->
<!--from the DocBook XSL stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns:exsl="http://exslt.org/common" xmlns:exslt="http://exslt.org/common" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="db ng exsl exslt exslt" version="1.0">
<xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
<!-- ********************************************************************
$Id: docbook.xsl 8399 2009-04-08 07:37:42Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:include href="../VERSION"/>
<xsl:include href="param.xsl"/>
<xsl:include href="../lib/lib.xsl"/>
<xsl:include href="../common/l10n.xsl"/>
<xsl:include href="../common/common.xsl"/>
<xsl:include href="../common/utility.xsl"/>
<xsl:include href="../common/labels.xsl"/>
<xsl:include href="../common/titles.xsl"/>
<xsl:include href="../common/subtitles.xsl"/>
<xsl:include href="../common/gentext.xsl"/>
<xsl:include href="../common/targets.xsl"/>
<xsl:include href="../common/olink.xsl"/>
<xsl:include href="../common/pi.xsl"/>
<xsl:include href="autotoc.xsl"/>
<xsl:include href="autoidx.xsl"/>
<xsl:include href="lists.xsl"/>
<xsl:include href="callout.xsl"/>
<xsl:include href="verbatim.xsl"/>
<xsl:include href="graphics.xsl"/>
<xsl:include href="xref.xsl"/>
<xsl:include href="formal.xsl"/>
<xsl:include href="table.xsl"/>
<xsl:include href="htmltbl.xsl"/>
<xsl:include href="sections.xsl"/>
<xsl:include href="inline.xsl"/>
<xsl:include href="footnote.xsl"/>
<xsl:include href="html.xsl"/>
<xsl:include href="info.xsl"/>
<xsl:include href="keywords.xsl"/>
<xsl:include href="division.xsl"/>
<xsl:include href="toc.xsl"/>
<xsl:include href="index.xsl"/>
<xsl:include href="refentry.xsl"/>
<xsl:include href="math.xsl"/>
<xsl:include href="admon.xsl"/>
<xsl:include href="component.xsl"/>
<xsl:include href="biblio.xsl"/>
<xsl:include href="biblio-iso690.xsl"/>
<xsl:include href="glossary.xsl"/>
<xsl:include href="block.xsl"/>
<xsl:include href="task.xsl"/>
<xsl:include href="qandaset.xsl"/>
<xsl:include href="synop.xsl"/>
<xsl:include href="titlepage.xsl"/>
<xsl:include href="titlepage.templates.xsl"/>
<xsl:include href="pi.xsl"/>
<xsl:include href="ebnf.xsl"/>
<xsl:include href="chunker.xsl"/>
<xsl:include href="html-rtf.xsl"/>
<xsl:include href="annotations.xsl"/>
<xsl:include href="../common/stripns.xsl"/>
<xsl:param name="stylesheet.result.type" select="'html'"/>
<xsl:param name="htmlhelp.output" select="0"/>
<!-- ==================================================================== -->
<xsl:key name="id" match="*" use="@id|@xml:id"/>
<xsl:key name="gid" match="*" use="generate-id()"/>
<!-- ==================================================================== -->
<xsl:template match="*">
<xsl:message>
<xsl:text>Element </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> in namespace '</xsl:text>
<xsl:value-of select="namespace-uri(.)"/>
<xsl:text>' encountered</xsl:text>
<xsl:if test="parent::*">
<xsl:text> in </xsl:text>
<xsl:value-of select="name(parent::*)"/>
</xsl:if>
<xsl:text>, but no template matches.</xsl:text>
</xsl:message>
<span style="color: red">
<xsl:text>&lt;</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>&gt;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&lt;/</xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text>&gt;</xsl:text>
</span>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template name="body.attributes">
<xsl:attribute name="bgcolor">white</xsl:attribute>
<xsl:attribute name="text">black</xsl:attribute>
<xsl:attribute name="link">#0000FF</xsl:attribute>
<xsl:attribute name="vlink">#840084</xsl:attribute>
<xsl:attribute name="alink">#0000FF</xsl:attribute>
<xsl:if test="starts-with($writing.mode, 'rl')">
<xsl:attribute name="dir">rtl</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="head.content">
<xsl:param name="node" select="."/>
<xsl:param name="title">
<xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
</xsl:param>
<title>
<xsl:copy-of select="$title"/>
</title>
<xsl:if test="$html.stylesheet != ''">
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$link.mailto.url != ''">
<link rev="made" href="{$link.mailto.url}"/>
</xsl:if>
<xsl:if test="$html.base != ''">
<base href="{$html.base}"/>
</xsl:if>
<meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
<xsl:if test="$generate.meta.abstract != 0">
<xsl:variable name="info" select="(articleinfo |bookinfo |prefaceinfo |chapterinfo |appendixinfo |sectioninfo |sect1info |sect2info |sect3info |sect4info |sect5info |referenceinfo |refentryinfo |partinfo |info |docinfo)[1]"/>
<xsl:if test="$info and $info/abstract">
<meta name="description">
<xsl:attribute name="content">
<xsl:for-each select="$info/abstract[1]/*">
<xsl:value-of select="normalize-space(.)"/>
<xsl:if test="position() &lt; last()">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:attribute>
</meta>
</xsl:if>
</xsl:if>
<xsl:if test="($draft.mode = 'yes' or ($draft.mode = 'maybe' and ancestor-or-self::*[@status][1]/@status = 'draft')) and $draft.watermark.image != ''">
<style type="text/css"><xsl:text>
body { background-image: url('</xsl:text>
<xsl:value-of select="$draft.watermark.image"/><xsl:text>');
background-repeat: no-repeat;
background-position: top left;
/* The following properties make the watermark "fixed" on the page. */
/* I think that's just a bit too distracting for the reader... */
/* background-attachment: fixed; */
/* background-position: center center; */
}</xsl:text>
</style>
</xsl:if>
<xsl:apply-templates select="." mode="head.keywords.content"/>
</xsl:template>
<xsl:template name="output.html.stylesheets">
<xsl:param name="stylesheets" select="''"/>
<xsl:choose>
<xsl:when test="contains($stylesheets, ' ')">
<link rel="stylesheet" href="{substring-before($stylesheets, ' ')}">
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
<xsl:call-template name="output.html.stylesheets">
<xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$stylesheets != ''">
<link rel="stylesheet" href="{$stylesheets}">
<xsl:if test="$html.stylesheet.type != ''">
<xsl:attribute name="type">
<xsl:value-of select="$html.stylesheet.type"/>
</xsl:attribute>
</xsl:if>
</link>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- ============================================================ -->
<xsl:template match="*" mode="head.keywords.content">
<xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="setinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="artheader/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect1info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect2info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect3info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect4info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sect5info/keywordset" mode="html.header"/>
<xsl:apply-templates select="sectioninfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
<xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
<xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
<xsl:apply-templates select="info/keywordset" mode="html.header"/>
<xsl:if test="$inherit.keywords != 0 and parent::*">
<xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
</xsl:if>
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="system.head.content">
<xsl:param name="node" select="."/>
<!-- FIXME: When chunking, only the annotations actually used
in this chunk should be referenced. I don't think it
does any harm to reference them all, but it adds
unnecessary bloat to each chunk. -->
<xsl:if test="$annotation.support != 0 and //annotation">
<xsl:call-template name="add.annotation.links"/>
<script type="text/javascript">
<xsl:text>
// Create PopupWindow objects</xsl:text>
<xsl:for-each select="//annotation">
<xsl:text>
var popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text> = new PopupWindow("popup-</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>");
</xsl:text>
<xsl:text>popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>.offsetY = 15;
</xsl:text>
<xsl:text>popup_</xsl:text>
<xsl:value-of select="generate-id(.)"/>
<xsl:text>.autoHide();
</xsl:text>
</xsl:for-each>
</script>
<style type="text/css">
<xsl:value-of select="$annotation.css"/>
</style>
</xsl:if>
<!-- system.head.content is like user.head.content, except that
it is called before head.content. This is important because it
means, for example, that <style> elements output by system.head.content
have a lower CSS precedence than the users stylesheet. -->
</xsl:template>
<!-- ============================================================ -->
<xsl:template name="user.preroot">
<!-- Pre-root output, can be used to output comments and PIs. -->
<!-- This must not output any element content! -->
</xsl:template>
<xsl:template name="user.head.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.header.navigation">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.header.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.footer.content">
<xsl:param name="node" select="."/>
</xsl:template>
<xsl:template name="user.footer.navigation">
<xsl:param name="node" select="."/>
</xsl:template>
<xslo:include xmlns:xslo="http://www.w3.org/1999/XSL/Transform" href="../profiling/profile-mode.xsl"/><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content"><xslo:choose><xslo:when test="*/self::ng:* or */self::db:*"><xslo:message>Note: namesp. cut : stripped namespace before processing</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>Note: namesp. cut : processing stripped document</xslo:message><xslo:apply-templates select="exslt:node-set($stripped-content)" mode="profile"/></xslo:when><xslo:otherwise><xslo:apply-templates select="/" mode="profile"/></xslo:otherwise></xslo:choose></xslo:variable><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" select="exslt:node-set($profiled-content)"/><xsl:template match="/">
<!-- * Get a title for current doc so that we let the user -->
<!-- * know what document we are processing at this point. -->
<xsl:variable name="doc.title">
<xsl:call-template name="get.doc.title"/>
</xsl:variable>
<xsl:choose>
<!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
toss the namespace and continue. Use the docbook5 namespaced
stylesheets for DocBook5 if you don't want to use this feature.-->
<!-- include extra test for Xalan quirk -->
<xsl:when test="false()"/>
<!-- Can't process unless namespace removed -->
<xsl:when test="false()"/>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$rootid != ''">
<xsl:choose>
<xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
<xsl:message terminate="yes">
<xsl:text>ID '</xsl:text>
<xsl:value-of select="$rootid"/>
<xsl:text>' not found in document.</xsl:text>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
<xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
<xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
<xsl:if test="$tex.math.in.alt != ''">
<xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="process.root">
<xsl:variable name="doc" select="self::*"/>
<xsl:call-template name="user.preroot"/>
<xsl:call-template name="root.messages"/>
<html>
<head>
<xsl:call-template name="system.head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:call-template name="head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:call-template name="user.head.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
</head>
<body>
<xsl:call-template name="body.attributes"/>
<xsl:call-template name="user.header.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
<xsl:apply-templates select="."/>
<xsl:call-template name="user.footer.content">
<xsl:with-param name="node" select="$doc"/>
</xsl:call-template>
</body>
</html>
<xsl:value-of select="$html.append"/>
</xsl:template>
<xsl:template name="root.messages">
<!-- redefine this any way you'd like to output messages -->
<!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="chunk">
<xsl:param name="node" select="."/>
<!-- The default is that we are not chunking... -->
<xsl:text>0</xsl:text>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
version="1.0"
exclude-result-prefixes="doc">
<!-- ********************************************************************
$Id: profile-onechunk.xsl 6910 2007-06-28 23:23:30Z xmldoc $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:import href="profile-chunk.xsl"/>
<!-- Ok, using the onechunk parameter makes this all work again. -->
<!-- It does have the disadvantage that it only works for documents that have -->
<!-- a root element that is considered a chunk by the chunk.xsl stylesheet. -->
<!-- Ideally, onechunk would let anything be a chunk. But not today. -->
<xsl:param name="onechunk" select="1"/>
<xsl:param name="suppress.navigation">1</xsl:param>
<xsl:template name="href.target.uri">
<xsl:param name="object" select="."/>
<xsl:text>#</xsl:text>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$object"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,437 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
exclude-result-prefixes="doc"
version='1.0'>
<!-- ********************************************************************
$Id: qandaset.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="qandaset">
<xsl:variable name="title" select="(blockinfo/title|info/title|title)[1]"/>
<xsl:variable name="preamble" select="*[local-name(.) != 'title'
and local-name(.) != 'titleabbrev'
and local-name(.) != 'qandadiv'
and local-name(.) != 'qandaentry']"/>
<xsl:variable name="toc">
<xsl:call-template name="pi.dbhtml_toc"/>
</xsl:variable>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="$title"/>
<xsl:if test="not($title)">
<!-- id is output on title if there is one -->
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1')
and not(ancestor::answer and not($qanda.nested.in.toc=0))">
<xsl:call-template name="process.qanda.toc"/>
</xsl:if>
<xsl:apply-templates select="$preamble"/>
<xsl:call-template name="process.qandaset"/>
</div>
</xsl:template>
<xsl:template match="qandaset/blockinfo/title|
qandaset/info/title|
qandaset/title">
<xsl:variable name="qalevel">
<xsl:call-template name="qanda.section.level"/>
</xsl:variable>
<xsl:element name="h{string(number($qalevel)+1)}">
<xsl:attribute name="class">
<xsl:value-of select="local-name(.)"/>
</xsl:attribute>
<xsl:call-template name="anchor">
<xsl:with-param name="node" select=".."/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="qandaset/blockinfo|qandaset/info">
<!-- what should this template really do? -->
<xsl:apply-templates select="legalnotice" mode="titlepage.mode"/>
</xsl:template>
<xsl:template match="qandadiv">
<xsl:variable name="preamble" select="*[local-name(.) != 'title'
and local-name(.) != 'titleabbrev'
and local-name(.) != 'qandadiv'
and local-name(.) != 'qandaentry']"/>
<xsl:if test="blockinfo/title|info/title|title">
<tr class="qandadiv">
<td align="{$direction.align.start}" valign="top" colspan="2">
<xsl:apply-templates select="(blockinfo/title|info/title|title)[1]"/>
</td>
</tr>
</xsl:if>
<xsl:variable name="toc">
<xsl:call-template name="pi.dbhtml_toc"/>
</xsl:variable>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
<tr class="toc">
<td align="{$direction.align.start}" valign="top" colspan="2">
<xsl:call-template name="process.qanda.toc"/>
</td>
</tr>
</xsl:if>
<xsl:if test="$preamble">
<tr class="toc">
<td align="{$direction.align.start}" valign="top" colspan="2">
<xsl:apply-templates select="$preamble"/>
</td>
</tr>
</xsl:if>
<xsl:apply-templates select="qandadiv|qandaentry"/>
</xsl:template>
<xsl:template match="qandadiv/blockinfo/title|
qandadiv/info/title|
qandadiv/title">
<xsl:variable name="qalevel">
<xsl:call-template name="qandadiv.section.level"/>
</xsl:variable>
<xsl:element name="h{string(number($qalevel)+1)}">
<xsl:attribute name="class">
<xsl:value-of select="local-name(.)"/>
</xsl:attribute>
<xsl:call-template name="anchor">
<xsl:with-param name="node" select=".."/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
<xsl:if test="$qandadiv.autolabel != 0">
<xsl:apply-templates select="." mode="intralabel.punctuation"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="qandaentry">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="question">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<tr>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<td align="{$direction.align.start}" valign="top">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select=".."/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:variable name="label.content">
<xsl:apply-templates select="." mode="qanda.label"/>
</xsl:variable>
<xsl:if test="string-length($label.content) &gt; 0">
<p><b>
<xsl:copy-of select="$label.content"/>
</b></p>
</xsl:if>
</td>
<td align="{$direction.align.start}" valign="top">
<xsl:choose>
<xsl:when test="$deflabel = 'none' and not(label)">
<b><xsl:apply-templates select="*[local-name(.) != 'label']"/></b>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[local-name(.) != 'label']"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template match="*" mode="qanda.defaultlabel">
<xsl:choose>
<xsl:when test="ancestor-or-self::*[@defaultlabel]">
<xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
/@defaultlabel"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$qanda.defaultlabel"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="question" mode="qanda.label">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<xsl:apply-templates select="." mode="label.markup"/>
<xsl:if test="contains($deflabel, 'number') and not(label)">
<xsl:apply-templates select="." mode="intralabel.punctuation"/>
</xsl:if>
</xsl:template>
<xsl:template match="answer">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<tr class="{local-name(.)}">
<td align="{$direction.align.start}" valign="top">
<xsl:call-template name="anchor"/>
<xsl:variable name="answer.label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:if test="string-length($answer.label) &gt; 0">
<p><b>
<xsl:copy-of select="$answer.label"/>
</b></p>
</xsl:if>
</td>
<td align="{$direction.align.start}" valign="top">
<xsl:apply-templates select="*[local-name(.) != 'label'
and local-name(.) != 'qandaentry']"/>
<!-- * handle nested answer/qandaentry instances -->
<!-- * (bug 1509043 from Daniel Leidert) -->
<xsl:if test="descendant::question">
<xsl:call-template name="process.qandaset"/>
</xsl:if>
</td>
</tr>
</xsl:template>
<xsl:template match="answer" mode="qanda.label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:template>
<xsl:template match="label">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="process.qanda.toc">
<!-- * if user wants nested qandaset and qandaentry in main Qandaset TOC, -->
<!-- * then don't also include the nested stuff in the sub TOCs -->
<dl>
<xsl:apply-templates select="qandadiv" mode="qandatoc.mode"/>
<xsl:apply-templates select="qandaset|qandaentry" mode="qandatoc.mode"/>
</dl>
</xsl:template>
<xsl:template match="qandadiv" mode="qandatoc.mode">
<dt><xsl:apply-templates select="title" mode="qandatoc.mode"/></dt>
<dd><xsl:call-template name="process.qanda.toc"/></dd>
</xsl:template>
<xsl:template match="qandadiv/blockinfo/title|
qandadiv/info/title|
qandadiv/title" mode="qandatoc.mode">
<xsl:variable name="qalevel">
<xsl:call-template name="qandadiv.section.level"/>
</xsl:variable>
<xsl:variable name="id">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="parent::*"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="div.label">
<xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
</xsl:variable>
<xsl:if test="string-length($div.label) != 0">
<xsl:copy-of select="$div.label"/>
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<xsl:text> </xsl:text>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="parent::*"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="qandaset" mode="qandatoc.mode">
<xsl:for-each select="qandaentry">
<xsl:apply-templates select="." mode="qandatoc.mode"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="qandaentry" mode="qandatoc.mode">
<xsl:apply-templates select="question" mode="qandatoc.mode"/>
</xsl:template>
<xsl:template match="question" mode="qandatoc.mode">
<xsl:variable name="firstch">
<!-- Use a titleabbrev or title if available -->
<xsl:choose>
<xsl:when test="../blockinfo/titleabbrev">
<xsl:apply-templates select="../blockinfo/titleabbrev[1]/node()"/>
</xsl:when>
<xsl:when test="../blockinfo/title">
<xsl:apply-templates select="../blockinfo/title[1]/node()"/>
</xsl:when>
<xsl:when test="../info/titleabbrev">
<xsl:apply-templates select="../info/titleabbrev[1]/node()"/>
</xsl:when>
<xsl:when test="../titleabbrev">
<xsl:apply-templates select="../titleabbrev[1]/node()"/>
</xsl:when>
<xsl:when test="../info/title">
<xsl:apply-templates select="../info/title[1]/node()"/>
</xsl:when>
<xsl:when test="../title">
<xsl:apply-templates select="../title[1]/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="deflabel">
<xsl:choose>
<xsl:when test="ancestor-or-self::*[@defaultlabel]">
<xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
/@defaultlabel"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$qanda.defaultlabel"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<dt>
<xsl:apply-templates select="." mode="label.markup"/>
<xsl:if test="contains($deflabel,'number') and not(label)">
<xsl:apply-templates select="." mode="intralabel.punctuation"/>
</xsl:if>
<xsl:text> </xsl:text>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select=".."/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="$firstch"/>
</a>
</dt>
<!-- * include nested qandaset/qandaentry in TOC if user wants it -->
<xsl:if test="not($qanda.nested.in.toc = 0)">
<xsl:apply-templates select="following-sibling::answer" mode="qandatoc.mode"/>
</xsl:if>
</xsl:template>
<xsl:template match="answer" mode="qandatoc.mode">
<xsl:if test="descendant::question">
<dd>
<xsl:call-template name="process.qanda.toc"/>
</dd>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template name="process.qandaset">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<xsl:variable name="label-width">
<xsl:call-template name="pi.dbhtml_label-width"/>
</xsl:variable>
<xsl:variable name="table-summary">
<xsl:call-template name="pi.dbhtml_table-summary"/>
</xsl:variable>
<xsl:variable name="cellpadding">
<xsl:call-template name="pi.dbhtml_cellpadding"/>
</xsl:variable>
<xsl:variable name="cellspacing">
<xsl:call-template name="pi.dbhtml_cellspacing"/>
</xsl:variable>
<table border="0" width="100%" summary="Q and A Set">
<xsl:if test="$table-summary != ''">
<xsl:attribute name="summary">
<xsl:value-of select="$table-summary"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$cellpadding != ''">
<xsl:attribute name="cellpadding">
<xsl:value-of select="$cellpadding"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$cellspacing != ''">
<xsl:attribute name="cellspacing">
<xsl:value-of select="$cellspacing"/>
</xsl:attribute>
</xsl:if>
<col align="{$direction.align.start}">
<xsl:attribute name="width">
<xsl:choose>
<xsl:when test="$label-width != ''">
<xsl:value-of select="$label-width"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>1%</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</col>
<col/>
<tbody>
<xsl:apply-templates select="qandaentry|qandadiv"/>
</tbody>
</table>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="*" mode="no.wrapper.mode">
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,299 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: refentry.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="reference">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="reference.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not(partintro) and contains($toc.params, 'toc')">
<xsl:call-template name="division.toc"/>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="reference" mode="division.number">
<xsl:number from="book" count="reference" format="I."/>
</xsl:template>
<xsl:template match="reference/docinfo"></xsl:template>
<xsl:template match="reference/referenceinfo"></xsl:template>
<xsl:template match="reference/title"></xsl:template>
<xsl:template match="reference/subtitle"></xsl:template>
<xsl:template match="reference/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<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="refdesc" select="$refnamediv//refdescriptor"/>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$refentrytitle">
<xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
</xsl:when>
<xsl:when test="$refdesc">
<xsl:apply-templates select="$refdesc[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>
<h1 class="title">
<xsl:copy-of select="$title"/>
</h1>
</xsl:template>
<xsl:template match="refentry">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
<div class="refentry.separator">
<hr/>
</div>
</xsl:if>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:call-template name="refentry.titlepage"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="refentry/docinfo|refentry/refentryinfo"></xsl:template>
<xsl:template match="refentry/info"></xsl:template>
<xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="refmeta">
</xsl:template>
<xsl:template match="manvolnum">
<xsl:if test="$refentry.xref.manvolnum != 0">
<xsl:text>(</xsl:text>
<xsl:apply-templates/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="refmiscinfo">
</xsl:template>
<xsl:template match="refentrytitle">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
<xsl:template match="refnamediv">
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="preceding-sibling::refnamediv">
<!-- no title on secondary refnamedivs! -->
</xsl:when>
<xsl:when test="$refentry.generate.name != 0">
<h2>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RefName'"/>
</xsl:call-template>
</h2>
</xsl:when>
<xsl:when test="$refentry.generate.title != 0">
<h2>
<xsl:choose>
<xsl:when test="../refmeta/refentrytitle">
<xsl:apply-templates select="../refmeta/refentrytitle"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="refname[1]"/>
</xsl:otherwise>
</xsl:choose>
</h2>
</xsl:when>
</xsl:choose>
<p>
<xsl:apply-templates/>
</p>
</div>
</xsl:template>
<xsl:template match="refname">
<xsl:if test="not(preceding-sibling::refdescriptor)">
<xsl:apply-templates/>
<xsl:if test="following-sibling::refname">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="refpurpose">
<xsl:if test="node()">
<xsl:text> </xsl:text>
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat">em-dash</xsl:with-param>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="refdescriptor">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="refclass">
<xsl:if test="$refclass.suppress = 0">
<b>
<xsl:if test="@role">
<xsl:value-of select="@role"/>
<xsl:text>: </xsl:text>
</xsl:if>
<xsl:apply-templates/>
</b>
</xsl:if>
</xsl:template>
<xsl:template match="refsynopsisdiv">
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="anchor"/>
<h2>
<xsl:choose>
<xsl:when test="refsynopsisdiv/title|title">
<xsl:apply-templates select="(refsynopsisdiv/title|title)[1]"
mode="titlepage.mode"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RefSynopsisDiv'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</h2>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="refsynopsisdivinfo"></xsl:template>
<xsl:template match="refsynopsisdiv/title">
</xsl:template>
<xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="refsection|refsect1|refsect2|refsect3">
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<!-- pick up info title -->
<xsl:apply-templates select="(title|info/title)[1]"/>
<xsl:apply-templates select="node()[not(self::title) and not(self::info)]"/>
</div>
</xsl:template>
<xsl:template match="refsection/title|refsection/info/title">
<!-- the ID is output in the block.object call for refsect1 -->
<xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
<xsl:variable name="refsynopsisdiv">
<xsl:text>0</xsl:text>
<xsl:if test="ancestor::refsynopsisdiv">1</xsl:if>
</xsl:variable>
<xsl:variable name="hlevel">
<xsl:choose>
<xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$level+1+$refsynopsisdiv"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="h{$hlevel}">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="refsect1/title|refsect1/info/title">
<!-- the ID is output in the block.object call for refsect1 -->
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="refsect2/title|refsect2/info/title">
<!-- the ID is output in the block.object call for refsect2 -->
<h3>
<xsl:apply-templates/>
</h3>
</xsl:template>
<xsl:template match="refsect3/title|refsect3/info/title">
<!-- the ID is output in the block.object call for refsect3 -->
<h4>
<xsl:apply-templates/>
</h4>
</xsl:template>
<xsl:template match="refsectioninfo|refsection/info"></xsl:template>
<xsl:template match="refsect1info|refsect1/info"></xsl:template>
<xsl:template match="refsect2info|refsect2/info"></xsl:template>
<xsl:template match="refsect3info|refsect3/info"></xsl:template>
<!-- ==================================================================== -->
</xsl:stylesheet>

View File

@@ -0,0 +1,615 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: sections.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="section">
<xsl:variable name="depth" select="count(ancestor::section)+1"/>
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="section.titlepage"/>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $depth &lt;= $generate.section.toc.level">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</div>
</xsl:template>
<xsl:template name="section.title">
<!-- the context node should be the title of a section when called -->
<xsl:variable name="section" select="(ancestor::section
|ancestor::simplesect
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5)[last()]"/>
<xsl:variable name="renderas">
<xsl:choose>
<xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
<xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
<xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
<xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
<xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
<xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="level">
<xsl:choose>
<xsl:when test="$renderas != ''">
<xsl:value-of select="$renderas"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="section.level">
<xsl:with-param name="node" select="$section"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="section.heading">
<xsl:with-param name="section" select="$section"/>
<xsl:with-param name="level" select="$level"/>
<xsl:with-param name="title">
<xsl:apply-templates select="$section" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="section/title
|section/info/title
|sectioninfo/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect1">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect2'">
<xsl:call-template name="sect2.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect3'">
<xsl:call-template name="sect3.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect4'">
<xsl:call-template name="sect4.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect5'">
<xsl:call-template name="sect5.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect1.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 1">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</div>
</xsl:template>
<xsl:template match="sect1/title
|sect1/info/title
|sect1info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect2">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">
<xsl:call-template name="sect1.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect3'">
<xsl:call-template name="sect3.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect4'">
<xsl:call-template name="sect4.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect5'">
<xsl:call-template name="sect5.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect2.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 2">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</div>
</xsl:template>
<xsl:template match="sect2/title
|sect2/info/title
|sect2info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect3">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">
<xsl:call-template name="sect1.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect2'">
<xsl:call-template name="sect2.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect4'">
<xsl:call-template name="sect4.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect5'">
<xsl:call-template name="sect5.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect3.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 3">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</div>
</xsl:template>
<xsl:template match="sect3/title
|sect3/info/title
|sect3info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect4">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">
<xsl:call-template name="sect1.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect2'">
<xsl:call-template name="sect2.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect3'">
<xsl:call-template name="sect3.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect5'">
<xsl:call-template name="sect5.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect4.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 4">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</div>
</xsl:template>
<xsl:template match="sect4/title
|sect4/info/title
|sect4info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect5">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">
<xsl:call-template name="sect1.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect2'">
<xsl:call-template name="sect2.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect3'">
<xsl:call-template name="sect3.titlepage"/>
</xsl:when>
<xsl:when test="@renderas = 'sect4'">
<xsl:call-template name="sect4.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="sect5.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="contains($toc.params, 'toc')
and $generate.section.toc.level &gt;= 5">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
</xsl:call-template>
<xsl:call-template name="section.toc.separator"/>
</xsl:if>
<xsl:apply-templates/>
<xsl:call-template name="process.chunk.footnotes"/>
</div>
</xsl:template>
<xsl:template match="sect5/title
|sect5/info/title
|sect5info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="simplesect">
<xsl:call-template name="id.warning"/>
<div>
<xsl:call-template name="common.html.attributes">
<xsl:with-param name="inherit" select="1"/>
</xsl:call-template>
<xsl:call-template name="simplesect.titlepage"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="simplesect/title|simplesect/info/title"
mode="titlepage.mode" priority="2">
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="section/title"></xsl:template>
<xsl:template match="section/titleabbrev"></xsl:template>
<xsl:template match="section/subtitle"></xsl:template>
<xsl:template match="sectioninfo"></xsl:template>
<xsl:template match="section/info"></xsl:template>
<xsl:template match="sect1/title"></xsl:template>
<xsl:template match="sect1/titleabbrev"></xsl:template>
<xsl:template match="sect1/subtitle"></xsl:template>
<xsl:template match="sect1info"></xsl:template>
<xsl:template match="sect1/info"></xsl:template>
<xsl:template match="sect2/title"></xsl:template>
<xsl:template match="sect2/subtitle"></xsl:template>
<xsl:template match="sect2/titleabbrev"></xsl:template>
<xsl:template match="sect2info"></xsl:template>
<xsl:template match="sect2/info"></xsl:template>
<xsl:template match="sect3/title"></xsl:template>
<xsl:template match="sect3/subtitle"></xsl:template>
<xsl:template match="sect3/titleabbrev"></xsl:template>
<xsl:template match="sect3info"></xsl:template>
<xsl:template match="sect3/info"></xsl:template>
<xsl:template match="sect4/title"></xsl:template>
<xsl:template match="sect4/subtitle"></xsl:template>
<xsl:template match="sect4/titleabbrev"></xsl:template>
<xsl:template match="sect4info"></xsl:template>
<xsl:template match="sect4/info"></xsl:template>
<xsl:template match="sect5/title"></xsl:template>
<xsl:template match="sect5/subtitle"></xsl:template>
<xsl:template match="sect5/titleabbrev"></xsl:template>
<xsl:template match="sect5info"></xsl:template>
<xsl:template match="sect5/info"></xsl:template>
<xsl:template match="simplesect/title"></xsl:template>
<xsl:template match="simplesect/subtitle"></xsl:template>
<xsl:template match="simplesect/titleabbrev"></xsl:template>
<xsl:template match="simplesect/info"></xsl:template>
<!-- ==================================================================== -->
<xsl:template name="section.heading">
<xsl:param name="section" select="."/>
<xsl:param name="level" select="1"/>
<xsl:param name="allow-anchors" select="1"/>
<xsl:param name="title"/>
<xsl:param name="class" select="'title'"/>
<xsl:variable name="id">
<xsl:choose>
<!-- Make sure the subtitle doesn't get the same id as the title -->
<xsl:when test="self::subtitle">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:when>
<!-- if title is in an *info wrapper, get the grandparent -->
<xsl:when test="contains(local-name(..), 'info')">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="../.."/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="object.id">
<xsl:with-param name="object" select=".."/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- HTML H level is one higher than section level -->
<xsl:variable name="hlevel">
<xsl:choose>
<!-- highest valid HTML H level is H6; so anything nested deeper
than 5 levels down just becomes H6 -->
<xsl:when test="$level &gt; 5">6</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$level + 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="h{$hlevel}">
<xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
<xsl:if test="$css.decoration != '0'">
<xsl:if test="$hlevel&lt;3">
<xsl:attribute name="style">clear: both</xsl:attribute>
</xsl:if>
</xsl:if>
<xsl:if test="$allow-anchors != 0 and $generate.id.attributes = 0">
<xsl:call-template name="anchor">
<xsl:with-param name="node" select="$section"/>
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$generate.id.attributes != 0 and not(local-name(.) = 'appendix')">
<xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</xsl:element>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="bridgehead">
<xsl:variable name="container"
select="(ancestor::appendix
|ancestor::article
|ancestor::bibliography
|ancestor::chapter
|ancestor::glossary
|ancestor::glossdiv
|ancestor::index
|ancestor::partintro
|ancestor::preface
|ancestor::refsect1
|ancestor::refsect2
|ancestor::refsect3
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5
|ancestor::section
|ancestor::setindex
|ancestor::simplesect)[last()]"/>
<xsl:variable name="clevel">
<xsl:choose>
<xsl:when test="local-name($container) = 'appendix'
or local-name($container) = 'chapter'
or local-name($container) = 'article'
or local-name($container) = 'bibliography'
or local-name($container) = 'glossary'
or local-name($container) = 'index'
or local-name($container) = 'partintro'
or local-name($container) = 'preface'
or local-name($container) = 'setindex'">1</xsl:when>
<xsl:when test="local-name($container) = 'glossdiv'">
<xsl:value-of select="count(ancestor::glossdiv)+1"/>
</xsl:when>
<xsl:when test="local-name($container) = 'sect1'
or local-name($container) = 'sect2'
or local-name($container) = 'sect3'
or local-name($container) = 'sect4'
or local-name($container) = 'sect5'
or local-name($container) = 'refsect1'
or local-name($container) = 'refsect2'
or local-name($container) = 'refsect3'
or local-name($container) = 'section'
or local-name($container) = 'simplesect'">
<xsl:variable name="slevel">
<xsl:call-template name="section.level">
<xsl:with-param name="node" select="$container"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$slevel + 1"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- HTML H level is one higher than section level -->
<xsl:variable name="hlevel">
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">2</xsl:when>
<xsl:when test="@renderas = 'sect2'">3</xsl:when>
<xsl:when test="@renderas = 'sect3'">4</xsl:when>
<xsl:when test="@renderas = 'sect4'">5</xsl:when>
<xsl:when test="@renderas = 'sect5'">6</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$clevel + 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="h{$hlevel}">
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
</xsl:call-template>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="section/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="simplesect/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect1/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect2/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect3/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect4/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template match="sect5/subtitle" mode="titlepage.mode" priority="2">
<xsl:call-template name="section.subtitle"/>
</xsl:template>
<xsl:template name="section.subtitle">
<!-- the context node should be the subtitle of a section when called -->
<xsl:variable name="section" select="(ancestor::section
|ancestor::simplesect
|ancestor::sect1
|ancestor::sect2
|ancestor::sect3
|ancestor::sect4
|ancestor::sect5)[last()]"/>
<xsl:variable name="level">
<xsl:call-template name="section.level">
<xsl:with-param name="node" select="$section"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="section.heading">
<xsl:with-param name="section" select=".."/>
<xsl:with-param name="allow-anchors" select="0"/>
<!-- subtitle heading level one higher than section level -->
<xsl:with-param name="level" select="$level + 1"/>
<xsl:with-param name="class" select="'subtitle'"/>
<xsl:with-param name="title">
<xsl:apply-templates select="$section" mode="object.subtitle.markup">
<xsl:with-param name="allow-anchors" select="0"/>
</xsl:apply-templates>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,76 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- ********************************************************************
$Id: task.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="task">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
<xsl:variable name="placement">
<xsl:choose>
<xsl:when test="contains($param.placement, ' ')">
<xsl:value-of select="substring-before($param.placement, ' ')"/>
</xsl:when>
<xsl:when test="$param.placement = ''">before</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$param.placement"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="preamble"
select="*[not(self::title
or self::titleabbrev)]"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="anchor"/>
<xsl:if test="title and $placement = 'before'">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>
<xsl:apply-templates select="$preamble"/>
<xsl:if test="title and $placement != 'before'">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>
</div>
</xsl:template>
<xsl:template match="task/title">
<!-- nop -->
</xsl:template>
<xsl:template match="tasksummary">
<xsl:call-template name="semiformal.object"/>
</xsl:template>
<xsl:template match="tasksummary/title"/>
<xsl:template match="taskprerequisites">
<xsl:call-template name="semiformal.object"/>
</xsl:template>
<xsl:template match="taskprerequisites/title"/>
<xsl:template match="taskrelated">
<xsl:call-template name="semiformal.object"/>
</xsl:template>
<xsl:template match="taskrelated/title"/>
</xsl:stylesheet>

View File

@@ -0,0 +1,686 @@
<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- ==================================================================== -->
<t:titlepage t:element="article" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<hr/>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="set" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<hr/>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="book" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<hr/>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="part" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title
t:force="1"
t:named-template="division.title"
param:node="ancestor-or-self::part[1]"/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<t:titlepage t:element="partintro" t:wrapper="div">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="reference" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<hr/>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="refentry" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<!-- uncomment this if you want refentry titlepages
<title t:force="1"
t:named-template="refentry.title"
param:node="ancestor-or-self::refentry[1]"/>
-->
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator/>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="dedication" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title
t:force="1"
t:named-template="component.title"
param:node="ancestor-or-self::dedication[1]"/>
<subtitle/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="acknowledgements" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title
t:force="1"
t:named-template="component.title"
param:node="ancestor-or-self::acknowledgements[1]"/>
<subtitle/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="preface" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="chapter" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="appendix" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="section" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<t:titlepage t:element="sect1" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<t:titlepage t:element="sect2" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<t:titlepage t:element="sect3" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<t:titlepage t:element="sect4" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<t:titlepage t:element="sect5" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<t:titlepage t:element="simplesect" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title/>
<subtitle/>
<corpauthor/>
<authorgroup/>
<author/>
<othercredit/>
<releaseinfo/>
<copyright/>
<legalnotice/>
<pubdate/>
<revision/>
<revhistory/>
<abstract/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
<xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="bibliography" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title
t:force="1"
t:named-template="component.title"
param:node="ancestor-or-self::bibliography[1]"/>
<subtitle/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="glossary" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title
t:force="1"
t:named-template="component.title"
param:node="ancestor-or-self::glossary[1]"/>
<subtitle/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="index" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title
t:force="1"
t:named-template="component.title"
param:node="ancestor-or-self::index[1]"/>
<subtitle/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
<t:titlepage t:element="setindex" t:wrapper="div" class="titlepage">
<t:titlepage-content t:side="recto">
<title
t:force="1"
t:named-template="component.title"
param:node="ancestor-or-self::setindex[1]"/>
<subtitle/>
</t:titlepage-content>
<t:titlepage-content t:side="verso">
</t:titlepage-content>
<t:titlepage-separator>
</t:titlepage-separator>
<t:titlepage-before t:side="recto">
</t:titlepage-before>
<t:titlepage-before t:side="verso">
</t:titlepage-before>
</t:titlepage>
<!-- ==================================================================== -->
</t:templates>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

350
nping/docs/xsl/html/toc.xsl Normal file
View File

@@ -0,0 +1,350 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: toc.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="set/toc | book/toc | part/toc">
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="parent::*"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<!-- Do not output the toc element if one is already generated
by the use of $generate.toc parameter, or if
generating a source toc is turned off -->
<xsl:if test="not(contains($toc.params, 'toc')) and
($process.source.toc != 0 or $process.empty.source.toc != 0)">
<xsl:variable name="content">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<xsl:apply-templates />
</xsl:when>
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
<!-- trick to switch context node to parent element -->
<xsl:for-each select="parent::*">
<xsl:choose>
<xsl:when test="self::set">
<xsl:call-template name="set.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="self::book">
<xsl:call-template name="division.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="self::part">
<xsl:call-template name="division.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:if test="string-length(normalize-space($content)) != 0">
<xsl:copy-of select="$content"/>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="chapter/toc | appendix/toc | preface/toc | article/toc">
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="parent::*"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<!-- Do not output the toc element if one is already generated
by the use of $generate.toc parameter, or if
generating a source toc is turned off -->
<xsl:if test="not(contains($toc.params, 'toc')) and
($process.source.toc != 0 or $process.empty.source.toc != 0)">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="title"/>
<dl>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="*[not(self::title)]"/>
</dl>
</div>
<xsl:call-template name="component.toc.separator"/>
</xsl:when>
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
<!-- trick to switch context node to section element -->
<xsl:for-each select="parent::*">
<xsl:call-template name="component.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="component.toc.separator"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="section/toc
|sect1/toc
|sect2/toc
|sect3/toc
|sect4/toc
|sect5/toc">
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="parent::*"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
<!-- Do not output the toc element if one is already generated
by the use of $generate.toc parameter, or if
generating a source toc is turned off -->
<xsl:if test="not(contains($toc.params, 'toc')) and
($process.source.toc != 0 or $process.empty.source.toc != 0)">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="title"/>
<dl>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="*[not(self::title)]"/>
</dl>
</div>
<xsl:call-template name="section.toc.separator"/>
</xsl:when>
<xsl:when test="count(*) = 0 and $process.empty.source.toc != 0">
<!-- trick to switch context node to section element -->
<xsl:for-each select="parent::*">
<xsl:call-template name="section.toc">
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="section.toc.separator"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="tocpart|tocchap
|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
<xsl:variable name="sub-toc">
<xsl:if test="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">
<dd>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="tocchap|toclevel1|toclevel2|
toclevel3|toclevel4|toclevel5"/>
</xsl:element>
</dd>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$toc.list.type}">
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="tocchap|toclevel1|toclevel2|
toclevel3|toclevel4|toclevel5"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:apply-templates select="tocentry[position() != last()]"/>
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">
<dt>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="tocentry[position() = last()]"/>
</dt>
<xsl:copy-of select="$sub-toc"/>
</xsl:when>
<xsl:otherwise>
<li>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates select="tocentry[position() = last()]"/>
<xsl:copy-of select="$sub-toc"/>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="tocentry|tocdiv|lotentry|tocfront|tocback">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">
<dt>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="tocentry-content"/>
</dt>
</xsl:when>
<xsl:otherwise>
<li>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="tocentry-content"/>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="tocentry[position() = last()]" priority="2">
<xsl:call-template name="tocentry-content"/>
</xsl:template>
<xsl:template name="tocentry-content">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
<xsl:choose>
<xsl:when test="@linkend">
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:call-template>
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="toc/title">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="toc/subtitle">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="toc/titleabbrev">
</xsl:template>
<!-- ==================================================================== -->
<!-- A lot element must have content, because there is no attribute
to select what kind of list should be generated -->
<xsl:template match="book/lot | part/lot">
<!-- Don't generate a page sequence unless there is content -->
<xsl:variable name="content">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates />
</div>
</xsl:when>
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
<xsl:call-template name="process.empty.lot"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:if test="string-length(normalize-space($content)) != 0">
<xsl:copy-of select="$content"/>
</xsl:if>
</xsl:template>
<xsl:template match="chapter/lot | appendix/lot | preface/lot | article/lot">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates />
</div>
<xsl:call-template name="component.toc.separator"/>
</xsl:when>
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
<xsl:call-template name="process.empty.lot"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="section/lot
|sect1/lot
|sect2/lot
|sect3/lot
|sect4/lot
|sect5/lot">
<xsl:choose>
<xsl:when test="* and $process.source.toc != 0">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
<xsl:call-template name="section.toc.separator"/>
</xsl:when>
<xsl:when test="not(child::*) and $process.empty.source.toc != 0">
<xsl:call-template name="process.empty.lot"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="process.empty.lot">
<!-- An empty lot element does not provide any information to indicate
what should be included in it. You can customize this
template to generate a lot based on @role or something -->
<xsl:message>
<xsl:text>Warning: don't know what to generate for </xsl:text>
<xsl:text>lot that has no children.</xsl:text>
</xsl:message>
</xsl:template>
<xsl:template match="lot/title">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="lot/subtitle">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="lot/titleabbrev">
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,403 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim"
xmlns:xverb="xalan://com.nwalsh.xalan.Verbatim"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="sverb xverb lxslt exsl"
version='1.0'>
<!-- ********************************************************************
$Id: verbatim.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- XSLTHL highlighting is turned off by default. See highlighting/README
for instructions on how to turn on XSLTHL -->
<xsl:template name="apply-highlighting">
<xsl:apply-templates/>
</xsl:template>
<lxslt:component prefix="xverb"
functions="numberLines"/>
<xsl:template match="programlisting|screen|synopsis">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:call-template name="anchor"/>
<xsl:if test="$shade.verbatim != 0">
<xsl:message>
<xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
<xsl:text>Use CSS instead,</xsl:text>
</xsl:message>
<xsl:message>
<xsl:text>for example: pre.</xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> { background-color: #E0E0E0; }</xsl:text>
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="$suppress-numbers = '0'
and @linenumbering = 'numbered'
and $use.extensions != '0'
and $linenumbering.extension != '0'">
<xsl:variable name="rtf">
<xsl:choose>
<xsl:when test="$highlight.source != 0">
<xsl:call-template name="apply-highlighting"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<pre>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="@width != ''">
<xsl:attribute name="width">
<xsl:value-of select="@width"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</pre>
</xsl:when>
<xsl:otherwise>
<pre>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="@width != ''">
<xsl:attribute name="width">
<xsl:value-of select="@width"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$highlight.source != 0">
<xsl:call-template name="apply-highlighting"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</pre>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="literallayout">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:variable name="rtf">
<xsl:apply-templates/>
</xsl:variable>
<xsl:if test="$shade.verbatim != 0 and @class='monospaced'">
<xsl:message>
<xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
<xsl:text>Use CSS instead,</xsl:text>
</xsl:message>
<xsl:message>
<xsl:text>for example: pre.</xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> { background-color: #E0E0E0; }</xsl:text>
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="$suppress-numbers = '0'
and @linenumbering = 'numbered'
and $use.extensions != '0'
and $linenumbering.extension != '0'">
<xsl:choose>
<xsl:when test="@class='monospaced'">
<pre>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</pre>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<p>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@class='monospaced'">
<pre>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:copy-of select="$rtf"/>
</pre>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<p>
<xsl:call-template name="make-verbatim">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="address">
<xsl:param name="suppress-numbers" select="'0'"/>
<xsl:variable name="rtf">
<xsl:apply-templates/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$suppress-numbers = '0'
and @linenumbering = 'numbered'
and $use.extensions != '0'
and $linenumbering.extension != '0'">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<p>
<xsl:call-template name="number.rtf.lines">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</div>
</xsl:when>
<xsl:otherwise>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<p>
<xsl:call-template name="make-verbatim">
<xsl:with-param name="rtf" select="$rtf"/>
</xsl:call-template>
</p>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="number.rtf.lines">
<xsl:param name="rtf" select="''"/>
<xsl:param name="pi.context" select="."/>
<!-- Save the global values -->
<xsl:variable name="global.linenumbering.everyNth"
select="$linenumbering.everyNth"/>
<xsl:variable name="global.linenumbering.separator"
select="$linenumbering.separator"/>
<xsl:variable name="global.linenumbering.width"
select="$linenumbering.width"/>
<!-- Extract the <?dbhtml linenumbering.*?> PI values -->
<xsl:variable name="pi.linenumbering.everyNth">
<xsl:call-template name="pi.dbhtml_linenumbering.everyNth">
<xsl:with-param name="node" select="$pi.context"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="pi.linenumbering.separator">
<xsl:call-template name="pi.dbhtml_linenumbering.separator">
<xsl:with-param name="node" select="$pi.context"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="pi.linenumbering.width">
<xsl:call-template name="pi.dbhtml_linenumbering.width">
<xsl:with-param name="node" select="$pi.context"/>
</xsl:call-template>
</xsl:variable>
<!-- Construct the 'in-context' values -->
<xsl:variable name="linenumbering.everyNth">
<xsl:choose>
<xsl:when test="$pi.linenumbering.everyNth != ''">
<xsl:value-of select="$pi.linenumbering.everyNth"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$global.linenumbering.everyNth"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="linenumbering.separator">
<xsl:choose>
<xsl:when test="$pi.linenumbering.separator != ''">
<xsl:value-of select="$pi.linenumbering.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$global.linenumbering.separator"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="linenumbering.width">
<xsl:choose>
<xsl:when test="$pi.linenumbering.width != ''">
<xsl:value-of select="$pi.linenumbering.width"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$global.linenumbering.width"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="linenumbering.startinglinenumber">
<xsl:choose>
<xsl:when test="$pi.context/@startinglinenumber">
<xsl:value-of select="$pi.context/@startinglinenumber"/>
</xsl:when>
<xsl:when test="$pi.context/@continuation='continues'">
<xsl:variable name="lastLine">
<xsl:choose>
<xsl:when test="$pi.context/self::programlisting">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::programlisting[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pi.context/self::screen">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::screen[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pi.context/self::literallayout">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::literallayout[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pi.context/self::address">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::address[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pi.context/self::synopsis">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings"
select="preceding::synopsis[@linenumbering='numbered']"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Unexpected verbatim environment: </xsl:text>
<xsl:value-of select="local-name($pi.context)"/>
</xsl:message>
<xsl:value-of select="0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$lastLine + 1"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="function-available('sverb:numberLines')">
<xsl:copy-of select="sverb:numberLines($rtf)"/>
</xsl:when>
<xsl:when test="function-available('xverb:numberLines')">
<xsl:copy-of select="xverb:numberLines($rtf)"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>No numberLines function available.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="make-verbatim">
<xsl:param name="rtf"/>
<!-- I want to make this RTF verbatim. There are two possibilities: either
I have access to the exsl:node-set extension function and I can "do it right"
or I have to rely on CSS. -->
<xsl:choose>
<xsl:when test="$exsl.node.set.available != 0">
<xsl:apply-templates select="exsl:node-set($rtf)" mode="make.verbatim.mode"/>
</xsl:when>
<xsl:otherwise>
<span style="white-space: pre;">
<xsl:copy-of select="$rtf"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ======================================================================== -->
<xsl:template name="lastLineNumber">
<xsl:param name="listings"/>
<xsl:param name="number" select="0"/>
<xsl:variable name="lines">
<xsl:call-template name="countLines">
<xsl:with-param name="listing" select="string($listings[1])"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="not($listings)">
<xsl:value-of select="$number"/>
</xsl:when>
<xsl:when test="$listings[1]/@startinglinenumber">
<xsl:value-of select="$number + $listings[1]/@startinglinenumber + $lines - 1"/>
</xsl:when>
<xsl:when test="$listings[1]/@continuation='continues'">
<xsl:call-template name="lastLineNumber">
<xsl:with-param name="listings" select="listings[position() &gt; 1]"/>
<xsl:with-param name="number" select="$number + $lines"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$lines"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="countLines">
<xsl:param name="listing"/>
<xsl:param name="count" select="1"/>
<xsl:choose>
<xsl:when test="contains($listing, '&#10;')">
<xsl:call-template name="countLines">
<xsl:with-param name="listing" select="substring-after($listing, '&#10;')"/>
<xsl:with-param name="count" select="$count + 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$count"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

1377
nping/docs/xsl/html/xref.xsl Normal file

File diff suppressed because it is too large Load Diff