Subversion Repositories svn LFS-FR

Compare Revisions

Ignore whitespace Rev 1179 → Rev 1180

/trunk/lfs/stylesheets/wget-list.xsl
0,0 → 1,35
<?xml version='1.0' encoding='ISO-8859-1'?>
 
<!-- Create a list of upstream URLs for packages and patches to be used
with wget. -->
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
 
<xsl:output method="text"/>
 
<xsl:template match="/">
<xsl:apply-templates select="//ulink"/>
</xsl:template>
 
<xsl:template match="ulink">
<!-- If some package don't have the predefined strings in their
name, the next test must be fixed to match it also. Skip possible
duplicated URLs due that may be splitted for PDF output -->
<xsl:if test="(contains(@url, '.tar.') or contains(@url, '.tgz')
or contains(@url, '.patch')) and
not(ancestor-or-self::*/@condition = 'pdf')">
<xsl:choose>
<xsl:when test="contains(@url,'?download')">
<xsl:value-of select="substring-before(@url,'?download')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@url"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#x0a;</xsl:text>
</xsl:if>
</xsl:template>
 
</xsl:stylesheet>
 
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/VERSION
0,0 → 1,113
<?xml version='1.0'?> <!-- -*- nxml -*- vim: set foldlevel=2: -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
xmlns:sf="http://sourceforge.net/"
xmlns:dyn="http://exslt.org/dynamic"
xmlns:saxon="http://icl.com/saxon"
exclude-result-prefixes="fm sf"
version='1.0'>
 
<xsl:output omit-xml-declaration="yes"/>
 
<xsl:param name="get"/>
<xsl:param name="VERSION" select="string(document('')//fm:Version[1])"/>
<xsl:param name="Tag" select="concat('V',translate(string(document('')//fm:Version[1]),'.',''))"/>
<xsl:param name="DistroTitle" select="string(document('')//fm:Branch[1])"/>
<xsl:param name="sf-relid" select="0"/>
 
<xsl:param name="DistroName">docbook-xsl</xsl:param>
<xsl:param name="PreviousRelease">1.72.0</xsl:param>
<xsl:param name="PreviousReleaseRevision">6549</xsl:param>
<xsl:param name="Revision">$Revision: 8369 $</xsl:param>
<xsl:param name="VersionFileURL">$URL: https://docbook.svn.sourceforge.net/svnroot/docbook/trunk/xsl/VERSION $</xsl:param>
 
<xsl:strip-space elements="fm:*"/>
 
<fm:project>
<fm:Project>DocBook</fm:Project>
<fm:Branch>XSL Stylesheets</fm:Branch>
<fm:Version>1.73.2</fm:Version>
<!--
<fm:License>MIT/X Consortium License</fm:License>
-->
<fm:Release-Focus>
<!-- * Initial freshmeat announcement -->
<!-- * Documentation -->
<!-- * Code cleanup -->
<!-- * Minor feature enhancements -->
<!-- * Major feature enhancements -->
Minor bugfixes
<!-- * Major bugfixes -->
<!-- * Minor security fixes -->
<!-- * Major security fixes -->
</fm:Release-Focus>
<fm:Home-Page-URL>http://sourceforge.net/projects/docbook/</fm:Home-Page-URL>
<fm:Gzipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.tar.gz?download</fm:Gzipped-Tar-URL>
<fm:Zipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.zip?download</fm:Zipped-Tar-URL>
<fm:Bzipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.bz2?download</fm:Bzipped-Tar-URL>
<fm:Changelog-URL>http://sourceforge.net/project/shownotes.php?release_id={SFRELID}</fm:Changelog-URL>
<fm:CVS-URL>http://docbook.svn.sourceforge.net/viewvc/docbook/</fm:CVS-URL>
<fm:Mailing-List-URL>http://lists.oasis-open.org/archives/docbook-apps/</fm:Mailing-List-URL>
<fm:Changes>This is a bug-fix update to the 1.73.1 release.
</fm:Changes>
</fm:project>
 
<xsl:template match="/" priority="-100">
<xsl:choose>
<xsl:when test="$get = 'Tag'">
<xsl:value-of select="$Tag"/>
</xsl:when>
<xsl:when test="$get = 'PreviousRelease'">
<xsl:value-of select="$PreviousRelease"/>
</xsl:when>
<xsl:when test="$get = 'PreviousReleaseRevision'">
<xsl:value-of select="$PreviousReleaseRevision"/>
</xsl:when>
<xsl:when test="$get = 'DistroTitle'">
<xsl:value-of select="$DistroTitle"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$sf-relid = 0">
<xsl:message terminate="yes">
<xsl:text>You must specify the sf-relid as a parameter.</xsl:text>
</xsl:message>
</xsl:if>
<xsl:apply-templates select="//fm:project"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="fm:project">
<xsl:apply-templates/>
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="fm:Changes" mode="text"/>
</xsl:template>
 
<xsl:template match="fm:Changes"/>
 
<xsl:template match="fm:Gzipped-Tar-URL|fm:Zipped-Tar-URL|fm:Bzipped-Tar-URL">
<xsl:value-of select="local-name(.)"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="substring-before(., '{DISTRONAME-VERSION}')"/>
<xsl:value-of select="concat($DistroName, '-', $VERSION)"/>
<xsl:value-of select="substring-after(., '{DISTRONAME-VERSION}')"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
 
<xsl:template match="fm:Changelog-URL">
<xsl:value-of select="local-name(.)"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="substring-before(., '{SFRELID}')"/>
<xsl:value-of select="$sf-relid"/>
<xsl:value-of select="substring-after(., '{SFRELID}')"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
 
<xsl:template match="fm:*">
<xsl:value-of select="local-name(.)"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="normalize-space(.)"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
 
</xsl:stylesheet>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/COPYING
0,0 → 1,47
Copyright
---------
Copyright (C) 1999-2007 Norman Walsh
Copyright (C) 2003 Jiří Kosek
Copyright (C) 2004-2007 Steve Ball
Copyright (C) 2005-2007 The DocBook Project
 
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the ``Software''), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
 
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
 
Except as contained in this notice, the names of individuals
credited with contribution to this software shall not be used in
advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization
from the individuals in question.
 
Any stylesheet derived from this Software that is publically
distributed will be identified with a different name and the
version strings in any derived Software will be changed so that
no possibility of confusion between the derived package and this
Software will exist.
 
Warranty
--------
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER
CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
 
Contacting the Author
---------------------
The DocBook XSL stylesheets are maintained by Norman Walsh,
<ndw@nwalsh.com>, and members of the DocBook Project,
<docbook-developers@sf.net>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/onechunk.xsl
0,0 → 1,36
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="doc">
 
<!-- ********************************************************************
$Id: onechunk.xsl 8196 2007-07-05 21:18:33Z manuel $
********************************************************************
 
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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/titlepage.templates.xsl
0,0 → 1,3622
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="exsl">
 
<!-- This stylesheet was created by template/titlepage.xsl-->
 
<xsl:template name="article.titlepage.recto">
<xsl:choose>
<xsl:when test="articleinfo/title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/title"/>
</xsl:when>
<xsl:when test="artheader/title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="articleinfo/subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/>
</xsl:when>
<xsl:when test="artheader/subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/corpauthor"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/corpauthor"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/authorgroup"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/authorgroup"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/author"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/author"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/othercredit"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/othercredit"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/releaseinfo"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/copyright"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/legalnotice"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/pubdate"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/pubdate"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revision"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revision"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revhistory"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="article.titlepage.verso">
</xsl:template>
 
<xsl:template name="article.titlepage.separator"><hr/>
</xsl:template>
 
<xsl:template name="article.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="article.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="article.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="article.titlepage.before.recto"/>
<xsl:call-template name="article.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="article.titlepage.before.verso"/>
<xsl:call-template name="article.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="article.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="article.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="article.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="article.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="set.titlepage.recto">
<xsl:choose>
<xsl:when test="setinfo/title">
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="setinfo/subtitle">
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/corpauthor"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/authorgroup"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/author"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/othercredit"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/releaseinfo"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/copyright"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/legalnotice"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/pubdate"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revision"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revhistory"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/abstract"/>
<xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="set.titlepage.verso">
</xsl:template>
 
<xsl:template name="set.titlepage.separator"><hr/>
</xsl:template>
 
<xsl:template name="set.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="set.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="set.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="set.titlepage.before.recto"/>
<xsl:call-template name="set.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="set.titlepage.before.verso"/>
<xsl:call-template name="set.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="set.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="set.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="set.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="set.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="book.titlepage.recto">
<xsl:choose>
<xsl:when test="bookinfo/title">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="bookinfo/subtitle">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/corpauthor"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/authorgroup"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/othercredit"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/pubdate"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revision"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revhistory"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/abstract"/>
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="book.titlepage.verso">
</xsl:template>
 
<xsl:template name="book.titlepage.separator"><hr/>
</xsl:template>
 
<xsl:template name="book.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="book.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="book.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="book.titlepage.before.recto"/>
<xsl:call-template name="book.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="book.titlepage.before.verso"/>
<xsl:call-template name="book.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="book.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="book.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="book.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="book.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="book.titlepage.recto.style">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="part.titlepage.recto">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:call-template name="division.title">
<xsl:with-param name="node" select="ancestor-or-self::part[1]"/>
</xsl:call-template></div>
<xsl:choose>
<xsl:when test="partinfo/subtitle">
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/corpauthor"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/authorgroup"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/author"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/author"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/othercredit"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/releaseinfo"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/copyright"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/copyright"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/legalnotice"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/pubdate"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revision"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revision"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revhistory"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/abstract"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/abstract"/>
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="part.titlepage.verso">
</xsl:template>
 
<xsl:template name="part.titlepage.separator">
</xsl:template>
 
<xsl:template name="part.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="part.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="part.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="part.titlepage.before.recto"/>
<xsl:call-template name="part.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="part.titlepage.before.verso"/>
<xsl:call-template name="part.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="part.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="part.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="part.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="subtitle" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="part.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="part.titlepage.recto.style">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="partintro.titlepage.recto">
<xsl:choose>
<xsl:when test="partintroinfo/title">
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="partintroinfo/subtitle">
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/corpauthor"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/authorgroup"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/author"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/author"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/othercredit"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/releaseinfo"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/copyright"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/copyright"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/legalnotice"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/pubdate"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revision"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revision"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revhistory"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/abstract"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/abstract"/>
<xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="partintro.titlepage.verso">
</xsl:template>
 
<xsl:template name="partintro.titlepage.separator">
</xsl:template>
 
<xsl:template name="partintro.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="partintro.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="partintro.titlepage">
<div>
<xsl:variable name="recto.content">
<xsl:call-template name="partintro.titlepage.before.recto"/>
<xsl:call-template name="partintro.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="partintro.titlepage.before.verso"/>
<xsl:call-template name="partintro.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="partintro.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="partintro.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="partintro.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="partintro.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="reference.titlepage.recto">
<xsl:choose>
<xsl:when test="referenceinfo/title">
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="referenceinfo/subtitle">
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/corpauthor"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/authorgroup"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/author"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/author"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/othercredit"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/releaseinfo"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/copyright"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/copyright"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/legalnotice"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/pubdate"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revision"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revision"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revhistory"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/abstract"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/abstract"/>
<xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="reference.titlepage.verso">
</xsl:template>
 
<xsl:template name="reference.titlepage.separator"><hr/>
</xsl:template>
 
<xsl:template name="reference.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="reference.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="reference.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="reference.titlepage.before.recto"/>
<xsl:call-template name="reference.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="reference.titlepage.before.verso"/>
<xsl:call-template name="reference.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="reference.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="reference.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="reference.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="reference.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="refentry.titlepage.recto">
</xsl:template>
 
<xsl:template name="refentry.titlepage.verso">
</xsl:template>
 
<xsl:template name="refentry.titlepage.separator">
</xsl:template>
 
<xsl:template name="refentry.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="refentry.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="refentry.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="refentry.titlepage.before.recto"/>
<xsl:call-template name="refentry.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="refentry.titlepage.before.verso"/>
<xsl:call-template name="refentry.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="refentry.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="refentry.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="refentry.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template name="dedication.titlepage.recto">
<div xsl:use-attribute-sets="dedication.titlepage.recto.style">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::dedication[1]"/>
</xsl:call-template></div>
<xsl:choose>
<xsl:when test="dedicationinfo/subtitle">
<xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="dedicationinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="dedication.titlepage.verso">
</xsl:template>
 
<xsl:template name="dedication.titlepage.separator">
</xsl:template>
 
<xsl:template name="dedication.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="dedication.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="dedication.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="dedication.titlepage.before.recto"/>
<xsl:call-template name="dedication.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="dedication.titlepage.before.verso"/>
<xsl:call-template name="dedication.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="dedication.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="dedication.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="dedication.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="subtitle" mode="dedication.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="dedication.titlepage.recto.style">
<xsl:apply-templates select="." mode="dedication.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="preface.titlepage.recto">
<xsl:choose>
<xsl:when test="prefaceinfo/title">
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="prefaceinfo/subtitle">
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/corpauthor"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/authorgroup"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/author"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/author"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/othercredit"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/releaseinfo"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/copyright"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/copyright"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/legalnotice"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/pubdate"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revision"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revision"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revhistory"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/abstract"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/abstract"/>
<xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="preface.titlepage.verso">
</xsl:template>
 
<xsl:template name="preface.titlepage.separator">
</xsl:template>
 
<xsl:template name="preface.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="preface.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="preface.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="preface.titlepage.before.recto"/>
<xsl:call-template name="preface.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="preface.titlepage.before.verso"/>
<xsl:call-template name="preface.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="preface.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="preface.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="preface.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="preface.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="chapter.titlepage.recto">
<xsl:choose>
<xsl:when test="chapterinfo/title">
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="chapterinfo/subtitle">
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/corpauthor"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/authorgroup"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/author"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/author"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/othercredit"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/releaseinfo"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/copyright"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/copyright"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/legalnotice"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/pubdate"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revision"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revision"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revhistory"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/abstract"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/abstract"/>
<xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="chapter.titlepage.verso">
</xsl:template>
 
<xsl:template name="chapter.titlepage.separator">
</xsl:template>
 
<xsl:template name="chapter.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="chapter.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="chapter.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="chapter.titlepage.before.recto"/>
<xsl:call-template name="chapter.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="chapter.titlepage.before.verso"/>
<xsl:call-template name="chapter.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="chapter.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="chapter.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="chapter.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="chapter.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="appendix.titlepage.recto">
<xsl:choose>
<xsl:when test="appendixinfo/title">
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="appendixinfo/subtitle">
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/corpauthor"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/authorgroup"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/author"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/author"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/othercredit"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/releaseinfo"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/copyright"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/copyright"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/legalnotice"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/pubdate"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revision"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revision"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revhistory"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/abstract"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/abstract"/>
<xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="appendix.titlepage.verso">
</xsl:template>
 
<xsl:template name="appendix.titlepage.separator">
</xsl:template>
 
<xsl:template name="appendix.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="appendix.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="appendix.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="appendix.titlepage.before.recto"/>
<xsl:call-template name="appendix.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="appendix.titlepage.before.verso"/>
<xsl:call-template name="appendix.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="appendix.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="appendix.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="appendix.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="appendix.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="section.titlepage.recto">
<xsl:choose>
<xsl:when test="sectioninfo/title">
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="sectioninfo/subtitle">
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/corpauthor"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/authorgroup"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/author"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/othercredit"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/releaseinfo"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/copyright"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/legalnotice"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/pubdate"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revision"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revhistory"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/abstract"/>
<xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="section.titlepage.verso">
</xsl:template>
 
<xsl:template name="section.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</xsl:template>
 
<xsl:template name="section.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="section.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="section.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="section.titlepage.before.recto"/>
<xsl:call-template name="section.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="section.titlepage.before.verso"/>
<xsl:call-template name="section.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="section.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="section.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="section.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="section.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="sect1.titlepage.recto">
<xsl:choose>
<xsl:when test="sect1info/title">
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="sect1info/subtitle">
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/corpauthor"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/authorgroup"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/author"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/othercredit"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/releaseinfo"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/copyright"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/legalnotice"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/pubdate"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revision"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revhistory"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/abstract"/>
<xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="sect1.titlepage.verso">
</xsl:template>
 
<xsl:template name="sect1.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</xsl:template>
 
<xsl:template name="sect1.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect1.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect1.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="sect1.titlepage.before.recto"/>
<xsl:call-template name="sect1.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="sect1.titlepage.before.verso"/>
<xsl:call-template name="sect1.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="sect1.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="sect1.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="sect1.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="sect1.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="sect2.titlepage.recto">
<xsl:choose>
<xsl:when test="sect2info/title">
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="sect2info/subtitle">
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/corpauthor"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/authorgroup"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/author"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/othercredit"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/releaseinfo"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/copyright"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/legalnotice"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/pubdate"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revision"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revhistory"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/abstract"/>
<xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="sect2.titlepage.verso">
</xsl:template>
 
<xsl:template name="sect2.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</xsl:template>
 
<xsl:template name="sect2.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect2.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect2.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="sect2.titlepage.before.recto"/>
<xsl:call-template name="sect2.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="sect2.titlepage.before.verso"/>
<xsl:call-template name="sect2.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="sect2.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="sect2.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="sect2.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="sect2.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="sect3.titlepage.recto">
<xsl:choose>
<xsl:when test="sect3info/title">
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="sect3info/subtitle">
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/corpauthor"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/authorgroup"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/author"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/othercredit"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/releaseinfo"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/copyright"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/legalnotice"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/pubdate"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revision"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revhistory"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/abstract"/>
<xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="sect3.titlepage.verso">
</xsl:template>
 
<xsl:template name="sect3.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</xsl:template>
 
<xsl:template name="sect3.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect3.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect3.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="sect3.titlepage.before.recto"/>
<xsl:call-template name="sect3.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="sect3.titlepage.before.verso"/>
<xsl:call-template name="sect3.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="sect3.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="sect3.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="sect3.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="sect3.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="sect4.titlepage.recto">
<xsl:choose>
<xsl:when test="sect4info/title">
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="sect4info/subtitle">
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/corpauthor"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/authorgroup"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/author"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/othercredit"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/releaseinfo"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/copyright"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/legalnotice"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/pubdate"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revision"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revhistory"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/abstract"/>
<xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="sect4.titlepage.verso">
</xsl:template>
 
<xsl:template name="sect4.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</xsl:template>
 
<xsl:template name="sect4.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect4.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect4.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="sect4.titlepage.before.recto"/>
<xsl:call-template name="sect4.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="sect4.titlepage.before.verso"/>
<xsl:call-template name="sect4.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="sect4.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="sect4.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="sect4.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="sect4.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="sect5.titlepage.recto">
<xsl:choose>
<xsl:when test="sect5info/title">
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="sect5info/subtitle">
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/corpauthor"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/authorgroup"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/author"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/othercredit"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/releaseinfo"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/copyright"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/legalnotice"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/pubdate"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revision"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revhistory"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/abstract"/>
<xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="sect5.titlepage.verso">
</xsl:template>
 
<xsl:template name="sect5.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</xsl:template>
 
<xsl:template name="sect5.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect5.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect5.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="sect5.titlepage.before.recto"/>
<xsl:call-template name="sect5.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="sect5.titlepage.before.verso"/>
<xsl:call-template name="sect5.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="sect5.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="sect5.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="sect5.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="sect5.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="simplesect.titlepage.recto">
<xsl:choose>
<xsl:when test="simplesectinfo/title">
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="simplesectinfo/subtitle">
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/corpauthor"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/authorgroup"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/author"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/author"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/othercredit"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/releaseinfo"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/copyright"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/copyright"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/legalnotice"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/pubdate"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revision"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revision"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revhistory"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/abstract"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/abstract"/>
<xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="simplesect.titlepage.verso">
</xsl:template>
 
<xsl:template name="simplesect.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
</xsl:template>
 
<xsl:template name="simplesect.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="simplesect.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="simplesect.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="simplesect.titlepage.before.recto"/>
<xsl:call-template name="simplesect.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="simplesect.titlepage.before.verso"/>
<xsl:call-template name="simplesect.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="simplesect.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="simplesect.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="simplesect.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="title" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="subtitle" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="corpauthor" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="authorgroup" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="author" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="othercredit" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="copyright" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="legalnotice" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revision" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="revhistory" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template match="abstract" mode="simplesect.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="bibliography.titlepage.recto">
<div xsl:use-attribute-sets="bibliography.titlepage.recto.style">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::bibliography[1]"/>
</xsl:call-template></div>
<xsl:choose>
<xsl:when test="bibliographyinfo/subtitle">
<xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="bibliographyinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="bibliography.titlepage.verso">
</xsl:template>
 
<xsl:template name="bibliography.titlepage.separator">
</xsl:template>
 
<xsl:template name="bibliography.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="bibliography.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="bibliography.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="bibliography.titlepage.before.recto"/>
<xsl:call-template name="bibliography.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="bibliography.titlepage.before.verso"/>
<xsl:call-template name="bibliography.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="bibliography.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="bibliography.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="bibliography.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="subtitle" mode="bibliography.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="bibliography.titlepage.recto.style">
<xsl:apply-templates select="." mode="bibliography.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="glossary.titlepage.recto">
<div xsl:use-attribute-sets="glossary.titlepage.recto.style">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::glossary[1]"/>
</xsl:call-template></div>
<xsl:choose>
<xsl:when test="glossaryinfo/subtitle">
<xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="glossaryinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="glossary.titlepage.verso">
</xsl:template>
 
<xsl:template name="glossary.titlepage.separator">
</xsl:template>
 
<xsl:template name="glossary.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="glossary.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="glossary.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="glossary.titlepage.before.recto"/>
<xsl:call-template name="glossary.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="glossary.titlepage.before.verso"/>
<xsl:call-template name="glossary.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="glossary.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="glossary.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="glossary.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="subtitle" mode="glossary.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="glossary.titlepage.recto.style">
<xsl:apply-templates select="." mode="glossary.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="index.titlepage.recto">
<div xsl:use-attribute-sets="index.titlepage.recto.style">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::index[1]"/>
</xsl:call-template></div>
<xsl:choose>
<xsl:when test="indexinfo/subtitle">
<xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="indexinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="index.titlepage.verso">
</xsl:template>
 
<xsl:template name="index.titlepage.separator">
</xsl:template>
 
<xsl:template name="index.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="index.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="index.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="index.titlepage.before.recto"/>
<xsl:call-template name="index.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="index.titlepage.before.verso"/>
<xsl:call-template name="index.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="index.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="index.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="index.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="subtitle" mode="index.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="index.titlepage.recto.style">
<xsl:apply-templates select="." mode="index.titlepage.recto.mode"/>
</div>
</xsl:template>
 
<xsl:template name="setindex.titlepage.recto">
<div xsl:use-attribute-sets="setindex.titlepage.recto.style">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::setindex[1]"/>
</xsl:call-template></div>
<xsl:choose>
<xsl:when test="setindexinfo/subtitle">
<xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="setindexinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="setindex.titlepage.verso">
</xsl:template>
 
<xsl:template name="setindex.titlepage.separator">
</xsl:template>
 
<xsl:template name="setindex.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="setindex.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="setindex.titlepage">
<div class="titlepage">
<xsl:variable name="recto.content">
<xsl:call-template name="setindex.titlepage.before.recto"/>
<xsl:call-template name="setindex.titlepage.recto"/>
</xsl:variable>
<xsl:variable name="recto.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
<div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="setindex.titlepage.before.verso"/>
<xsl:call-template name="setindex.titlepage.verso"/>
</xsl:variable>
<xsl:variable name="verso.elements.count">
<xsl:choose>
<xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
<!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
<div><xsl:copy-of select="$verso.content"/></div>
</xsl:if>
<xsl:call-template name="setindex.titlepage.separator"/>
</div>
</xsl:template>
 
<xsl:template match="*" mode="setindex.titlepage.recto.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="*" mode="setindex.titlepage.verso.mode">
<!-- if an element isn't found in this mode, -->
<!-- try the generic titlepage.mode -->
<xsl:apply-templates select="." mode="titlepage.mode"/>
</xsl:template>
 
<xsl:template match="subtitle" mode="setindex.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="setindex.titlepage.recto.style">
<xsl:apply-templates select="." mode="setindex.titlepage.recto.mode"/>
</div>
</xsl:template>
 
</xsl:stylesheet>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/chunktoc.xsl
0,0 → 1,462
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="doc">
 
<!-- ********************************************************************
$Id: chunktoc.xsl 8228 2007-07-21 15:00:15Z manuel $
********************************************************************
 
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(*)&gt;0 or $generate.index != '0'">
<xsl:call-template name="process-chunk"/>
</xsl:if>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="/">
<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>
 
<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:apply-templates select="key('id',$rootid)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
 
<xsl:otherwise>
<xsl:apply-templates select="/" mode="process.root"/>
</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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autotoc.xsl
0,0 → 1,632
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
 
<!-- ********************************************************************
$Id: autotoc.xsl 8228 2007-07-21 15:00:15Z manuel $
********************************************************************
 
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: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}" namespace="http://www.w3.org/1999/xhtml">
<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}" namespace="http://www.w3.org/1999/xhtml">
<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}" namespace="http://www.w3.org/1999/xhtml">
<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}" namespace="http://www.w3.org/1999/xhtml">
<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}" namespace="http://www.w3.org/1999/xhtml">
<xsl:copy-of select="$subtoc"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:element name="{$toc.listitem.type}" namespace="http://www.w3.org/1999/xhtml">
<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 &gt; $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 &gt; $depth.from.context">
<xsl:copy-of select="$subtoc.list"/>
</xsl:if>
</xsl:element>
<xsl:if test="$toc.listitem.type != 'li' and $toc.section.depth &gt; $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 &gt; $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 |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}" namespace="http://www.w3.org/1999/xhtml">
<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}" namespace="http://www.w3.org/1999/xhtml">
<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}" namespace="http://www.w3.org/1999/xhtml">
<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}" namespace="http://www.w3.org/1999/xhtml">
<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}" namespace="http://www.w3.org/1999/xhtml">
<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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/inline.xsl
0,0 → 1,1404
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xlink suwl" version="1.0">
 
<!-- ********************************************************************
$Id: inline.xsl 8369 2007-09-09 08:55:14Z manuel $
********************************************************************
 
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="simple.xlink">
<xsl:param name="node" select="."/>
<xsl:param name="content">
<xsl:apply-templates/>
</xsl:param>
<xsl:param name="a.target"/>
<xsl:param name="linkend" select="$node/@linkend"/>
<xsl:param name="xhref" select="$node/@xlink:href"/>
 
<xsl:variable name="link">
<xsl:choose>
<xsl:when test="$xhref and (not($node/@xlink:type) or $node/@xlink:type='simple')">
 
<!-- Is it a local idref or a uri? -->
<xsl:variable name="is.idref">
<xsl:choose>
<!-- if the href starts with # and does not contain an "(" -->
<!-- or if the href starts with #xpointer(id(, it's just an ID -->
<xsl:when test="starts-with($xhref,'#') and (not(contains($xhref,'(')) or starts-with($xhref, '#xpointer(id('))">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<!-- Is it an olink ? -->
<xsl:variable name="is.olink">
<xsl:choose>
<!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
<!-- and if the href contains # -->
<xsl:when test="contains($xhref,'#') and @xlink:role = $xolink.role">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:choose>
<xsl:when test="$is.idref = 1">
 
<xsl:variable name="idref">
<xsl:call-template name="xpointer.idref">
<xsl:with-param name="xpointer" select="$xhref"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="targets" select="key('id',$idref)"/>
<xsl:variable name="target" select="$targets[1]"/>
 
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="$idref"/>
</xsl:call-template>
 
<xsl:choose>
<xsl:when test="count($target) = 0">
<xsl:message>
<xsl:text>XLink to nonexistent id: </xsl:text>
<xsl:value-of select="$idref"/>
</xsl:message>
<xsl:copy-of select="$content"/>
</xsl:when>
 
<xsl:otherwise>
<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"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:choose>
<xsl:when test="$node/@xlink:title">
<xsl:attribute name="title">
<xsl:value-of select="$node/@xlink:title"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$target" mode="html.title.attribute"/>
</xsl:otherwise>
</xsl:choose>
 
<xsl:if test="$a.target">
<xsl:attribute name="target">
<xsl:value-of select="$a.target"/>
</xsl:attribute>
</xsl:if>
 
<xsl:copy-of select="$content"/>
 
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
 
<xsl:when test="$is.olink = 1">
<xsl:call-template name="olink">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:when>
 
<!-- otherwise it's a URI -->
<xsl:otherwise>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:attribute name="href">
<xsl:value-of select="$xhref"/>
</xsl:attribute>
<xsl:if test="$node/@xlink:title">
<xsl:attribute name="title">
<xsl:value-of select="$node/@xlink:title"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
 
<xsl:when test="$linkend">
<xsl:variable name="targets" select="key('id',$linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
 
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="$linkend"/>
</xsl:call-template>
 
<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"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:apply-templates select="$target" mode="html.title.attribute"/>
 
<xsl:copy-of select="$content"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:choose>
<xsl:when test="function-available('suwl:unwrapLinks')">
<xsl:copy-of select="suwl:unwrapLinks($link)"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$link"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="inline.charseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<!-- * if you want output from the inline.charseq template wrapped in -->
<!-- * something other than a Span, call the template with some value -->
<!-- * for the 'wrapper-name' param -->
<xsl:param name="wrapper-name">span</xsl:param>
<xsl:element name="{$wrapper-name}" namespace="http://www.w3.org/1999/xhtml">
<xsl:attribute name="class">
<xsl:value-of select="local-name(.)"/>
</xsl:attribute>
<xsl:call-template name="dir"/>
<xsl:call-template name="generate.html.title"/>
<xsl:copy-of select="$content"/>
<xsl:call-template name="apply-annotations"/>
</xsl:element>
</xsl:template>
 
<xsl:template name="inline.monoseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<code>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="dir"/>
<xsl:call-template name="generate.html.title"/>
<xsl:copy-of select="$content"/>
<xsl:call-template name="apply-annotations"/>
</code>
</xsl:template>
 
<xsl:template name="inline.boldseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="dir"/>
 
<!-- don't put <strong> inside figure, example, or table titles -->
<xsl:choose>
<xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
<xsl:copy-of select="$content"/>
</xsl:when>
<xsl:otherwise>
<strong>
<xsl:copy-of select="$content"/>
</strong>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="apply-annotations"/>
</span>
</xsl:template>
 
<xsl:template name="inline.italicseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<em>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="dir"/>
<xsl:copy-of select="$content"/>
<xsl:call-template name="apply-annotations"/>
</em>
</xsl:template>
 
<xsl:template name="inline.boldmonoseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<!-- don't put <strong> inside figure, example, or table titles -->
<!-- or other titles that may already be represented with <strong>'s. -->
<xsl:choose>
<xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
<code>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="dir"/>
<xsl:copy-of select="$content"/>
<xsl:call-template name="apply-annotations"/>
</code>
</xsl:when>
<xsl:otherwise>
<strong>
<xsl:apply-templates select="." mode="class.attribute"/>
<code>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="dir"/>
<xsl:copy-of select="$content"/>
</code>
<xsl:call-template name="apply-annotations"/>
</strong>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="inline.italicmonoseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<em>
<xsl:apply-templates select="." mode="class.attribute"/>
<code>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="dir"/>
<xsl:copy-of select="$content"/>
<xsl:call-template name="apply-annotations"/>
</code>
</em>
</xsl:template>
 
<xsl:template name="inline.superscriptseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<sup>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="dir"/>
<xsl:copy-of select="$content"/>
<xsl:call-template name="apply-annotations"/>
</sup>
</xsl:template>
 
<xsl:template name="inline.subscriptseq">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
<sub>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="dir"/>
<xsl:copy-of select="$content"/>
<xsl:call-template name="apply-annotations"/>
</sub>
</xsl:template>
 
<!-- ==================================================================== -->
<!-- some special cases -->
 
<xsl:template match="author">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<xsl:template match="editor">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<xsl:template match="othercredit">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<xsl:template match="authorinitials">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="accel">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="action">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="application">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="classname">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="exceptionname">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="interfacename">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="methodname">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="command">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
 
<xsl:template match="computeroutput">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="constant">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="database">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="date">
<!-- should this support locale-specific formatting? how? -->
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="errorcode">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="errorname">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="errortype">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="errortext">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="envar">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="filename">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="function">
<xsl:choose>
<xsl:when test="$function.parens != '0' and (parameter or function or replaceable)">
<xsl:variable name="nodes" select="text()|*"/>
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates select="$nodes[1]"/>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:text>(</xsl:text>
<xsl:apply-templates select="$nodes[position()&gt;1]"/>
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.monoseq"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="function/parameter" priority="2">
<xsl:call-template name="inline.italicmonoseq"/>
<xsl:if test="following-sibling::*">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:template>
 
<xsl:template match="function/replaceable" priority="2">
<xsl:call-template name="inline.italicmonoseq"/>
<xsl:if test="following-sibling::*">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:template>
 
<xsl:template match="guibutton">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="guiicon">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="guilabel">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="guimenu">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="guimenuitem">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="guisubmenu">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="hardware">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="interface">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="interfacedefinition">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="keycap">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
 
<xsl:template match="keycode">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="keysym">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="literal">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="code">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="medialabel">
<xsl:call-template name="inline.italicseq"/>
</xsl:template>
 
<xsl:template match="shortcut">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
 
<xsl:template match="mousebutton">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="option">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="package">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="parameter">
<xsl:call-template name="inline.italicmonoseq"/>
</xsl:template>
 
<xsl:template match="property">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="prompt">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="replaceable" priority="1">
<xsl:call-template name="inline.italicmonoseq"/>
</xsl:template>
 
<xsl:template match="returnvalue">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="structfield">
<xsl:call-template name="inline.italicmonoseq"/>
</xsl:template>
 
<xsl:template match="structname">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="symbol">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="systemitem">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="token">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="type">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="userinput">
<xsl:call-template name="inline.boldmonoseq"/>
</xsl:template>
 
<xsl:template match="abbrev">
<xsl:call-template name="inline.charseq">
<xsl:with-param name="wrapper-name">abbr</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="acronym">
<xsl:call-template name="inline.charseq">
<xsl:with-param name="wrapper-name">acronym</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="citerefentry">
<xsl:choose>
<xsl:when test="$citerefentry.link != '0'">
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:attribute name="href">
<xsl:call-template name="generate.citerefentry.link"/>
</xsl:attribute>
<xsl:call-template name="inline.charseq"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.charseq"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="generate.citerefentry.link">
<!-- nop -->
</xsl:template>
 
<xsl:template name="x.generate.citerefentry.link">
<xsl:text>http://example.com/cgi-bin/man.cgi?</xsl:text>
<xsl:value-of select="refentrytitle"/>
<xsl:text>(</xsl:text>
<xsl:value-of select="manvolnum"/>
<xsl:text>)</xsl:text>
</xsl:template>
 
<xsl:template match="citetitle">
<xsl:choose>
<xsl:when test="@pubwork = 'article'">
<xsl:call-template name="gentext.startquote"/>
<xsl:call-template name="inline.charseq"/>
<xsl:call-template name="gentext.endquote"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.italicseq"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="emphasis">
<span>
<xsl:choose>
<xsl:when test="@role and $emphasis.propagates.style != 0">
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="@role"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="class.attribute"/>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="anchor"/>
 
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:choose>
<xsl:when test="@role = 'bold' or @role='strong'">
<!-- backwards compatibility: make bold into b elements, but -->
<!-- don't put bold inside figure, example, or table titles -->
<xsl:choose>
<xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' or local-name(../..) = 'example' or local-name(../..) = 'table')">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<strong><xsl:apply-templates/></strong>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@role and $emphasis.propagates.style != 0">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<em><xsl:apply-templates/></em>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</span>
</xsl:template>
 
<xsl:template match="foreignphrase">
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:if test="@lang or @xml:lang">
<xsl:call-template name="language.attribute"/>
</xsl:if>
<xsl:call-template name="inline.italicseq"/>
</span>
</xsl:template>
 
<xsl:template match="markup">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="phrase">
<span>
<xsl:call-template name="generate.html.title"/>
<xsl:if test="@lang or @xml:lang">
<xsl:call-template name="language.attribute"/>
</xsl:if>
<xsl:if test="@role and $phrase.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="dir"/>
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</span>
</xsl:template>
 
<xsl:template match="quote">
<xsl:variable name="depth">
<xsl:call-template name="dot.count">
<xsl:with-param name="string">
<xsl:number level="multiple"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$depth mod 2 = 0">
<xsl:call-template name="gentext.startquote"/>
<xsl:call-template name="inline.charseq"/>
<xsl:call-template name="gentext.endquote"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gentext.nestedstartquote"/>
<xsl:call-template name="inline.charseq"/>
<xsl:call-template name="gentext.nestedendquote"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="varname">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<xsl:template match="wordasword">
<xsl:call-template name="inline.italicseq"/>
</xsl:template>
 
<xsl:template match="lineannotation">
<em>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="inline.charseq"/>
</em>
</xsl:template>
 
<xsl:template match="superscript">
<xsl:call-template name="inline.superscriptseq"/>
</xsl:template>
 
<xsl:template match="subscript">
<xsl:call-template name="inline.subscriptseq"/>
</xsl:template>
 
<xsl:template match="trademark">
<xsl:call-template name="inline.charseq"/>
<xsl:choose>
<xsl:when test="@class = 'copyright' or @class = 'registered'">
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat" select="@class"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@class = 'service'">
<sup>SM</sup>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat" select="'trademark'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="firstterm">
<xsl:call-template name="glossterm">
<xsl:with-param name="firstterm" select="1"/>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="glossterm" name="glossterm">
<xsl:param name="firstterm" select="0"/>
 
<!-- To avoid extra <a name=""> anchor from inline.italicseq -->
<xsl:variable name="content">
<xsl:apply-templates/>
</xsl:variable>
 
<xsl:choose>
<xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
<xsl:variable name="targets" select="key('id',@linkend)"/>
<xsl:variable name="target" select="$targets[1]"/>
 
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:call-template>
 
<xsl:choose>
<xsl:when test="$target">
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:if test="@id or @xml:id">
<xsl:attribute name="id">
<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:call-template name="inline.italicseq">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.italicseq">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
 
<xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and ($glossterm.auto.link != 0) and $glossary.collection != ''">
<xsl:variable name="term">
<xsl:choose>
<xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:variable name="cterm" select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
 
<!-- HACK HACK HACK! But it works... -->
<!-- You'd need to do more work if you wanted to chunk on glossdiv, though -->
 
<xsl:variable name="glossary" select="//glossary[@role='auto']"/>
 
<xsl:if test="count($glossary) != 1">
<xsl:message>
<xsl:text>Warning: glossary.collection specified, but there are </xsl:text>
<xsl:value-of select="count($glossary)"/>
<xsl:text> automatic glossaries</xsl:text>
</xsl:message>
</xsl:if>
 
<xsl:variable name="glosschunk">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$glossary"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="chunkbase">
<xsl:choose>
<xsl:when test="contains($glosschunk, '#')">
<xsl:value-of select="substring-before($glosschunk, '#')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$glosschunk"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:choose>
<xsl:when test="not($cterm)">
<xsl:message>
<xsl:text>There's no entry for </xsl:text>
<xsl:value-of select="$term"/>
<xsl:text> in </xsl:text>
<xsl:value-of select="$glossary.collection"/>
</xsl:message>
<xsl:call-template name="inline.italicseq"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="id">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$cterm"/>
</xsl:call-template>
</xsl:variable>
<a href="{$chunkbase}#{$id}">
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="inline.italicseq">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
 
<xsl:when test="not(@linkend) and ($firstterm.only.link = 0 or $firstterm = 1) and $glossterm.auto.link != 0">
<xsl:variable name="term">
<xsl:choose>
<xsl:when test="@baseform">
<xsl:value-of select="normalize-space(@baseform)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space(.)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="targets" select="//glossentry[normalize-space(glossterm)=$term or normalize-space(glossterm/@baseform)=$term]"/>
<xsl:variable name="target" select="$targets[1]"/>
 
<xsl:choose>
<xsl:when test="count($targets)=0">
<xsl:message>
<xsl:text>Error: no glossentry for glossterm: </xsl:text>
<xsl:value-of select="."/>
<xsl:text>.</xsl:text>
</xsl:message>
<xsl:call-template name="inline.italicseq"/>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:if test="@id or @xml:id">
<xsl:attribute name="id">
<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:call-template name="inline.italicseq">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
 
<xsl:otherwise>
<xsl:call-template name="inline.italicseq"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="termdef">
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'termdef'"/>
<xsl:with-param name="name" select="'prefix'"/>
</xsl:call-template>
<xsl:apply-templates/>
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'termdef'"/>
<xsl:with-param name="name" select="'suffix'"/>
</xsl:call-template>
</span>
</xsl:template>
 
<xsl:template match="sgmltag|tag">
<xsl:call-template name="format.sgmltag"/>
</xsl:template>
 
<xsl:template name="format.sgmltag">
<xsl:param name="class">
<xsl:choose>
<xsl:when test="@class">
<xsl:value-of select="@class"/>
</xsl:when>
<xsl:otherwise>element</xsl:otherwise>
</xsl:choose>
</xsl:param>
 
<xsl:variable name="content">
<xsl:choose>
<xsl:when test="$class='attribute'">
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="$class='attvalue'">
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="$class='element'">
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="$class='endtag'">
<xsl:text>&lt;/</xsl:text>
<xsl:apply-templates/>
<xsl:text>&gt;</xsl:text>
</xsl:when>
<xsl:when test="$class='genentity'">
<xsl:text>&amp;</xsl:text>
<xsl:apply-templates/>
<xsl:text>;</xsl:text>
</xsl:when>
<xsl:when test="$class='numcharref'">
<xsl:text>&amp;#</xsl:text>
<xsl:apply-templates/>
<xsl:text>;</xsl:text>
</xsl:when>
<xsl:when test="$class='paramentity'">
<xsl:text>%</xsl:text>
<xsl:apply-templates/>
<xsl:text>;</xsl:text>
</xsl:when>
<xsl:when test="$class='pi'">
<xsl:text>&lt;?</xsl:text>
<xsl:apply-templates/>
<xsl:text>&gt;</xsl:text>
</xsl:when>
<xsl:when test="$class='xmlpi'">
<xsl:text>&lt;?</xsl:text>
<xsl:apply-templates/>
<xsl:text>?&gt;</xsl:text>
</xsl:when>
<xsl:when test="$class='starttag'">
<xsl:text>&lt;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&gt;</xsl:text>
</xsl:when>
<xsl:when test="$class='emptytag'">
<xsl:text>&lt;</xsl:text>
<xsl:apply-templates/>
<xsl:text>/&gt;</xsl:text>
</xsl:when>
<xsl:when test="$class='sgmlcomment' or $class='comment'">
<xsl:text>&lt;!--</xsl:text>
<xsl:apply-templates/>
<xsl:text>--&gt;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<code>
<xsl:apply-templates select="." mode="class.attribute">
<xsl:with-param name="class" select="concat('sgmltag-', $class)"/>
</xsl:apply-templates>
<xsl:call-template name="generate.html.title"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content" select="$content"/>
</xsl:call-template>
</code>
</xsl:template>
 
<xsl:template match="email">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:if test="not($email.delimiters.enabled = 0)">
<xsl:text>&lt;</xsl:text>
</xsl:if>
<a>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:attribute name="href">
<xsl:text>mailto:</xsl:text>
<xsl:value-of select="."/>
</xsl:attribute>
<xsl:apply-templates/>
</a>
<xsl:if test="not($email.delimiters.enabled = 0)">
<xsl:text>&gt;</xsl:text>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="keycombo">
<xsl:variable name="action" select="@action"/>
<xsl:variable name="joinchar">
<xsl:choose>
<xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
<xsl:when test="$action='simul'">+</xsl:when>
<xsl:when test="$action='press'">-</xsl:when>
<xsl:when test="$action='click'">-</xsl:when>
<xsl:when test="$action='double-click'">-</xsl:when>
<xsl:when test="$action='other'"/>
<xsl:otherwise>+</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="*">
<xsl:if test="position()&gt;1"><xsl:value-of select="$joinchar"/></xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
 
<xsl:template match="uri">
<xsl:call-template name="inline.monoseq"/>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="menuchoice">
<xsl:variable name="shortcut" select="./shortcut"/>
<xsl:call-template name="process.menuchoice"/>
<xsl:if test="$shortcut">
<xsl:text> (</xsl:text>
<xsl:apply-templates select="$shortcut"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:template>
 
<xsl:template name="process.menuchoice">
<xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
<xsl:param name="count" select="1"/>
 
<xsl:choose>
<xsl:when test="$count&gt;count($nodelist)"/>
<xsl:when test="$count=1">
<xsl:apply-templates select="$nodelist[$count=position()]"/>
<xsl:call-template name="process.menuchoice">
<xsl:with-param name="nodelist" select="$nodelist"/>
<xsl:with-param name="count" select="$count+1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="node" select="$nodelist[$count=position()]"/>
<xsl:choose>
<xsl:when test="local-name($node)='guimenuitem' or local-name($node)='guisubmenu'">
<xsl:value-of select="$menuchoice.menu.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$menuchoice.separator"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="$node"/>
<xsl:call-template name="process.menuchoice">
<xsl:with-param name="nodelist" select="$nodelist"/>
<xsl:with-param name="count" select="$count+1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="optional">
<xsl:value-of select="$arg.choice.opt.open.str"/>
<xsl:call-template name="inline.charseq"/>
<xsl:value-of select="$arg.choice.opt.close.str"/>
</xsl:template>
 
<xsl:template match="citation">
<!-- todo: integrate with bibliography collection -->
<xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
<xsl:variable name="target" select="$targets[1]"/>
 
<xsl:choose>
<!-- try automatic linking based on match to abbrev -->
<xsl:when test="$target and not(xref) and not(link)">
 
<xsl:text>[</xsl:text>
<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"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:choose>
<xsl:when test="$bibliography.numbered != 0">
<xsl:apply-templates select="$target" mode="citation"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.charseq"/>
</xsl:otherwise>
</xsl:choose>
 
</a>
<xsl:text>]</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>[</xsl:text>
<xsl:call-template name="inline.charseq"/>
<xsl:text>]</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="biblioentry|bibliomixed" mode="citation">
<xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="comment[parent::answer|parent::appendix|parent::article|parent::bibliodiv|parent::bibliography|parent::blockquote|parent::caution|parent::chapter|parent::glossary|parent::glossdiv|parent::important|parent::index|parent::indexdiv|parent::listitem|parent::note|parent::orderedlist|parent::partintro|parent::preface|parent::procedure|parent::qandadiv|parent::qandaset|parent::question|parent::refentry|parent::refnamediv|parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection|parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4|parent::sect5|parent::section|parent::setindex|parent::sidebar|parent::simplesect|parent::taskprerequisites|parent::taskrelated|parent::tasksummary|parent::warning]|remark[parent::answer|parent::appendix|parent::article|parent::bibliodiv|parent::bibliography|parent::blockquote|parent::caution|parent::chapter|parent::glossary|parent::glossdiv|parent::important|parent::index|parent::indexdiv|parent::listitem|parent::note|parent::orderedlist|parent::partintro|parent::preface|parent::procedure|parent::qandadiv|parent::qandaset|parent::question|parent::refentry|parent::refnamediv|parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection|parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4|parent::sect5|parent::section|parent::setindex|parent::sidebar|parent::simplesect|parent::taskprerequisites|parent::taskrelated|parent::tasksummary|parent::warning]">
<xsl:if test="$show.comments != 0">
<p class="remark"><i><xsl:call-template name="inline.charseq"/></i></p>
</xsl:if>
</xsl:template>
 
<xsl:template match="comment|remark">
<xsl:if test="$show.comments != 0">
<em><xsl:call-template name="inline.charseq"/></em>
</xsl:if>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="productname">
<xsl:call-template name="inline.charseq"/>
<xsl:if test="@class">
<xsl:call-template name="dingbat">
<xsl:with-param name="dingbat" select="@class"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
 
<xsl:template match="productnumber">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="pob|street|city|state|postcode|country|otheraddr">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="phone|fax">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<!-- in Addresses, for example -->
<xsl:template match="honorific|firstname|surname|lineage|othername">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="person">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates select="personname"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<xsl:template match="personname">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="org">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<xsl:template match="orgname">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<xsl:template match="orgdiv">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<xsl:template match="affiliation">
<xsl:param name="content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="apply-annotations"/>
</xsl:param>
 
<span>
<xsl:apply-templates select="." mode="class.attribute"/>
<xsl:copy-of select="$content"/>
</span>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="beginpage">
<!-- does nothing; this *is not* markup to force a page break. -->
</xsl:template>
 
</xsl:stylesheet>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/profile-chunk-code.xsl
0,0 → 1,611
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<!--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" xmlns="http://www.w3.org/1999/xhtml" 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: profile-chunk-code.xsl 8228 2007-07-21 15:00:15Z manuel $
********************************************************************
 
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.-->
<!-- 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 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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/profile-docbook.xsl
0,0 → 1,409
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<!--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" xmlns="http://www.w3.org/1999/xhtml" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="db ng exsl exslt" version="1.0">
 
<xsl:output method="xml" encoding="UTF-8" indent="no" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
 
<!-- ********************************************************************
$Id: profile-docbook.xsl 8369 2007-09-09 08:55:14Z manuel $
********************************************************************
 
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="'xhtml'"/>
<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">
<!-- no apply-templates; make it empty -->
</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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/formal.xsl
0,0 → 1,386
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
 
<!-- ********************************************************************
$Id: formal.xsl 8369 2007-09-09 08:55:14Z manuel $
********************************************************************
 
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>
<xsl:copy>
<xsl:copy-of select="@*[not(local-name()='id')]"/>
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
<xsl:call-template name="htmlTable"/>
</xsl:copy>
</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 match="figure/titleabbrev"/>
<xsl:template match="table/title"/>
<xsl:template match="table/titleabbrev"/>
<xsl:template match="table/textobject"/>
<xsl:template match="example/title"/>
<xsl:template match="example/titleabbrev"/>
<xsl:template match="equation/title"/>
<xsl:template match="equation/titleabbrev"/>
 
<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>
<table>
<xsl:copy-of select="@*"/>
<xsl:call-template name="htmlTable"/>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="informaltable/textobject"/>
 
<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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/docbook.xsl
0,0 → 1,447
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML 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="http://www.w3.org/1999/xhtml" exclude-result-prefixes="db ng exsl" version="1.0">
 
<xsl:output method="xml" encoding="UTF-8" indent="no" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
 
<!-- ********************************************************************
$Id: docbook.xsl 8369 2007-09-09 08:55:14Z manuel $
********************************************************************
 
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="'xhtml'"/>
<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">
<!-- no apply-templates; make it empty -->
</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>
 
<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="(function-available('exsl:node-set') or contains(system-property('xsl:vendor'), 'Apache Software Foundation')) 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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/chunk-code.xsl
0,0 → 1,639
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML 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="http://www.w3.org/1999/xhtml" exclude-result-prefixes="exsl cf ng db" version="1.0">
 
<!-- ********************************************************************
$Id: chunk-code.xsl 8228 2007-07-21 15:00:15Z manuel $
********************************************************************
 
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>
 
<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="(function-available('exsl:node-set') or contains(system-property('xsl:vendor'), 'Apache Software Foundation')) 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(*)&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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/division.xsl
0,0 → 1,228
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
 
<!-- ********************************************************************
$Id: division.xsl 8228 2007-07-21 15:00:15Z manuel $
********************************************************************
 
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="class.attribute"/>
<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 match="set/title"/>
<xsl:template match="set/titleabbrev"/>
<xsl:template match="set/subtitle"/>
 
<!-- ==================================================================== -->
 
<xsl:template match="book">
<xsl:call-template name="id.warning"/>
 
<div>
<xsl:apply-templates select="." mode="class.attribute"/>
<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="book.titlepage"/>
 
<xsl:apply-templates select="dedication" mode="dedication"/>
 
<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 match="book/info"/>
<xsl:template match="book/title"/>
<xsl:template match="book/titleabbrev"/>
<xsl:template match="book/subtitle"/>
 
<!-- ==================================================================== -->
 
<xsl:template match="part">
<xsl:call-template name="id.warning"/>
 
<div>
<xsl:apply-templates select="." mode="class.attribute"/>
<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="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 match="part/partinfo"/>
<xsl:template match="part/info"/>
<xsl:template match="part/title"/>
<xsl:template match="part/titleabbrev"/>
<xsl:template match="part/subtitle"/>
 
<xsl:template match="partintro">
<xsl:call-template name="id.warning"/>
 
<div>
<xsl:apply-templates select="." mode="class.attribute"/>
<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="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 match="partintro/titleabbrev"/>
<xsl:template match="partintro/subtitle"/>
 
<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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/toc.xsl
0,0 → 1,163
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
 
<!-- ********************************************************************
$Id: toc.xsl 8196 2007-07-05 21:18:33Z manuel $
********************************************************************
 
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="toc">
<xsl:choose>
<xsl:when test="*">
<xsl:if test="$process.source.toc != 0">
<!-- if the toc isn't empty, process it -->
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
<xsl:apply-templates/>
</xsl:element>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$process.empty.source.toc != 0">
<xsl:choose>
<xsl:when test="parent::section or parent::sect1 or parent::sect2 or parent::sect3 or parent::sect4 or parent::sect5">
<xsl:apply-templates select="parent::*" mode="toc.for.section"/>
</xsl:when>
<xsl:when test="parent::article">
<xsl:apply-templates select="parent::*" mode="toc.for.component"/>
</xsl:when>
<xsl:when test="parent::book or parent::part">
<xsl:apply-templates select="parent::*" mode="toc.for.division"/>
</xsl:when>
<xsl:when test="parent::set">
<xsl:apply-templates select="parent::*" mode="toc.for.set"/>
</xsl:when>
<!-- there aren't any other contexts that allow toc -->
<xsl:otherwise>
<xsl:message>
<xsl:text>I don't know how to make a TOC in this context!</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</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:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5"/>
</xsl:element>
</dd>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
<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="tocentry[position() = last()]"/>
</dt>
<xsl:copy-of select="$sub-toc"/>
</xsl:when>
<xsl:otherwise>
<li>
<xsl:apply-templates select="tocentry[position() = last()]"/>
<xsl:copy-of select="$sub-toc"/>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="tocentry|tocfront|tocback">
<xsl:choose>
<xsl:when test="$toc.list.type = 'dl'">
<dt>
<xsl:call-template name="tocentry-content"/>
</dt>
</xsl:when>
<xsl:otherwise>
<li>
<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="*" mode="toc.for.section">
<xsl:call-template name="section.toc"/>
</xsl:template>
 
<xsl:template match="*" mode="toc.for.component">
<xsl:call-template name="component.toc"/>
</xsl:template>
 
<xsl:template match="*" mode="toc.for.section">
<xsl:call-template name="section.toc"/>
</xsl:template>
 
<xsl:template match="*" mode="toc.for.division">
<xsl:call-template name="division.toc"/>
</xsl:template>
 
<xsl:template match="*" mode="toc.for.set">
<xsl:call-template name="set.toc"/>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="lot|lotentry">
</xsl:template>
 
</xsl:stylesheet>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/chunkfast.xsl
0,0 → 1,69
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML 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="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="cf exsl">
 
<!-- ********************************************************************
$Id: chunkfast.xsl 8196 2007-07-05 21:18:33Z manuel $
********************************************************************
 
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 function-available('exsl:node-set')">
<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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx-kosek.xsl
0,0 → 1,109
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<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" xmlns="http://www.w3.org/1999/xhtml" extension-element-prefixes="func exslt" exclude-result-prefixes="func exslt i l k" version="1.0">
 
<!-- ********************************************************************
$Id: autoidx-kosek.xsl 8196 2007-07-05 21:18:33Z manuel $
********************************************************************
 
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="not(function-available('exslt:node-set') or function-available('exslt:nodeSet'))">
<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
</xsl:text>
<xsl:text>index extension functions be imported:
</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(normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = &quot;&quot;]))))[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][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(normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = &quot;&quot;])))" 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(normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = &quot;&quot;])))"/>
 
<xsl:variable name="lang">
<xsl:call-template name="l10n.language"/>
</xsl:variable>
 
<xsl:if test="key('group-code', $key)[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][count(.|key('primary', normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = &quot;&quot;])))[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][1]) = 1]">
<div class="indexdiv">
<h3>
<xsl:value-of select="i:group-letter($key)"/>
</h3>
<dl>
<xsl:apply-templates select="key('group-code', $key)[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][count(.|key('primary', normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = &quot;&quot;])))[count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))][1])=1]" mode="index-primary">
<xsl:sort select="normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = &quot;&quot;]))" 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>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/biblio-iso690.xsl
0,0 → 1,1300
<?xml version="1.0" encoding="ASCII"?>
<!--This file was created automatically by html2xhtml-->
<!--from the HTML stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
 
 
<!-- ********************************************************************
$Id: biblio-iso690.xsl 8196 2007-07-05 21:18:33Z manuel $
********************************************************************
 
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 original code for processing bibliography in ISO690 style
was provided by Jana Dvorakova <jana4u@seznam.cz>
 
******************************************************************** -->
 
<!-- ==================================================================== -->
 
<!-- if biblioentry.alt.primary.seps is set to nonzero value then use alternative separators for primary responsibility - $alt.person.two.sep, $alt.person.last.sep, $alt.person.more.sep -->
<xsl:param name="biblioentry.alt.primary.seps" select="0"/>
 
<!-- how many authors will be printed if there is more than three authors - set to number 1 (default value), 2 or 3 -->
<xsl:param name="biblioentry.primary.count" select="1"/>
 
<!-- ==================================================================== -->
 
<xsl:template name="iso690.makecitation">
<!-- Types of resources -->
<xsl:choose>
 
<!-- SYSTEMS OF ELECTRONIC COMMUNICATION : ENTIRE MESSAGE SYSTEM -->
<!-- same as Monographs -->
<xsl:when test="./@role='messagesystem'">
<xsl:call-template name="iso690.monogr"/>
</xsl:when>
 
<!-- SYSTEMS OF ELECTRONIC COMMUNICATION : ELECTRONIC MESSAGES -->
<!-- same as Contributions to Monographs -->
<xsl:when test="./@role='message'">
<xsl:call-template name="iso690.paper.mon"/>
</xsl:when>
 
<!-- SERIALS -->
<xsl:when test="./@role='serial' or ./biblioid/@class='issn' or ./issn">
<xsl:call-template name="iso690.serial"/>
</xsl:when>
 
<!-- PARTS OF MONOGRAPHS -->
<xsl:when test="./@role='part' or (./bibliomisc[@role='secnum']|./bibliomisc[@role='sectitle'])">
<xsl:call-template name="iso690.monogr.part"/>
</xsl:when>
 
<!-- CONTRIBUTIONS TO MONOGRAPHS -->
<xsl:when test="./@role='contribution' or (./biblioset/@relation='part' and ./biblioset/@relation='book')">
<xsl:call-template name="iso690.paper.mon"/>
</xsl:when>
 
<!-- ARTICLES, ETC., IN SERIALS -->
<xsl:when test="./@role='article' or (./biblioset/@relation='journal' and ./biblioset/@relation='article')">
<xsl:call-template name="iso690.article"/>
</xsl:when>
 
<!-- PATENT DOCUMENTS -->
<xsl:when test="./@role='patent' or (./bibliomisc[@role='patenttype'] and ./bibliomisc[@role='patentnum'])">
<xsl:call-template name="iso690.patent"/>
</xsl:when>
 
<!-- MONOGRAPHS -->
<xsl:otherwise>
<xsl:call-template name="iso690.monogr"/>
</xsl:otherwise>
 
</xsl:choose>
</xsl:template>
 
<!-- ==================================================================== -->
 
<!-- MONOGRAPHS -->
<xsl:template name="iso690.monogr">
<!-- Primary responsibility -->
<xsl:call-template name="iso690.primary"/>
<!-- Title and Type of medium -->
<xsl:call-template name="iso690.title"/>
<!-- Subordinate responsibility -->
<xsl:call-template name="iso690.secondary"/>
<!-- Edition -->
<xsl:call-template name="iso690.edition"/>
<!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
<xsl:call-template name="iso690.pub"/>
<!-- Extent -->
<xsl:call-template name="iso690.extent"/>
<!-- Series -->
<xsl:call-template name="iso690.serie"/>
<!-- Notes -->
<xsl:call-template name="iso690.notice"/>
<!-- Avaibility and access -->
<xsl:call-template name="iso690.access"/>
<!-- Standard number -->
<xsl:call-template name="iso690.isbn"/>
</xsl:template>
 
<!-- SERIALS -->
<xsl:template name="iso690.serial">
<!-- Title and Type of medium -->
<xsl:call-template name="iso690.title"/>
<!-- Responsibility [nonEL] -->
<xsl:if test="not(./bibliomisc[@role='medium'])">
<xsl:call-template name="iso690.secondary"/>
</xsl:if>
<!-- Edition -->
<xsl:call-template name="iso690.edition">
<xsl:with-param name="after" select="./bibliomisc[@role='issuing']"/>
</xsl:call-template>
<!-- Issue designation (date and/or num) [nonEL] -->
<xsl:if test="not(./bibliomisc[@role='medium'])">
<xsl:call-template name="iso690.issuing"/>
</xsl:if>
<!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
<xsl:call-template name="iso690.pub"/>
<!-- Series -->
<xsl:call-template name="iso690.serie"/>
<!-- Notes -->
<xsl:call-template name="iso690.notice"/>
<!-- Avaibility and access -->
<xsl:call-template name="iso690.access"/>
<!-- Standard number -->
<xsl:call-template name="iso690.issn"/>
</xsl:template>
 
<!-- PARTS OF MONOGRAPHS -->
<xsl:template name="iso690.monogr.part">
<!-- Primary responsibility of host document -->
<xsl:call-template name="iso690.primary"/>
<!-- Title and Type of medium of host document -->
<xsl:call-template name="iso690.title"/>
<!-- Subordinate responsibility of host document [EL] -->
<xsl:if test="./bibliomisc[@role='medium']">
<xsl:call-template name="iso690.secondary"/>
</xsl:if>
<!-- Edition -->
<xsl:call-template name="iso690.edition">
<xsl:with-param name="after" select="./volumenum"/>
</xsl:call-template>
<!-- Numeration of the part [nonEL]-->
<xsl:if test="not(./bibliomisc[@role='medium'])">
<xsl:call-template name="iso690.partnr"/>
<!-- Subordinate responsibility [nonEL] -->
<xsl:call-template name="iso690.secondary"/>
</xsl:if>
<!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
<xsl:call-template name="iso690.pub"/>
<!-- Location within host -->
<xsl:call-template name="iso690.part.location"/>
<xsl:if test="./bibliomisc[@role='medium']">
<!-- Numeration within host document [EL] -->
<!-- Notes [EL] -->
<xsl:call-template name="iso690.notice"/>
<!-- Avaibility and access [EL] -->
<xsl:call-template name="iso690.access"/>
<!-- Standard number [EL] -->
<xsl:call-template name="iso690.isbn"/>
</xsl:if>
</xsl:template>
 
<!-- CONTRIBUTIONS TO MONOGRAPHS -->
<xsl:template name="iso690.paper.mon">
<!-- Contribution -->
<xsl:apply-templates mode="iso690.paper.part" select="./biblioset[@relation='part']"/>
<!-- In -->
<xsl:text>In </xsl:text>
<!-- Host -->
<xsl:apply-templates mode="iso690.paper.book" select="./biblioset[@relation='book']"/>
</xsl:template>
 
<xsl:template match="biblioset" mode="iso690.paper.part">
<!-- Contribution -->
<!-- Primary responsibility -->
<xsl:call-template name="iso690.primary"/>
<!-- Title -->
<xsl:call-template name="iso690.title">
<xsl:with-param name="italic" select="0"/>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="biblioset" mode="iso690.paper.book">
<!-- Host -->
<!-- Primary responsibility -->
<xsl:call-template name="iso690.primary"/>
<!-- Title and Type of medium -->
<xsl:call-template name="iso690.title"/>
<!-- Subordinate responsibility [EL] -->
<xsl:if test="./bibliomisc[@role='medium']">
<xsl:call-template name="iso690.secondary"/>
</xsl:if>
<!-- Edition -->
<xsl:call-template name="iso690.edition"/>
<!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
<xsl:call-template name="iso690.paper.pub"/>
<!-- Numeration within host document [EL] -->
<!-- Location within host -->
<xsl:call-template name="iso690.location"/>
<xsl:if test="./bibliomisc[@role='medium']">
<!-- Notes [EL] -->
<xsl:call-template name="iso690.notice"/>
<!-- Avaibility and access [EL] -->
<xsl:call-template name="iso690.access"/>
<!-- Standard number [EL] -->
<xsl:call-template name="iso690.isbn"/>
</xsl:if>
</xsl:template>
 
<!-- ARTICLES, ETC., IN SERIALS -->
<xsl:template name="iso690.article">
<!-- Article -->
<xsl:apply-templates mode="iso690.article.art" select="./biblioset[@relation='article']"/>
<!-- Serial -->
<xsl:apply-templates mode="iso690.article.jour" select="./biblioset[@relation='journal']"/>
</xsl:template>
 
<xsl:template match="biblioset" mode="iso690.article.art">
<!-- Article -->
<!-- Primary responsibility -->
<xsl:call-template name="iso690.primary"/>
<!-- Title -->
<xsl:call-template name="iso690.title">
<xsl:with-param name="italic" select="0"/>
</xsl:call-template>
<!-- Subordinate responsibility [nonEL] -->
<xsl:if test="not(../*/bibliomisc[@role='medium'])">
<xsl:call-template name="iso690.secondary"/>
</xsl:if>
</xsl:template>
 
<xsl:template match="biblioset" mode="iso690.article.jour">
<!-- Serial -->
<!-- Title and Type of medium -->
<xsl:call-template name="iso690.title"/>
<!-- Edition -->
<xsl:call-template name="iso690.edition">
<xsl:with-param name="after" select="./pubdate[not(@role='issuing')]|./volumenum|./issuenum|./pagenums"/>
</xsl:call-template>
<!-- Number designation [EL] -->
<!-- Location within host -->
<xsl:call-template name="iso690.article.location"/>
<xsl:if test="./bibliomisc[@role='medium']">
<!-- Notes [EL] -->
<xsl:call-template name="iso690.notice"/>
<!-- Avaibility and access [EL] -->
<xsl:call-template name="iso690.access"/>
<!-- Standard number [EL] -->
<xsl:call-template name="iso690.issn"/>
</xsl:if>
</xsl:template>
 
<!-- PATENT DOCUMENTS -->
<xsl:template name="iso690.patent">
<!-- Primary responsibility (applicant) -->
<xsl:call-template name="iso690.primary"/>
<!-- Title of the invention -->
<xsl:call-template name="iso690.title"/>
<!-- Subordinate responsibility -->
<xsl:call-template name="iso690.secondary"/>
<!-- Notes -->
<xsl:call-template name="iso690.notice"/>
<!-- Identification -->
<xsl:call-template name="iso690.pat.ident"/>
</xsl:template>
 
<!-- ==================================================================== -->
<!-- Elements -->
 
<!-- Primary responsibility -->
<xsl:template name="iso690.primary">
<xsl:param name="primary.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="./authorgroup/author|./author">
<xsl:call-template name="iso690.author.list">
<xsl:with-param name="person.list" select=".//authorgroup/author|.//author"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./authorgroup/editor|./editor">
<xsl:call-template name="iso690.author.list">
<xsl:with-param name="person.list" select=".//authorgroup/editor|.//editor"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./authorgroup/corpauthor|./corpauthor">
<xsl:call-template name="iso690.author.list">
<xsl:with-param name="person.list" select=".//authorgroup/corpauthor|.//corpauthor"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:if test="(./firstname)and(./surname)">
<xsl:call-template name="iso690.author"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(./firstname[1])"/>
<xsl:with-param name="sep" select="$primary.sep"/>
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="iso690.author.list">
<xsl:param name="person.list" select="author|corpauthor|editor"/>
<xsl:param name="person.count" select="count($person.list)"/>
<xsl:param name="count" select="1"/>
<xsl:param name="group" select="./authorgroup[@role='many']"/>
<xsl:param name="many" select="0"/>
 
<xsl:param name="primary.many">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.many'"/></xsl:call-template>
</xsl:param>
<xsl:param name="primary.editor">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.editor'"/></xsl:call-template>
</xsl:param>
<xsl:param name="primary.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.sep'"/></xsl:call-template>
</xsl:param>
 
<xsl:choose>
<xsl:when test="$count &gt; $person.count"/>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$person.count &lt; 4 and not($group)">
<xsl:call-template name="iso690.author">
<xsl:with-param name="node" select="$person.list[position()=$count]"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$person.count = 2 and $count = 1 and $biblioentry.alt.primary.seps != 0">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.two.sep'"/></xsl:call-template>
</xsl:when>
<xsl:when test="$person.count = 2 and $count = 1">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'authorgroup'"/>
<xsl:with-param name="name" select="'sep2'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$person.count &gt; 2 and $count+1 = $person.count and $biblioentry.alt.primary.seps != 0">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.last.sep'"/></xsl:call-template>
</xsl:when>
<xsl:when test="$person.count &gt; 2 and $count+1 = $person.count">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'authorgroup'"/>
<xsl:with-param name="name" select="'seplast'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$count &lt; $person.count and $biblioentry.alt.primary.seps != 0">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.more.sep'"/></xsl:call-template>
</xsl:when>
<xsl:when test="$count &lt; $person.count">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'authorgroup'"/>
<xsl:with-param name="name" select="'sep'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="($count = $person.count)">
<xsl:choose>
<xsl:when test="$many!=0">
<xsl:if test="name($person.list[position()=$count])='editor'">
<xsl:value-of select="$primary.editor"/>
</xsl:if>
<xsl:value-of select="$primary.many"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="$primary.many"/>
<xsl:with-param name="sep" select="$primary.sep"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="name($person.list[position()=$count])='editor'">
<xsl:value-of select="$primary.editor"/>
<xsl:value-of select="$primary.sep"/>
</xsl:when>
<xsl:when test="name($person.list[position()=$count])='corpauthor'">
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string($person.list[position()=$count])"/>
<xsl:with-param name="sep" select="$primary.sep"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string($person.list[position()=$count]//firstname[1])"/>
<xsl:with-param name="sep" select="$primary.sep"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
 
<xsl:call-template name="iso690.author.list">
<xsl:with-param name="person.list" select="$person.list"/>
<xsl:with-param name="person.count" select="$person.count"/>
<xsl:with-param name="count" select="$count+1"/>
<xsl:with-param name="many" select="$many"/>
<xsl:with-param name="group"/>
</xsl:call-template>
</xsl:when>
 
<xsl:otherwise>
<xsl:choose>
<xsl:when test="($biblioentry.primary.count&gt;=3) and ($person.count&gt;=3)">
<xsl:call-template name="iso690.author.list">
<xsl:with-param name="person.list" select="$person.list[1]|$person.list[2]|$person.list[3]"/>
<xsl:with-param name="person.count" select="3"/>
<xsl:with-param name="count" select="1"/>
<xsl:with-param name="many" select="1"/>
<xsl:with-param name="group"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="($biblioentry.primary.count&gt;1) and ($person.count&gt;1)">
<xsl:call-template name="iso690.author.list">
<xsl:with-param name="person.list" select="$person.list[1]|$person.list[2]"/>
<xsl:with-param name="person.count" select="2"/>
<xsl:with-param name="count" select="1"/>
<xsl:with-param name="many" select="1"/>
<xsl:with-param name="group"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="iso690.author.list">
<xsl:with-param name="person.list" select="$person.list[1]"/>
<xsl:with-param name="person.count" select="1"/>
<xsl:with-param name="count" select="1"/>
<xsl:with-param name="many" select="1"/>
<xsl:with-param name="group"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="iso690.author">
<xsl:param name="node" select="."/>
<xsl:param name="lastfirst.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'lastfirst.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="name($node)!='corpauthor'">
<span style="text-transform:uppercase">
<xsl:apply-templates mode="iso690.mode" select="$node//surname[1]"/>
</span>
<xsl:if test="$node//surname and $node//firstname">
<xsl:value-of select="$lastfirst.sep"/>
</xsl:if>
<xsl:apply-templates mode="iso690.mode" select="$node//firstname[1]"/>
</xsl:when>
<xsl:otherwise>
<span style="text-transform:uppercase">
<xsl:apply-templates mode="iso690.mode" select="$node"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="corpauthor|firstname|surname" mode="iso690.mode">
<xsl:apply-templates mode="iso690.mode"/>
</xsl:template>
 
<!-- Title and Type of medium -->
<xsl:template name="iso690.title">
<xsl:param name="medium" select="./bibliomisc[@role='medium']"/>
<xsl:param name="italic" select="1"/>
<xsl:param name="sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'title.sep'"/></xsl:call-template>
</xsl:param>
 
<xsl:apply-templates mode="iso690.mode" select="./title">
<xsl:with-param name="medium" select="$medium"/>
<xsl:with-param name="italic" select="$italic"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:apply-templates>
</xsl:template>
 
<xsl:template match="title" mode="iso690.mode">
<xsl:param name="medium"/>
<xsl:param name="italic" select="1"/>
<xsl:param name="sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'title.sep'"/></xsl:call-template>
</xsl:param>
<xsl:param name="medium1">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'medium1'"/></xsl:call-template>
</xsl:param>
<xsl:param name="medium2">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'medium2'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="$italic=1">
<xsl:call-template name="iso690.italic.title"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="iso690.make.title"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$medium">
<xsl:value-of select="$medium1"/>
<xsl:apply-templates mode="iso690.mode" select="$medium"/>
<xsl:value-of select="$medium2"/>
</xsl:if>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="concat(string(.),string(../subtitle))"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:template>
 
<xsl:template name="iso690.italic.title">
<i>
<xsl:call-template name="iso690.make.title"/>
</i>
</xsl:template>
 
<xsl:template name="iso690.make.title">
<xsl:param name="submaintitle.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'submaintitle.sep'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:if test="../subtitle">
<xsl:value-of select="$submaintitle.sep"/>
<xsl:apply-templates mode="iso690.mode" select="../subtitle"/>
</xsl:if>
</xsl:template>
 
<xsl:template match="subtitle" mode="iso690.mode">
<xsl:apply-templates mode="iso690.mode"/>
</xsl:template>
 
<xsl:template match="bibliomisc[@role='medium']" mode="iso690.mode">
<xsl:apply-templates mode="iso690.mode"/>
</xsl:template>
 
<!-- Subordinate responsibility -->
<xsl:template name="iso690.secondary">
<xsl:param name="secondary.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'secondary.sep'"/></xsl:call-template>
</xsl:param>
<xsl:param name="secondary.person.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'secondary.person.sep'"/></xsl:call-template>
</xsl:param>
<xsl:for-each select="./bibliomisc[@role='secondary']">
<xsl:apply-templates mode="iso690.mode" select="."/>
<xsl:choose>
<xsl:when test="position()=count(../bibliomisc[@role='secondary'])">
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$secondary.sep"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$secondary.person.sep"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
 
<xsl:template match="bibliomisc[@role='secondary']" mode="iso690.mode">
<xsl:apply-templates mode="iso690.mode"/>
</xsl:template>
 
<!-- Edition -->
<xsl:template name="iso690.edition">
<xsl:param name="after"/>
<xsl:param name="edition.serial.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'edition.serial.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="string($after)!=''">
<xsl:apply-templates mode="iso690.mode" select="./edition">
<xsl:with-param name="sep" select="$edition.serial.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode" select="./edition"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="edition" mode="iso690.mode">
<xsl:param name="sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'edition.sep'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:template>
 
<!-- Issue designation (date and/or num) -->
<xsl:template name="iso690.issuing">
<xsl:param name="issuing.div">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
</xsl:param>
<xsl:param name="issuing.range">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
</xsl:param>
<xsl:param name="issuing.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2] and ./issuenum[2]">
<xsl:call-template name="iso690.issuedate"/>
<xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
<xsl:with-param name="sep" select="$issuing.div"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./issuenum[1]">
<xsl:with-param name="sep" select="$issuing.range"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
<xsl:with-param name="sep" select="$issuing.div"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./issuenum[2]">
<xsl:with-param name="sep" select="$issuing.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2]">
<xsl:call-template name="iso690.issuedate"/>
<xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
<xsl:with-param name="sep" select="$issuing.range"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
<xsl:with-param name="sep" select="$issuing.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="./pubdate[@role='issuing'] and ./volumenum and ./issuenum">
<xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
<xsl:with-param name="sep" select="$issuing.div"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./volumenum">
<xsl:with-param name="sep" select="$issuing.div"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./issuenum">
<xsl:with-param name="sep" select="$issuing.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="./pubdate[@role='issuing']">
<xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
<xsl:with-param name="sep" select="$issuing.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="./volumenum">
<xsl:apply-templates mode="iso690.mode" select="./volumenum">
<xsl:with-param name="sep" select="$issuing.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="./issuenum">
<xsl:apply-templates mode="iso690.mode" select="./issuenum">
<xsl:with-param name="sep" select="$issuing.sep"/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</xsl:template>
 
<xsl:template name="iso690.issuedate">
<xsl:param name="issuing.div">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
</xsl:param>
<xsl:param name="issuing.range">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
</xsl:param>
<xsl:param name="issuing.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="./pubdate[@role='issuing'][2]">
<xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][1]">
<xsl:with-param name="sep" select="$issuing.range"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][2]">
<xsl:with-param name="sep" select="$issuing.div"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
<xsl:with-param name="sep" select="$issuing.div"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="pubdate[@role='issuing']" mode="iso690.mode">
<xsl:param name="sep"/>
<xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:call-template name="iso690.space">
<xsl:with-param name="text" select="$substr"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$substr='-'">
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="' '"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<!-- Numeration of the part -->
<xsl:template name="iso690.partnr">
<xsl:param name="partnr.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'partnr.sep'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode" select="./volumenum">
<xsl:with-param name="sep" select="$partnr.sep"/>
</xsl:apply-templates>
</xsl:template>
 
<!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
<xsl:template name="iso690.pub">
<xsl:param name="onlydate" select="0"/>
<xsl:param name="placesep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'placepubl.sep'"/></xsl:call-template>
</xsl:param>
<xsl:param name="pubsep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'publyear.sep'"/></xsl:call-template>
</xsl:param>
<xsl:param name="endsep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pubinfo.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="(./publisher/publishername|./publishername|./publisher/address/city)and($onlydate=0)and(./pubdate[not(@role='issuing')]|./copyright/year|./date[@role='upd']|./date[@role='upd'])">
<xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
<xsl:with-param name="sep" select="$placesep"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
<xsl:with-param name="sep" select="$pubsep"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
<xsl:with-param name="sep" select="$endsep"/>
</xsl:apply-templates>
<xsl:if test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
<xsl:call-template name="iso690.data">
<xsl:with-param name="sep" select="$endsep"/>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="(./publisher/publishername|./publishername)and(./publisher/address/city)and($onlydate=0)">
<xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
<xsl:with-param name="sep" select="$placesep"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
<xsl:with-param name="sep" select="$endsep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="($onlydate=1)or(./pubdate[not(@role='issuing')]|./copyright/year)">
<xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
<xsl:with-param name="sep" select="$endsep"/>
</xsl:apply-templates>
<xsl:if test="$onlydate=1">
<xsl:call-template name="iso690.location">
<xsl:with-param name="onlypages" select="1"/>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:when test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
<xsl:call-template name="iso690.data">
<xsl:with-param name="sep" select="$endsep"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
 
<xsl:template name="iso690.paper.pub">
<xsl:param name="spec.pubinfo.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'spec.pubinfo.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="./volumnum|./issuenum|./pagenums">
<xsl:call-template name="iso690.pub">
<xsl:with-param name="endsep" select="$spec.pubinfo.sep"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="iso690.pub"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="iso690.data">
<xsl:param name="sep"/>
<xsl:param name="datecit2">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode" select="./date[@role='upd']">
<xsl:with-param name="sep"/>
</xsl:apply-templates>
<xsl:apply-templates mode="iso690.mode" select="./date[@role='cit']"/>
<xsl:choose>
<xsl:when test="./date[@role='cit']">
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="$datecit2"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./date[@role='upd']">
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(./date[@role='upd'])"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
 
<xsl:template match="publisher/address/city|publishername" mode="iso690.mode">
<xsl:param name="sep"/>
<xsl:param name="upd" select="0"/>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="pubdate|copyright/year" mode="iso690.mode">
<xsl:param name="sep"/>
<xsl:param name="upd" select="1"/>
<xsl:param name="datecit2">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
</xsl:param>
<xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
<xsl:if test="name(.)!='pubdate'">
<xsl:value-of select="'&#169;'"/><!-- copyright -->
</xsl:if>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:call-template name="iso690.space">
<xsl:with-param name="text" select="$substr"/>
</xsl:call-template>
<xsl:if test="$upd!=0">
<xsl:choose>
<xsl:when test="name(.)='pubdate'">
<xsl:apply-templates mode="iso690.mode" select="../date[@role='upd']"/>
<xsl:apply-templates mode="iso690.mode" select="../date[@role='cit']"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode" select="../../date[@role='upd']"/>
<xsl:apply-templates mode="iso690.mode" select="../../date[@role='cit']"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:choose>
<xsl:when test="../date[@role='cit']|../../date[@role='cit'] and $upd!=0">
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="$datecit2"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="../date[@role='upd']|../../date[@role='upd'] and $upd!=0">
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(../date[@role='upd'])"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$substr='-'">
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="' '"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="iso690.space">
<xsl:param name="text" select="substring(string(.),string-length(string(.)))"/>
<xsl:if test="$text='-'">
<xsl:value-of select="' '"/>
</xsl:if>
</xsl:template>
 
<!-- Date of update/revision -->
<xsl:template match="date[@role='upd']" mode="iso690.mode">
<xsl:param name="sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'upd.sep'"/></xsl:call-template>
</xsl:param>
<xsl:value-of select="$sep"/>
<xsl:apply-templates mode="iso690.mode"/>
</xsl:template>
 
<!-- Date of citation -->
<xsl:template match="date[@role='cit']" mode="iso690.mode">
<xsl:param name="datecit1">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit1'"/></xsl:call-template>
</xsl:param>
<xsl:param name="datecit2">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
</xsl:param>
<xsl:value-of select="$datecit1"/>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:value-of select="$datecit2"/>
</xsl:template>
 
<!-- Extent -->
<xsl:template name="iso690.extent">
<xsl:param name="extent.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'extent.sep'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode" select="./pagenums">
<xsl:with-param name="sep" select="$extent.sep"/>
</xsl:apply-templates>
</xsl:template>
 
<!-- Location within host -->
<xsl:template name="iso690.part.location">
<xsl:param name="location.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="./pagenums">
<xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
<xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']"/>
<xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
</xsl:when>
<xsl:when test="./bibliomisc[@role='sectitle']">
<xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
<xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']">
<xsl:with-param name="sep" select="$location.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']">
<xsl:with-param name="sep" select="$location.sep"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="iso690.article.location">
<xsl:param name="location.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
</xsl:param>
<xsl:param name="locs.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="not(./date[@role='upd']|./date[@role='cit'])">
<xsl:choose>
<xsl:when test="./volumenum|./issuenum|./pagenums">
<xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
<xsl:with-param name="upd" select="0"/>
<xsl:with-param name="sep" select="$locs.sep"/>
</xsl:apply-templates>
<xsl:call-template name="iso690.location"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
<xsl:with-param name="sep" select="$location.sep"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="./volumenum|./issuenum|./pagenums">
<xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
<xsl:with-param name="upd" select="0"/>
<xsl:with-param name="sep" select="$locs.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
<xsl:with-param name="upd" select="0"/>
<xsl:with-param name="sep" select="$location.sep"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="./issuenum">
<xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
<xsl:apply-templates mode="iso690.mode" select="./issuenum">
<xsl:with-param name="sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode" select="./volumenum">
<xsl:with-param name="sep"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="./pagenums">
<xsl:call-template name="iso690.data">
<xsl:with-param name="sep" select="$locs.sep"/>
</xsl:call-template>
<xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="iso690.data">
<xsl:with-param name="sep" select="$location.sep"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="iso690.location">
<xsl:param name="location.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="./volumenum and not(./issuenum) and not(./pagenums)">
<xsl:apply-templates mode="iso690.mode" select="./volumenum">
<xsl:with-param name="sep" select="$location.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="./issuenum and not(./pagenums)">
<xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
<xsl:apply-templates mode="iso690.mode" select="./issuenum">
<xsl:with-param name="sep" select="$location.sep"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="./pagenums">
<xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
<xsl:apply-templates mode="iso690.mode" select="./issuenum"/>
<xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
</xsl:when>
</xsl:choose>
</xsl:template>
 
<xsl:template match="bibliomisc[@role='secnum']|bibliomisc[@role='sectitle']" mode="iso690.mode">
<xsl:param name="sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="volumenum|issuenum" mode="iso690.mode">
<xsl:param name="sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="pagenums" mode="iso690.mode">
<xsl:param name="sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$sep"/>
</xsl:call-template>
</xsl:template>
 
<!-- Series -->
<xsl:template name="iso690.serie">
<xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[@role='serie']"/>
</xsl:template>
 
<!-- Notes -->
<xsl:template name="iso690.notice">
<xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[not(@role)]"/>
</xsl:template>
 
<xsl:template match="bibliomisc[not(@role)]|bibliomisc[@role='serie']" mode="iso690.mode">
<xsl:param name="notice.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'notice.sep'"/></xsl:call-template>
</xsl:param>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="string(.)"/>
<xsl:with-param name="sep" select="$notice.sep"/>
</xsl:call-template>
</xsl:template>
 
<!-- Avaibility and access -->
<xsl:template name="iso690.access">
<xsl:for-each select="./biblioid[@class='uri']|./bibliomisc[@role='access']">
<xsl:choose>
<xsl:when test="position()=1">
<xsl:apply-templates mode="iso690.mode" select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode" select=".">
<xsl:with-param name="firstacc" select="0"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
 
<xsl:template match="biblioid[@class='uri']/ulink|bibliomisc[@role='access']/ulink" mode="iso690.mode">
<xsl:param name="link1">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link1'"/></xsl:call-template>
</xsl:param>
<xsl:param name="link2">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link2'"/></xsl:call-template>
</xsl:param>
<xsl:value-of select="$link1"/>
<xsl:call-template name="ulink"/>
<xsl:value-of select="$link2"/>
</xsl:template>
 
<xsl:template match="biblioid[@class='uri']|bibliomisc[@role='access']" mode="iso690.mode">
<xsl:param name="firstacc" select="1"/>
<xsl:param name="access">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access'"/></xsl:call-template>
</xsl:param>
<xsl:param name="acctoo">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'acctoo'"/></xsl:call-template>
</xsl:param>
<xsl:param name="onwww">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'onwww'"/></xsl:call-template>
</xsl:param>
<xsl:param name="oninet">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'oninet'"/></xsl:call-template>
</xsl:param>
<xsl:param name="access.end">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.end'"/></xsl:call-template>
</xsl:param>
<xsl:param name="access.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.sep'"/></xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="$firstacc=1">
<xsl:value-of select="$access"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$acctoo"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="(./ulink)and(string(./ulink)=string(.))">
<xsl:choose>
<xsl:when test="(starts-with(./ulink/@url,'http://')or(starts-with(./ulink/@url,'https://')))">
<xsl:value-of select="$onwww"/>
<xsl:value-of select="$access.end"/>
<xsl:apply-templates mode="iso690.mode" select="./ulink"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$oninet"/>
<xsl:value-of select="$access.end"/>
<xsl:apply-templates mode="iso690.mode" select="./ulink"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="(./ulink)and(string(./ulink)!=string(.))">
<xsl:value-of select="text()[1]"/>
<xsl:call-template name="iso690.endsep">
<xsl:with-param name="text" select="text()[1]"/>
<xsl:with-param name="sep" select="$access.end"/>
</xsl:call-template>
<xsl:apply-templates mode="iso690.mode" select="./ulink"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="iso690.mode"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$access.sep"/>
</xsl:template>
 
<!-- Standard number - ISBN -->
<xsl:template name="iso690.isbn">
<xsl:choose>
<xsl:when test="./biblioid/@class='isbn'">
<xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='isbn']"/>
</xsl:when>
<xsl:when test="./isbn">
<xsl:apply-templates mode="iso690.mode" select="./isbn"/>
</xsl:when>
</xsl:choose>
</xsl:template>
 
<xsl:template match="isbn|biblioid[@class='isbn']" mode="iso690.mode">
<xsl:param name="isbn">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'isbn'"/></xsl:call-template>
</xsl:param>
<xsl:param name="stdnum.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
</xsl:param>
<xsl:value-of select="$isbn"/>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:value-of select="$stdnum.sep"/>
</xsl:template>
 
<!-- Standard number - ISSN -->
<xsl:template name="iso690.issn">
<xsl:choose>
<xsl:when test="./biblioid/@class='issn'">
<xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='issn']"/>
</xsl:when>
<xsl:when test="./issn">
<xsl:apply-templates mode="iso690.mode" select="./issn"/>
</xsl:when>
</xsl:choose>
</xsl:template>
 
<xsl:template match="issn|biblioid[@class='issn']" mode="iso690.mode">
<xsl:param name="issn">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issn'"/></xsl:call-template>
</xsl:param>
<xsl:param name="stdnum.sep">
<xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
</xsl:param>
<xsl:value-of select="$issn"/>
<xsl:apply-templates mode="iso690.mode"/>
<xsl:value-of select="$stdnum.sep"/>
</xsl:template>
 
<!-- Identification of patent document -->
<xsl:template name="is