Subversion Repositories svn LFS-FR

Compare Revisions

Ignore whitespace Rev 598 → Rev 599

/trunk/lfs/stylesheets/lfs-nochunks.xsl
1,335 → 1,18
<?xml version='1.0' encoding='ISO-8859-1'?>
 
<!--
$LastChangedBy: manuel $
$Date: 2008-06-26 19:05:44 $
-->
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
version="1.0">
 
<!-- We use XHTML -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/profile-docbook.xsl"/>
<!-- LFS top-level no-chunk templates. -->
<xsl:import href="lfs-xsl/nochunks.xsl"/>
 
<!-- Fix encoding issues with default UTF-8 output of the xhtml stylesheet -->
<xsl:output method="html" encoding="ISO-8859-1" indent="no" />
<!-- The LFS book type to be processed (lfs, blfs, clfs, or hlfs) -->
<xsl:param name="book-type">lfs</xsl:param>
 
<!-- Including our others customized templates -->
<xsl:include href="xhtml/lfs-index.xsl"/>
<xsl:include href="xhtml/lfs-mixed.xsl"/>
<xsl:include href="xhtml/lfs-sections.xsl"/>
<xsl:include href="xhtml/lfs-toc.xsl"/>
<xsl:include href="xhtml/lfs-xref.xsl"/>
 
<!-- This file contains our localization strings (for internationalization) -->
<xsl:param name="local.l10n.xml" select="document('lfs-l10n.xml')"/>
 
<!-- Dropping some unwanted style attributes -->
<xsl:param name="ulink.target" select="''"></xsl:param>
<xsl:param name="css.decoration" select="0"></xsl:param>
 
<!-- Don't use graphics in admonitions -->
<xsl:param name="admon.graphics" select="0"/>
 
<!-- Changing the admonitions output tagging -->
<xsl:template name="nongraphical.admonition">
<div class="{name(.)}">
<div class ="admonhead">
<h3 class="admontitle">
<xsl:apply-templates select="." mode="object.title.markup"/>
</h3>
</div>
<div class="admonbody">
<xsl:apply-templates/>
</div>
</div>
</xsl:template>
 
<!-- To drop the remainig dot when title is empty (from lfs-titles.xsl)-->
<xsl:template name="sect2.titlepage">
<xsl:choose>
<xsl:when test="string-length(title) = 0"/>
<xsl:otherwise>
<div class="titlepage">
<xsl:if test="@id">
<a id="{@id}" name="{@id}"/>
</xsl:if>
<h3 class="{name(.)}">
<xsl:apply-templates select="." mode="label.markup"/>
<xsl:text>. </xsl:text>
<xsl:value-of select="title"/>
</h3>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<!-- Added the role param for proper punctuation in xref calls
(from lfs-titles.xsl). -->
<xsl:template match="*" mode="insert.title.markup">
<xsl:param name="purpose"/>
<xsl:param name="xrefstyle"/>
<xsl:param name="title"/>
<xsl:param name="role"/>
<xsl:choose>
<xsl:when test="$purpose = 'xref' and titleabbrev">
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$title"/>
<xsl:value-of select="$role"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<!-- The CSS Stylesheet -->
<xsl:template name='user.head.content'>
<style type="text/css">
<xsl:text>
/* Global settings */
body {
font-family: sans-serif;
text-align: left;
background: #fff;
color: #333;
margin: 1em;
padding: 0;
font-size: 1em;
line-height: 1.2em
}
 
a:link { color: #22b; }
a:visited { color: #7e4988; }
a:hover, a:focus { color: #d30e08; }
a:active { color: #6b77b1;}
 
/* Headers */
h1, h2, b, strong {
color: #000;
font-weight: bold;
}
 
h3, h4, h5, h6 {
color: #222;
}
 
h1 { font-size: 173%; text-align: center; }
h2 { font-size: 144%; }
h2.subtitle { text-align: center; }
h3 { font-size: 120%; padding-top: 0.2em; margin-top: 0.3em; }
h4 { font-size: 110%;}
h5, h6 { font-size: 110%; font-style: italic; }
 
/* TOC and Index*/
 
div.toc ul, div.index ul, div.navheader ul, div.navfooter ul {
list-style: none;
}
 
div.toc, div.dedication {
padding-left: 1em;
}
 
li.preface {
margin-left: 1em;
}
 
div.toc ul li h3, div.toc ul li h4 {
margin: .4em;
}
 
.item {
width: 15em;
float: left;
}
 
.secitem {
font-weight: normal;
width: 14em;
float: left;
}
 
/* Admonitions */
div.note, div.tip {
background-color: #fffff6;
border: 2px solid #dbddec;
width: 90%;
margin: .5em auto;
}
 
div.important, div.warning, div.caution {
background-color: #fffff6;
border: medium solid #400;
width: 90%;
margin: 1.5em auto;
color: #600;
font-size: larger;
}
 
div.important h3, div.warning h3, div.caution h3 {
color: #900;
}
 
h3.admontitle {
padding-left: 2.5em;
padding-top: 1em;
}
 
div.admonbody {
margin: .5em;
}
 
div.important em, div.warning em, div.caution em {
color: #000;
font-weight: bold;
}
 
div.important tt, div.warning tt, div.caution tt {
font-weight: bold;
}
 
/* variablelist and segmentedlist */
dl {
margin: 0;
padding: 0;
}
 
dt {
display: list-item;
font-weight: bold;
margin: .33em 0 0 1em;
padding: 0;
}
 
div.content dt {
list-style: none;
}
 
dd {
margin: 0 0 1em 3em;
padding: 0;
}
 
div.variablelist dd {
margin-bottom: 1em;
}
 
div.variablelist dd p {
margin-top: 0px;
}
 
dl.materials dd {
margin-left: 0px;
}
 
div.segmentedlist {
margin-top: 1em;
}
 
div.segmentedlist p {
margin: 0px auto;
}
 
/* itemizedlist */
 
div.itemizedlist {
margin-left: 1em;
}
 
/* Indented blocks */
p, ul, dl, code, blockquote {
padding-left: 1em;
}
 
/* Monospaced elements */
tt, code, kbd, pre, .command {
font-family: monospace;
}
 
pre.userinput {
color: #101310;
background-color: #e5e5e5;
border: 1px solid #050505;
padding: .5em 1em;
margin: 0 2em;
font-weight: bold;
}
 
pre.screen {
background-color: #e9e9e9;
border: 1px solid #050505;
padding: .5em 1em;
margin: 0 2em;
}
 
/* Sections */
div.package {
background: #f5f6f7;
border-bottom: 0.2em solid #dbddec;
padding: 0.5em 0.5em 0.3em 0.5em;
margin: 0px auto;
}
 
div.installation {
padding: 0 0.5em 0.3em 0.5em;
margin: 0.5em 0 0.5em 0;
}
 
div.configuration {
background: #fefefe;
border-top: 0.2em solid #dbddec;
padding: 0.5em;
margin: 0.5em 0 .5em 0;
}
 
div.content {
background: #f5f6f7;
border-top: 0.2em solid #dbddec;
border-bottom: 0.2em solid #dbddec;
padding: 0.5em 0.5em 1em 0.5em;
margin: 0.5em 0 .5em 0;
}
 
div.installation h3.title, div.content h3.title {
padding-top: 0.3em;
margin: 0;
}
 
div.book, div.preface, div.part, div.chapter, div.sect1, div.index {
padding-bottom: 0.5em;
}
 
div.preface h2, div.part h1, div.chapter h2.title, div.sect1 h2.title, div.index h1 {
background: #f5f6f7;
border-bottom: .2em solid #dbddec;
border-top: .2em solid #dbddec;
margin-top 1em;
padding: .5em;
text-align: center;
}
 
div.book h1 {
background: #f5f6f7;
margin: 0px auto;
padding: 0.5em;
}
 
div.book h2.subtitle {
background: #dbddec;
margin: 0px auto;
padding: 0.2em;
}
div.authorgroup, div p.copyright, div.abstract {
background: #f5f6f7;
margin: 0px auto;
padding: 1em 0.5em;
}
 
hr {
background: #dbddec;
height: .3em;
border: 0px;
margin: 0px auto;
padding: 0;
}
</xsl:text>
</style>
</xsl:template>
 
</xsl:stylesheet>
/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/fo/titlepage.templates.xsl
0,0 → 1,5094
<?xml version="1.0"?>
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" 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">
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="{$title.fontset}">
<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)">
<fo:block start-indent="0pt" text-align="center"><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="article.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" keep-with-next.within-column="always" font-size="24.8832pt" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::article[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" text-align="start" margin-left="0.5in" margin-right="0.5in" font-family="{$body.fontset}">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="article.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="article.titlepage.recto.style" space-before="0.5em" text-align="start" margin-left="0.5in" margin-right="0.5in" font-family="{$body.fontset}">
<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
</fo:block>
</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">
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="set.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style" text-align="center" font-size="24.8832pt" space-before="18.6624pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="division.title">
<xsl:with-param name="node" select="ancestor-or-self::set[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style" font-family="{$title.fontset}" text-align="center">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="set.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="set.titlepage.recto.style">
<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
</fo:block>
</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:template>
 
<xsl:template name="book.titlepage.verso">
<xsl:choose>
<xsl:when test="bookinfo/title">
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/corpauthor"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/authorgroup"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/author"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/author"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/othercredit"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/releaseinfo"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/pubdate"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/copyright"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/abstract"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/abstract"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="bookinfo/legalnotice"/>
<xsl:apply-templates mode="book.titlepage.verso.auto.mode" select="info/legalnotice"/>
</xsl:template>
 
<xsl:template name="book.titlepage.separator"><fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" break-after="page"/>
</xsl:template>
 
<xsl:template name="book.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="book.titlepage.before.verso"><fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" break-after="page"/>
</xsl:template>
 
<xsl:template name="book.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="book.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.recto.style" text-align="center" font-size="24.8832pt" space-before="18.6624pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="division.title">
<xsl:with-param name="node" select="ancestor-or-self::book[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="book.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.recto.style" text-align="center" font-size="20.736pt" space-before="15.552pt" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="book.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.recto.style" font-size="17.28pt" keep-with-next.within-column="always" space-before="2in">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.recto.style" space-before="2in">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="book.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.recto.style" font-size="17.28pt" space-before="10.8pt" keep-with-next.within-column="always">
<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="title" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style" font-size="14.4pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="book.verso.title">
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style">
<xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style">
<xsl:call-template name="verso.authorgroup">
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style">
<xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style">
<xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style" space-before="0.5em">
<xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style" space-before="1em">
<xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style">
<xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style">
<xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="book.titlepage.verso.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="book.titlepage.verso.style" font-size="8pt">
<xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="part.titlepage.recto">
<xsl:choose>
<xsl:when test="partinfo/title">
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<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: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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="part.titlepage.separator"/>
</fo:block>
</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="title" mode="part.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="part.titlepage.recto.style" text-align="center" font-size="24.8832pt" space-before="18.6624pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="division.title">
<xsl:with-param name="node" select="ancestor-or-self::part[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="part.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="part.titlepage.recto.style" text-align="center" font-size="20.736pt" space-before="15.552pt" font-weight="bold" font-style="italic" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="partintro.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style" text-align="center" font-size="24.8832pt" font-weight="bold" space-before="1em" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style" text-align="center" font-size="14.4pt" font-weight="bold" font-style="italic" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="partintro.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="partintro.titlepage.recto.style">
<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
</fo:block>
</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">
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="reference.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style" text-align="center" font-size="24.8832pt" space-before="18.6624pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="division.title">
<xsl:with-param name="node" select="ancestor-or-self::reference[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style" font-family="{$title.fontset}" text-align="center">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="reference.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="reference.titlepage.recto.style">
<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="refsynopsisdiv.titlepage.recto">
<xsl:choose>
<xsl:when test="refsynopsisdivinfo/title">
<xsl:apply-templates mode="refsynopsisdiv.titlepage.recto.auto.mode" select="refsynopsisdivinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="refsynopsisdiv.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="refsynopsisdiv.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="refsynopsisdiv.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="refsynopsisdiv.titlepage.verso">
</xsl:template>
 
<xsl:template name="refsynopsisdiv.titlepage.separator">
</xsl:template>
 
<xsl:template name="refsynopsisdiv.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="refsynopsisdiv.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="refsynopsisdiv.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="refsynopsisdiv.titlepage.before.recto"/>
<xsl:call-template name="refsynopsisdiv.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="refsynopsisdiv.titlepage.before.verso"/>
<xsl:call-template name="refsynopsisdiv.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="refsynopsisdiv.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="refsynopsisdiv.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="refsynopsisdiv.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="refsynopsisdiv.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="refsynopsisdiv.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="refsynopsisdiv.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="refsection.titlepage.recto">
<xsl:choose>
<xsl:when test="refsectioninfo/title">
<xsl:apply-templates mode="refsection.titlepage.recto.auto.mode" select="refsectioninfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="refsection.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="refsection.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="refsection.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="refsection.titlepage.verso">
</xsl:template>
 
<xsl:template name="refsection.titlepage.separator">
</xsl:template>
 
<xsl:template name="refsection.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="refsection.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="refsection.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="refsection.titlepage.before.recto"/>
<xsl:call-template name="refsection.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="refsection.titlepage.before.verso"/>
<xsl:call-template name="refsection.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="refsection.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="refsection.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="refsection.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="refsection.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="refsection.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="refsection.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="refsect1.titlepage.recto">
<xsl:choose>
<xsl:when test="refsect1info/title">
<xsl:apply-templates mode="refsect1.titlepage.recto.auto.mode" select="refsect1info/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="refsect1.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="refsect1.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="refsect1.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="refsect1.titlepage.verso">
</xsl:template>
 
<xsl:template name="refsect1.titlepage.separator">
</xsl:template>
 
<xsl:template name="refsect1.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="refsect1.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="refsect1.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="refsect1.titlepage.before.recto"/>
<xsl:call-template name="refsect1.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="refsect1.titlepage.before.verso"/>
<xsl:call-template name="refsect1.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="refsect1.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="refsect1.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="refsect1.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="refsect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="refsect1.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="refsect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="refsect2.titlepage.recto">
<xsl:choose>
<xsl:when test="refsect2info/title">
<xsl:apply-templates mode="refsect2.titlepage.recto.auto.mode" select="refsect2info/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="refsect2.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="refsect2.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="refsect2.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="refsect2.titlepage.verso">
</xsl:template>
 
<xsl:template name="refsect2.titlepage.separator">
</xsl:template>
 
<xsl:template name="refsect2.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="refsect2.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="refsect2.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="refsect2.titlepage.before.recto"/>
<xsl:call-template name="refsect2.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="refsect2.titlepage.before.verso"/>
<xsl:call-template name="refsect2.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="refsect2.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="refsect2.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="refsect2.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="refsect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="refsect2.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="refsect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="refsect3.titlepage.recto">
<xsl:choose>
<xsl:when test="refsect3info/title">
<xsl:apply-templates mode="refsect3.titlepage.recto.auto.mode" select="refsect3info/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="refsect3.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="refsect3.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="refsect3.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="refsect3.titlepage.verso">
</xsl:template>
 
<xsl:template name="refsect3.titlepage.separator">
</xsl:template>
 
<xsl:template name="refsect3.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="refsect3.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="refsect3.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="refsect3.titlepage.before.recto"/>
<xsl:call-template name="refsect3.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="refsect3.titlepage.before.verso"/>
<xsl:call-template name="refsect3.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="refsect3.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="refsect3.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="refsect3.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="refsect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="refsect3.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="refsect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="dedication.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="dedication.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::dedication[1]"/>
</xsl:call-template></fo:block>
<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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="dedication.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="dedication.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="dedication.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="preface.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::preface[1]"/>
</xsl:call-template></fo:block>
<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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="preface.titlepage.separator"/>
</fo:block>
</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="subtitle" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="preface.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="preface.titlepage.recto.style">
<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="{$title.fontset}">
<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)">
<fo:block margin-left="{$title.margin.left}"><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="chapter.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style" font-size="24.8832pt" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style" space-before="0.5em" font-style="italic" font-size="14.4pt" font-weight="bold">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style" space-before="0.5em" space-after="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style" space-before="0.5em" space-after="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style" space-before="0.5em" space-after="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="appendix.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="24.8832pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::appendix[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="appendix.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="appendix.titlepage.recto.style">
<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
</fo:block>
</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:template>
 
<xsl:template name="section.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="section.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="section.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="section.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style" margin-left="{$title.margin.left}" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="section.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="section.titlepage.recto.style">
<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
</fo:block>
</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:template>
 
<xsl:template name="sect1.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect1.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect1.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="sect1.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style" margin-left="{$title.margin.left}" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="sect1.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect1.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
</fo:block>
</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:template>
 
<xsl:template name="sect2.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect2.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect2.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="sect2.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style" margin-left="{$title.margin.left}" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="sect2.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect2.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
</fo:block>
</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:template>
 
<xsl:template name="sect3.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect3.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect3.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="sect3.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style" margin-left="{$title.margin.left}" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="sect3.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect3.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
</fo:block>
</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:template>
 
<xsl:template name="sect4.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect4.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect4.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="sect4.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style" margin-left="{$title.margin.left}" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="sect4.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect4.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
</fo:block>
</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:template>
 
<xsl:template name="sect5.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sect5.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sect5.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="sect5.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style" margin-left="{$title.margin.left}" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="sect5.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sect5.titlepage.recto.style">
<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
</fo:block>
</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:template>
 
<xsl:template name="simplesect.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="simplesect.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="simplesect.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="simplesect.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style" margin-left="{$title.margin.left}" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="simplesect.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="simplesect.titlepage.recto.style">
<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="bibliography.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="bibliography.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::bibliography[1]"/>
</xsl:call-template></fo:block>
<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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="bibliography.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="bibliography.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="bibliography.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="bibliodiv.titlepage.recto">
<xsl:choose>
<xsl:when test="bibliodivinfo/title">
<xsl:apply-templates mode="bibliodiv.titlepage.recto.auto.mode" select="bibliodivinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="bibliodiv.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="bibliodiv.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="bibliodiv.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="bibliodivinfo/subtitle">
<xsl:apply-templates mode="bibliodiv.titlepage.recto.auto.mode" select="bibliodivinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="bibliodiv.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="bibliodiv.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="bibliodiv.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="bibliodiv.titlepage.verso">
</xsl:template>
 
<xsl:template name="bibliodiv.titlepage.separator">
</xsl:template>
 
<xsl:template name="bibliodiv.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="bibliodiv.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="bibliodiv.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="bibliodiv.titlepage.before.recto"/>
<xsl:call-template name="bibliodiv.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="bibliodiv.titlepage.before.verso"/>
<xsl:call-template name="bibliodiv.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="bibliodiv.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="bibliodiv.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="bibliodiv.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="bibliodiv.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="bibliodiv.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="20.736pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::bibliodiv[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="bibliodiv.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="bibliodiv.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="bibliodiv.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="glossary.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="glossary.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::glossary[1]"/>
</xsl:call-template></fo:block>
<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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="glossary.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="glossary.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="glossary.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="glossdiv.titlepage.recto">
<xsl:choose>
<xsl:when test="glossdivinfo/title">
<xsl:apply-templates mode="glossdiv.titlepage.recto.auto.mode" select="glossdivinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="glossdiv.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="glossdiv.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="glossdiv.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="glossdivinfo/subtitle">
<xsl:apply-templates mode="glossdiv.titlepage.recto.auto.mode" select="glossdivinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="glossdiv.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="glossdiv.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="glossdiv.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="glossdiv.titlepage.verso">
</xsl:template>
 
<xsl:template name="glossdiv.titlepage.separator">
</xsl:template>
 
<xsl:template name="glossdiv.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="glossdiv.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="glossdiv.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="glossdiv.titlepage.before.recto"/>
<xsl:call-template name="glossdiv.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="glossdiv.titlepage.before.verso"/>
<xsl:call-template name="glossdiv.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="glossdiv.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="glossdiv.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="glossdiv.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="glossdiv.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="glossdiv.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="20.736pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::glossdiv[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="glossdiv.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="glossdiv.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="glossdiv.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="index.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="index.titlepage.recto.style" margin-left="0pt" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::index[1]"/>
<xsl:with-param name="pagewide" select="1"/>
</xsl:call-template></fo:block>
<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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="index.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="index.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="index.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="indexdiv.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="indexdiv.titlepage.recto.style">
<xsl:call-template name="indexdiv.title">
<xsl:with-param name="title" select="title"/>
</xsl:call-template></fo:block>
<xsl:choose>
<xsl:when test="indexdivinfo/subtitle">
<xsl:apply-templates mode="indexdiv.titlepage.recto.auto.mode" select="indexdivinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="indexdiv.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="indexdiv.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="indexdiv.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="indexdiv.titlepage.verso">
</xsl:template>
 
<xsl:template name="indexdiv.titlepage.separator">
</xsl:template>
 
<xsl:template name="indexdiv.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="indexdiv.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="indexdiv.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="indexdiv.titlepage.before.recto"/>
<xsl:call-template name="indexdiv.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="indexdiv.titlepage.before.verso"/>
<xsl:call-template name="indexdiv.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="indexdiv.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="indexdiv.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="indexdiv.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="indexdiv.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="indexdiv.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="indexdiv.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="setindex.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="setindex.titlepage.recto.style" margin-left="0pt" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::setindex[1]"/>
<xsl:with-param name="pagewide" select="1"/>
</xsl:call-template></fo:block>
<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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="setindex.titlepage.separator"/>
</fo:block>
</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">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="setindex.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="setindex.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="colophon.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="colophon.titlepage.recto.style" margin-left="{$title.margin.left}" font-size="24.8832pt" font-family="{$title.fontset}" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::colophon[1]"/>
</xsl:call-template></fo:block>
<xsl:choose>
<xsl:when test="colophoninfo/subtitle">
<xsl:apply-templates mode="colophon.titlepage.recto.auto.mode" select="colophoninfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="colophon.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="colophon.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="colophon.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="colophon.titlepage.verso">
</xsl:template>
 
<xsl:template name="colophon.titlepage.separator">
</xsl:template>
 
<xsl:template name="colophon.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="colophon.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="colophon.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="colophon.titlepage.before.recto"/>
<xsl:call-template name="colophon.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="colophon.titlepage.before.verso"/>
<xsl:call-template name="colophon.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="colophon.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="colophon.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="colophon.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="colophon.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="colophon.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="colophon.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="sidebar.titlepage.recto">
<xsl:choose>
<xsl:when test="sidebarinfo/title">
<xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/title"/>
</xsl:when>
<xsl:when test="docinfo/title">
<xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="sidebarinfo/subtitle">
<xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/subtitle"/>
</xsl:when>
<xsl:when test="docinfo/subtitle">
<xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="sidebar.titlepage.verso">
</xsl:template>
 
<xsl:template name="sidebar.titlepage.separator">
</xsl:template>
 
<xsl:template name="sidebar.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="sidebar.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="sidebar.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="sidebar.titlepage.before.recto"/>
<xsl:call-template name="sidebar.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="sidebar.titlepage.before.verso"/>
<xsl:call-template name="sidebar.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="sidebar.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="sidebar.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="sidebar.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="sidebar.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sidebar.titlepage.recto.style" font-family="{$title.fontset}" font-weight="bold">
<xsl:apply-templates select="." mode="sidebar.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="sidebar.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="sidebar.titlepage.recto.style" font-family="{$title.fontset}">
<xsl:apply-templates select="." mode="sidebar.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="qandaset.titlepage.recto">
<xsl:choose>
<xsl:when test="qandasetinfo/title">
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/title"/>
</xsl:when>
<xsl:when test="blockinfo/title">
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/title"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
 
<xsl:choose>
<xsl:when test="qandasetinfo/subtitle">
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/subtitle"/>
</xsl:when>
<xsl:when test="blockinfo/subtitle">
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/subtitle"/>
</xsl:when>
<xsl:when test="info/subtitle">
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/subtitle"/>
</xsl:when>
<xsl:when test="subtitle">
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="subtitle"/>
</xsl:when>
</xsl:choose>
 
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/corpauthor"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/corpauthor"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/corpauthor"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/authorgroup"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/authorgroup"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/authorgroup"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/author"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/author"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/author"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/othercredit"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/othercredit"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/othercredit"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/releaseinfo"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/releaseinfo"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/releaseinfo"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/copyright"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/copyright"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/copyright"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/legalnotice"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/legalnotice"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/legalnotice"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/pubdate"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/pubdate"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/pubdate"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/revision"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/revision"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/revision"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/revhistory"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/revhistory"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/revhistory"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="qandasetinfo/abstract"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="blockinfo/abstract"/>
<xsl:apply-templates mode="qandaset.titlepage.recto.auto.mode" select="info/abstract"/>
</xsl:template>
 
<xsl:template name="qandaset.titlepage.verso">
</xsl:template>
 
<xsl:template name="qandaset.titlepage.separator">
</xsl:template>
 
<xsl:template name="qandaset.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="qandaset.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="qandaset.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="{$title.fontset}">
<xsl:variable name="recto.content">
<xsl:call-template name="qandaset.titlepage.before.recto"/>
<xsl:call-template name="qandaset.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)">
<fo:block start-indent="0pt" text-align="center"><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="qandaset.titlepage.before.verso"/>
<xsl:call-template name="qandaset.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="qandaset.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="qandaset.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="qandaset.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="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" keep-with-next.within-column="always" font-size="24.8832pt" font-weight="bold">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::qandaset[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
 
<xsl:template match="subtitle" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="corpauthor" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="authorgroup" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="author" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em" font-size="14.4pt">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="othercredit" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="releaseinfo" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="copyright" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="legalnotice" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" text-align="start" margin-left="0.5in" margin-right="0.5in" font-family="{$body.fontset}">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="pubdate" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revision" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="revhistory" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template match="abstract" mode="qandaset.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="qandaset.titlepage.recto.style" space-before="0.5em" text-align="start" margin-left="0.5in" margin-right="0.5in" font-family="{$body.fontset}">
<xsl:apply-templates select="." mode="qandaset.titlepage.recto.mode"/>
</fo:block>
</xsl:template>
 
<xsl:template name="table.of.contents.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="table.of.contents.titlepage.recto.style" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="{$title.margin.left}" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'TableofContents'"/>
</xsl:call-template></fo:block>
</xsl:template>
 
<xsl:template name="table.of.contents.titlepage.verso">
</xsl:template>
 
<xsl:template name="table.of.contents.titlepage.separator">
</xsl:template>
 
<xsl:template name="table.of.contents.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="table.of.contents.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="table.of.contents.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="table.of.contents.titlepage.before.recto"/>
<xsl:call-template name="table.of.contents.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="table.of.contents.titlepage.before.verso"/>
<xsl:call-template name="table.of.contents.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="table.of.contents.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="table.of.contents.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="table.of.contents.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="list.of.tables.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="list.of.tables.titlepage.recto.style" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="{$title.margin.left}" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'ListofTables'"/>
</xsl:call-template></fo:block>
</xsl:template>
 
<xsl:template name="list.of.tables.titlepage.verso">
</xsl:template>
 
<xsl:template name="list.of.tables.titlepage.separator">
</xsl:template>
 
<xsl:template name="list.of.tables.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="list.of.tables.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="list.of.tables.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="list.of.tables.titlepage.before.recto"/>
<xsl:call-template name="list.of.tables.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="list.of.tables.titlepage.before.verso"/>
<xsl:call-template name="list.of.tables.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="list.of.tables.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="list.of.tables.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="list.of.tables.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="list.of.figures.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="list.of.figures.titlepage.recto.style" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="{$title.margin.left}" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'ListofFigures'"/>
</xsl:call-template></fo:block>
</xsl:template>
 
<xsl:template name="list.of.figures.titlepage.verso">
</xsl:template>
 
<xsl:template name="list.of.figures.titlepage.separator">
</xsl:template>
 
<xsl:template name="list.of.figures.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="list.of.figures.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="list.of.figures.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="list.of.figures.titlepage.before.recto"/>
<xsl:call-template name="list.of.figures.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="list.of.figures.titlepage.before.verso"/>
<xsl:call-template name="list.of.figures.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="list.of.figures.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="list.of.figures.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="list.of.figures.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="list.of.examples.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="list.of.examples.titlepage.recto.style" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="{$title.margin.left}" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'ListofExamples'"/>
</xsl:call-template></fo:block>
</xsl:template>
 
<xsl:template name="list.of.examples.titlepage.verso">
</xsl:template>
 
<xsl:template name="list.of.examples.titlepage.separator">
</xsl:template>
 
<xsl:template name="list.of.examples.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="list.of.examples.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="list.of.examples.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="list.of.examples.titlepage.before.recto"/>
<xsl:call-template name="list.of.examples.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="list.of.examples.titlepage.before.verso"/>
<xsl:call-template name="list.of.examples.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="list.of.examples.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="list.of.examples.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="list.of.examples.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="list.of.equations.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="list.of.equations.titlepage.recto.style" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="{$title.margin.left}" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'ListofEquations'"/>
</xsl:call-template></fo:block>
</xsl:template>
 
<xsl:template name="list.of.equations.titlepage.verso">
</xsl:template>
 
<xsl:template name="list.of.equations.titlepage.separator">
</xsl:template>
 
<xsl:template name="list.of.equations.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="list.of.equations.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="list.of.equations.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="list.of.equations.titlepage.before.recto"/>
<xsl:call-template name="list.of.equations.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="list.of.equations.titlepage.before.verso"/>
<xsl:call-template name="list.of.equations.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="list.of.equations.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="list.of.equations.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="list.of.equations.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="list.of.procedures.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="list.of.procedures.titlepage.recto.style" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="{$title.margin.left}" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'ListofProcedures'"/>
</xsl:call-template></fo:block>
</xsl:template>
 
<xsl:template name="list.of.procedures.titlepage.verso">
</xsl:template>
 
<xsl:template name="list.of.procedures.titlepage.separator">
</xsl:template>
 
<xsl:template name="list.of.procedures.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="list.of.procedures.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="list.of.procedures.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="list.of.procedures.titlepage.before.recto"/>
<xsl:call-template name="list.of.procedures.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="list.of.procedures.titlepage.before.verso"/>
<xsl:call-template name="list.of.procedures.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="list.of.procedures.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="list.of.procedures.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="list.of.procedures.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="list.of.unknowns.titlepage.recto">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-attribute-sets="list.of.unknowns.titlepage.recto.style" space-before.minimum="1em" space-before.optimum="1.5em" space-before.maximum="2em" space-after="0.5em" margin-left="{$title.margin.left}" start-indent="0pt" font-size="17.28pt" font-weight="bold" font-family="{$title.fontset}">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'ListofUnknown'"/>
</xsl:call-template></fo:block>
</xsl:template>
 
<xsl:template name="list.of.unknowns.titlepage.verso">
</xsl:template>
 
<xsl:template name="list.of.unknowns.titlepage.separator">
</xsl:template>
 
<xsl:template name="list.of.unknowns.titlepage.before.recto">
</xsl:template>
 
<xsl:template name="list.of.unknowns.titlepage.before.verso">
</xsl:template>
 
<xsl:template name="list.of.unknowns.titlepage">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="recto.content">
<xsl:call-template name="list.of.unknowns.titlepage.before.recto"/>
<xsl:call-template name="list.of.unknowns.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)">
<fo:block><xsl:copy-of select="$recto.content"/></fo:block>
</xsl:if>
<xsl:variable name="verso.content">
<xsl:call-template name="list.of.unknowns.titlepage.before.verso"/>
<xsl:call-template name="list.of.unknowns.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)">
<fo:block><xsl:copy-of select="$verso.content"/></fo:block>
</xsl:if>
<xsl:call-template name="list.of.unknowns.titlepage.separator"/>
</fo:block>
</xsl:template>
 
<xsl:template match="*" mode="list.of.unknowns.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="list.of.unknowns.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:stylesheet>
 
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autotoc.xsl
0,0 → 1,855
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
version='1.0'>
 
<!-- ********************************************************************
$Id: autotoc.xsl,v 1.1 2008-06-26 19:05:49 gleu Exp $
********************************************************************
 
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="set.toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="nodes" select="book|setindex"/>
 
<xsl:if test="$nodes">
<fo:block id="toc...{$id}"
xsl:use-attribute-sets="toc.margin.properties">
<xsl:if test="$axf.extensions != 0">
<xsl:attribute name="axf:outline-level">1</xsl:attribute>
<xsl:attribute name="axf:outline-expand">false</xsl:attribute>
<xsl:attribute name="axf:outline-title">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'TableofContents'"/>
</xsl:call-template>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="table.of.contents.titlepage"/>
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template name="division.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="nodes"
select="$toc-context/part
|$toc-context/reference
|$toc-context/preface
|$toc-context/chapter
|$toc-context/appendix
|$toc-context/article
|$toc-context/bibliography
|$toc-context/glossary
|$toc-context/index"/>
 
<xsl:if test="$nodes">
<fo:block id="toc...{$cid}"
xsl:use-attribute-sets="toc.margin.properties">
<xsl:if test="$axf.extensions != 0">
<xsl:attribute name="axf:outline-level">1</xsl:attribute>
<xsl:attribute name="axf:outline-expand">false</xsl:attribute>
<xsl:attribute name="axf:outline-title">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'TableofContents'"/>
</xsl:call-template>
</xsl:attribute>
</xsl:if>
<xsl:if test="$toc.title.p">
<xsl:call-template name="table.of.contents.titlepage"/>
</xsl:if>
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template name="component.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="nodes" select="section|sect1|refentry
|article|bibliography|glossary
|qandaset[$qanda.in.toc != 0]
|appendix|index"/>
<xsl:if test="$nodes">
<fo:block id="toc...{$id}"
xsl:use-attribute-sets="toc.margin.properties">
<xsl:if test="$toc.title.p">
<xsl:call-template name="table.of.contents.titlepage"/>
</xsl:if>
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template name="component.toc.separator">
<!-- Customize to output something between
component.toc and first output -->
</xsl:template>
 
<xsl:template name="section.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="nodes"
select="section|sect1|sect2|sect3|sect4|sect5|refentry
|qandaset[$qanda.in.toc != 0]
|bridgehead[$bridgehead.in.toc != 0]"/>
 
<xsl:variable name="level">
<xsl:call-template name="section.level"/>
</xsl:variable>
 
<xsl:if test="$nodes">
<fo:block id="toc...{$id}"
xsl:use-attribute-sets="toc.margin.properties">
 
<xsl:if test="$toc.title.p">
<xsl:call-template name="section.heading">
<xsl:with-param name="level" select="$level + 1"/>
<xsl:with-param name="title">
<fo:block space-after="0.5em">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'TableofContents'"/>
</xsl:call-template>
</fo:block>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
 
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template name="section.toc.separator">
<!-- Customize to output something between
section.toc and first output -->
</xsl:template>
<!-- ==================================================================== -->
 
<xsl:template name="toc.line">
<xsl:param name="toc-context" select="NOTANODE"/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
 
<fo:block xsl:use-attribute-sets="toc.line.properties">
<fo:inline keep-with-next.within-line="always">
<fo:basic-link internal-destination="{$id}">
<xsl:if test="$label != ''">
<xsl:copy-of select="$label"/>
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<xsl:apply-templates select="." mode="titleabbrev.markup"/>
</fo:basic-link>
</fo:inline>
<fo:inline keep-together.within-line="always">
<xsl:text> </xsl:text>
<fo:leader leader-pattern="dots"
leader-pattern-width="3pt"
leader-alignment="reference-area"
keep-with-next.within-line="always"/>
<xsl:text> </xsl:text>
<fo:basic-link internal-destination="{$id}">
<fo:page-number-citation ref-id="{$id}"/>
</fo:basic-link>
</fo:inline>
</fo:block>
</xsl:template>
 
<!-- ==================================================================== -->
<xsl:template name="qandaset.toc">
<xsl:param name="toc-context" select="."/>
<xsl:param name="toc.title.p" select="true()"/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="nodes" select="qandadiv|qandaentry"/>
 
<xsl:if test="$nodes">
<fo:block id="toc...{$id}"
xsl:use-attribute-sets="toc.margin.properties">
<xsl:if test="$toc.title.p">
<xsl:call-template name="table.of.contents.titlepage"/>
</xsl:if>
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template name="qandaset.toc.separator">
<!-- Customize to output something between
qandaset.toc and first output -->
</xsl:template>
 
<xsl:template match="qandadiv" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:variable name="nodes" select="qandadiv|qandaentry"/>
 
<xsl:if test="$nodes">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent"/>
</xsl:attribute>
 
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="qandaentry" mode="toc">
<xsl:apply-templates select="question" mode="toc"/>
</xsl:template>
 
<xsl:template match="question" mode="toc">
<xsl:variable name="firstchunk">
<xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/>
</xsl:variable>
 
<xsl:variable name="deflabel">
<xsl:choose>
<xsl:when test="ancestor-or-self::*[@defaultlabel]">
<xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
/@defaultlabel"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$qanda.defaultlabel"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
 
<fo:block xsl:use-attribute-sets="toc.line.properties"
margin-left="3em"
text-indent="-3em"
end-indent="{$toc.indent.width}pt"
last-line-end-indent="-{$toc.indent.width}pt">
<fo:inline keep-with-next.within-line="always">
<fo:basic-link internal-destination="{$id}">
<xsl:if test="$label != ''">
<xsl:copy-of select="$label"/>
<xsl:if test="$deflabel = 'number' and not(label)">
<xsl:value-of select="$autotoc.label.separator"/>
</xsl:if>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:copy-of select="$firstchunk"/>
</fo:basic-link>
</fo:inline>
<fo:inline keep-together.within-line="always">
<xsl:text> </xsl:text>
<fo:leader leader-pattern="dots"
leader-pattern-width="3pt"
leader-alignment="reference-area"
keep-with-next.within-line="always"/>
<xsl:text> </xsl:text>
<fo:basic-link internal-destination="{$id}">
<fo:page-number-citation ref-id="{$id}"/>
</fo:basic-link>
</fo:inline>
</fo:block>
 
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="book|setindex" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:variable name="nodes" select="glossary|bibliography|preface|chapter
|reference|part|article|appendix|index"/>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth > 0
and $toc.max.depth > $depth.from.context
and $nodes">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent"/>
</xsl:attribute>
 
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="part" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:variable name="nodes" select="chapter|appendix|preface|reference|
refentry|article|index|glossary|
bibliography"/>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth > 0
and $toc.max.depth > $depth.from.context
and $nodes">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent"/>
</xsl:attribute>
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="reference" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:if test="$toc.section.depth > 0
and $toc.max.depth > $depth.from.context
and refentry">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent"/>
</xsl:attribute>
<xsl:apply-templates select="refentry" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="refentry" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="preface|chapter|appendix|article"
mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:variable name="nodes" select="section|sect1
|qandaset[$qanda.in.toc != 0]
|simplesect[$simplesect.in.toc != 0]
|refentry|appendix"/>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth > 0
and $toc.max.depth > $depth.from.context
and $nodes">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent"/>
</xsl:attribute>
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="sect1" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth > 1
and $toc.max.depth > $depth.from.context
and sect2">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent"/>
</xsl:attribute>
<xsl:apply-templates select="sect2|qandaset[$qanda.in.toc != 0]"
mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="sect2" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:variable name="reldepth"
select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth > 2
and $toc.max.depth > $depth.from.context
and sect3">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent">
<xsl:with-param name="reldepth" select="$reldepth"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="sect3|qandaset[$qanda.in.toc != 0]"
mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="sect3" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:variable name="reldepth"
select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth > 3
and $toc.max.depth > $depth.from.context
and sect4">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent">
<xsl:with-param name="reldepth" select="$reldepth"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="sect4|qandaset[$qanda.in.toc != 0]"
mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="sect4" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:variable name="reldepth"
select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth > 4
and $toc.max.depth > $depth.from.context
and sect5">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent">
<xsl:with-param name="reldepth" select="$reldepth"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="sect5|qandaset[$qanda.in.toc != 0]"
mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="sect5|simplesect" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
 
<xsl:template name="set.toc.indent">
<xsl:param name="reldepth"/>
 
<xsl:variable name="depth">
<xsl:choose>
<xsl:when test="$reldepth != ''">
<xsl:value-of select="$reldepth"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="count(ancestor::*)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:choose>
<xsl:when test="$fop.extensions != 0 or $passivetex.extensions != 0">
<xsl:value-of select="concat($depth*$toc.indent.width, 'pt')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($toc.indent.width, 'pt')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
 
<xsl:template match="section" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="depth" select="count(ancestor::section) + 1"/>
<xsl:variable name="reldepth"
select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth &gt;= $depth">
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:if test="$toc.section.depth > $depth
and $toc.max.depth > $depth.from.context
and section">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent">
<xsl:with-param name="reldepth" select="$reldepth"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="section|qandaset[$qanda.in.toc != 0]"
mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:if>
</xsl:template>
 
<xsl:template match="bibliography|glossary"
mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:call-template name="toc.line">
<xsl: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="."/>
 
<xsl:if test="* or $generate.index != 0">
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
 
<xsl:template match="title" mode="toc">
<xsl:apply-templates/>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template name="list.of.titles">
<xsl:param name="titles" select="'table'"/>
<xsl:param name="nodes" select=".//table"/>
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:if test="$nodes">
<fo:block id="lot...{$titles}...{$id}">
<xsl:choose>
<xsl:when test="$titles='table'">
<xsl:call-template name="list.of.tables.titlepage"/>
</xsl:when>
<xsl:when test="$titles='figure'">
<xsl:call-template name="list.of.figures.titlepage"/>
</xsl:when>
<xsl:when test="$titles='equation'">
<xsl:call-template name="list.of.equations.titlepage"/>
</xsl:when>
<xsl:when test="$titles='example'">
<xsl:call-template name="list.of.examples.titlepage"/>
</xsl:when>
<xsl:when test="$titles='procedure'">
<xsl:call-template name="list.of.procedures.titlepage"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="list.of.unknowns.titlepage"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="$nodes" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="figure|table|example|equation|procedure" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
</xsl:template>
 
<!-- ==================================================================== -->
 
<!-- qandaset handled like a section when qanda.in.toc is set -->
<xsl:template match="qandaset" mode="toc">
<xsl:param name="toc-context" select="."/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="cid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$toc-context"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="depth" select="count(ancestor::section) + 1"/>
<xsl:variable name="reldepth"
select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:variable name="depth.from.context" select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
 
<xsl:if test="$toc.section.depth &gt;= $depth">
<xsl:call-template name="toc.line">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:call-template>
 
<xsl:if test="$toc.section.depth > $depth
and $toc.max.depth > $depth.from.context
and (child::qandadiv or child::qandaentry)">
<fo:block id="toc.{$cid}.{$id}">
<xsl:attribute name="margin-left">
<xsl:call-template name="set.toc.indent">
<xsl:with-param name="reldepth" select="$reldepth"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="qandadiv|qandaentry" mode="toc">
<xsl:with-param name="toc-context" select="$toc-context"/>
</xsl:apply-templates>
</fo:block>
</xsl:if>
</xsl:if>
</xsl:template>
 
</xsl:stylesheet>
 
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/inline.xsl
0,0 → 1,1234
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY comment.block.parents "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:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink='http://www.w3.org/1999/xlink'
exclude-result-prefixes="xlink"
version='1.0'>
 
<!-- ********************************************************************
$Id: inline.xsl,v 1.1 2008-06-26 19:05:49 gleu Exp $
********************************************************************
 
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="linkend" select="$node/@linkend"/>
<xsl:param name="xhref" select="$node/@xlink:href"/>
 
<xsl:choose>
<xsl:when test="$xhref
and (not($node/@xlink:type) or
$node/@xlink:type='simple')">
 
<!-- Is it a local idref? -->
<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,'&#40;'))
or starts-with($xhref,
'#xpointer&#40;id&#40;'))">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>
<fo:basic-link internal-destination="{$idref}">
<xsl:copy-of select="$content"/>
</fo:basic-link>
</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>
<fo:basic-link external-destination="url({$xhref})">
<xsl:copy-of select="$content"/>
</fo:basic-link>
</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>
 
<xsl:choose>
<xsl:when test="count($target) = 0">
<xsl:message>
<xsl:text>XLink to nonexistent id: </xsl:text>
<xsl:value-of select="$linkend"/>
</xsl:message>
<xsl:copy-of select="$content"/>
</xsl:when>
 
<xsl:otherwise>
<fo:basic-link internal-destination="{$linkend}">
<xsl:copy-of select="$content"/>
</fo:basic-link>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
 
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
 
</xsl:template>
 
<xsl:template name="inline.charseq">
<xsl:param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<xsl:choose>
<xsl:when test="@dir">
<fo:inline>
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$content"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="inline.monoseq">
<xsl:param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<fo:inline xsl:use-attribute-sets="monospace.properties">
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
 
<xsl:template name="inline.boldseq">
<xsl:param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<fo:inline font-weight="bold">
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
 
<xsl:template name="inline.italicseq">
<xsl:param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<fo:inline font-style="italic">
<xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
 
<xsl:template name="inline.boldmonoseq">
<xsl:param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<fo:inline font-weight="bold" xsl:use-attribute-sets="monospace.properties">
<xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
 
<xsl:template name="inline.italicmonoseq">
<xsl:param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
<xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
 
<xsl:template name="inline.superscriptseq">
<xsl:param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<fo:inline xsl:use-attribute-sets="superscript.properties">
<xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$fop.extensions != 0">
<xsl:attribute name="vertical-align">super</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="baseline-shift">super</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
 
<xsl:template name="inline.subscriptseq">
<xsl:param name="content">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
 
<fo:inline xsl:use-attribute-sets="subscript.properties">
<xsl:call-template name="anchor"/>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$fop.extensions != 0">
<xsl:attribute name="vertical-align">sub</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="baseline-shift">sub</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
 
<!-- ==================================================================== -->
<!-- some special cases -->
 
<xsl:template match="author">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="editor">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="othercredit">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
</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()>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">
<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:template>
 
<xsl:template match="acronym">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="citerefentry">
<xsl:call-template name="inline.charseq"/>
</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">
<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="@role='bold' or @role='strong'">
<xsl:call-template name="inline.boldseq"/>
</xsl:when>
<xsl:when test="@role='underline'">
<fo:inline text-decoration="underline">
<xsl:call-template name="inline.charseq"/>
</fo:inline>
</xsl:when>
<xsl:when test="@role='strikethrough'">
<fo:inline text-decoration="line-through">
<xsl:call-template name="inline.charseq"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$depth mod 2 = 1">
<fo:inline font-style="normal">
<xsl:apply-templates/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.italicseq"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="foreignphrase">
<xsl:call-template name="inline.italicseq"/>
</xsl:template>
 
<xsl:template match="markup">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="phrase">
<xsl:call-template name="inline.charseq"/>
</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">
<fo:inline font-style="italic">
<xsl:call-template name="inline.charseq"/>
</fo:inline>
</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'">
<xsl:call-template name="inline.superscriptseq">
<xsl:with-param name="content" select="'SM'"/>
</xsl:call-template>
</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"/>
 
<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:choose>
<xsl:when test="$target">
<fo:basic-link internal-destination="{@linkend}"
xsl:use-attribute-sets="xref.properties">
<xsl:call-template name="inline.italicseq"/>
</fo:basic-link>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.italicseq"/>
</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]"/>
 
<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>
<fo:basic-link internal-destination="{$id}"
xsl:use-attribute-sets="xref.properties">
<xsl:call-template name="inline.italicseq"/>
</fo:basic-link>
</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="@baseform"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:variable name="targets"
select="//glossentry[glossterm=$term or 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>
<xsl:variable name="termid">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:variable>
 
<fo:basic-link internal-destination="{$termid}"
xsl:use-attribute-sets="xref.properties">
<xsl:call-template name="inline.charseq"/>
</fo:basic-link>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.italicseq"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="termdef">
<fo:inline>
<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>
</fo:inline>
</xsl:template>
 
<xsl:template match="sgmltag|tag">
<xsl:variable name="class">
<xsl:choose>
<xsl:when test="@class">
<xsl:value-of select="@class"/>
</xsl:when>
<xsl:otherwise>element</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:choose>
<xsl:when test="$class='attribute'">
<xsl:call-template name="inline.monoseq"/>
</xsl:when>
<xsl:when test="$class='attvalue'">
<xsl:call-template name="inline.monoseq"/>
</xsl:when>
<xsl:when test="$class='element'">
<xsl:call-template name="inline.monoseq"/>
</xsl:when>
<xsl:when test="$class='endtag'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>&lt;/</xsl:text>
<xsl:apply-templates/>
<xsl:text>&gt;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$class='genentity'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>&amp;</xsl:text>
<xsl:apply-templates/>
<xsl:text>;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$class='numcharref'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>&amp;#</xsl:text>
<xsl:apply-templates/>
<xsl:text>;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$class='paramentity'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>%</xsl:text>
<xsl:apply-templates/>
<xsl:text>;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$class='pi'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>&lt;?</xsl:text>
<xsl:apply-templates/>
<xsl:text>&gt;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$class='xmlpi'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>&lt;?</xsl:text>
<xsl:apply-templates/>
<xsl:text>?&gt;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$class='starttag'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>&lt;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&gt;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$class='emptytag'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>&lt;</xsl:text>
<xsl:apply-templates/>
<xsl:text>/&gt;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$class='sgmlcomment' or $class='comment'">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<xsl:text>&lt;!--</xsl:text>
<xsl:apply-templates/>
<xsl:text>--&gt;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="inline.charseq"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="email">
<xsl:call-template name="inline.monoseq">
<xsl:with-param name="content">
<fo:inline keep-together.within-line="always" hyphenate="false">
<xsl:if test="not($email.delimiters.enabled = 0)">
<xsl:text>&lt;</xsl:text>
</xsl:if>
<xsl:apply-templates/>
<xsl:if test="not($email.delimiters.enabled = 0)">
<xsl:text>&gt;</xsl:text>
</xsl:if>
</fo:inline>
</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:when>
<xsl:otherwise>+</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="*">
<xsl:if test="position()>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:variable name="mm.separator">
<xsl:choose>
<xsl:when test="($fop.extensions != 0 or $fop1.extensions != 0 ) and
contains($menuchoice.menu.separator, '&#x2192;')">
<fo:inline font-family="Symbol">
<xsl:copy-of select="$menuchoice.menu.separator"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$menuchoice.menu.separator"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:choose>
<xsl:when test="$count>count($nodelist)"></xsl:when>
<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:copy-of select="$mm.separator"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-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>
<fo:basic-link>
<xsl:attribute name="internal-destination">
<xsl:call-template name="object.id">
<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>
</fo:basic-link>
<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[&comment.block.parents;]|remark[&comment.block.parents;]">
<xsl:if test="$show.comments != 0">
<fo:block font-style="italic">
<xsl:call-template name="inline.charseq"/>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="comment|remark">
<xsl:if test="$show.comments != 0">
<fo:inline font-style="italic">
<xsl:call-template name="inline.charseq"/>
</fo:inline>
</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:apply-templates select="personname"/>
</xsl:template>
 
<xsl:template match="personname">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="person.name"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="jobtitle">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:apply-templates/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="org">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="orgname">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="orgdiv">
<xsl:call-template name="inline.charseq"/>
</xsl:template>
 
<xsl:template match="affiliation">
<xsl:call-template name="inline.charseq"/>
</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/fo/profile-docbook.xsl
0,0 → 1,284
<?xml version="1.0" encoding="US-ASCII"?>
<!--This file was created automatically by xsl2profile-->
<!--from the DocBook XSL stylesheets.-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns:exslt="http://exslt.org/common" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="db ng exsl exslt" version="1.0">
 
<!-- It is important to use indent="no" here, otherwise verbatim -->
<!-- environments get broken by indented tags...at least when the -->
<!-- callout extension is used...at least with some processors -->
<xsl:output method="xml" indent="no"/>
 
<!-- ********************************************************************
$Id: profile-docbook.xsl,v 1.1 2008-06-26 19:05:49 gleu Exp $
********************************************************************
 
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/olink.xsl"/>
<xsl:include href="../common/targets.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="fo.xsl"/>
<xsl:include href="fo-rtf.xsl"/>
<xsl:include href="info.xsl"/>
<xsl:include href="keywords.xsl"/>
<xsl:include href="division.xsl"/>
<xsl:include href="index.xsl"/>
<xsl:include href="toc.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="pagesetup.xsl"/>
<xsl:include href="pi.xsl"/>
<xsl:include href="spaces.xsl"/>
<xsl:include href="ebnf.xsl"/>
<xsl:include href="../html/chunker.xsl"/>
<xsl:include href="annotations.xsl"/>
<xsl:include href="../common/stripns.xsl"/>
 
<xsl:include href="fop.xsl"/>
<xsl:include href="fop1.xsl"/>
<xsl:include href="passivetex.xsl"/>
<xsl:include href="xep.xsl"/>
<xsl:include href="axf.xsl"/>
<xsl:include href="ptc.xsl"/>
 
<xsl:param name="stylesheet.result.type" select="'fo'"/>
 
<!-- ==================================================================== -->
 
<xsl:key name="id" match="*" use="@id|@xml:id"/>
 
<!-- ==================================================================== -->
 
<xsl:template match="*">
<xsl:message>
<xsl:value-of select="name(.)"/>
<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>
<fo:block 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>
</fo:block>
</xsl:template>
 
<!-- Update this list if new root elements supported -->
<xsl:variable name="root.elements" select="' appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex '"/>
 
<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:variable name="root.element" select="key('id', $rootid)"/>
<xsl:choose>
<xsl:when test="count($root.element) = 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:when test="not(contains($root.elements, concat(' ', local-name($root.element), ' ')))">
<xsl:message terminate="yes">
<xsl:text>ERROR: Document root element ($rootid=</xsl:text>
<xsl:value-of select="$rootid"/>
<xsl:text>) for FO output </xsl:text>
<xsl:text>must be one of the following elements:</xsl:text>
<xsl:value-of select="$root.elements"/>
</xsl:message>
</xsl:when>
<!-- Otherwise proceed -->
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
<xsl:apply-templates select="$root.element" mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="$root.element" mode="process.root"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- Otherwise process the document root element -->
<xsl:otherwise>
<xsl:variable name="document.element" select="*[1]"/>
<xsl:choose>
<xsl:when test="not(contains($root.elements, concat(' ', local-name($document.element), ' ')))">
<xsl:message terminate="yes">
<xsl:text>ERROR: Document root element for FO output </xsl:text>
<xsl:text>must be one of the following elements:</xsl:text>
<xsl:value-of select="$root.elements"/>
</xsl:message>
</xsl:when>
<!-- Otherwise proceed -->
<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>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="*" mode="process.root">
<xsl:variable name="document.element" select="self::*"/>
 
<xsl:call-template name="root.messages"/>
 
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$document.element/title[1]">
<xsl:value-of select="$document.element/title[1]"/>
</xsl:when>
<xsl:otherwise>[could not find document title]</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Include all id values in XEP output -->
<xsl:if test="$xep.extensions != 0">
<xsl:processing-instruction name="xep-pdf-drop-unused-destinations">false</xsl:processing-instruction>
</xsl:if>
 
<fo:root xsl:use-attribute-sets="root.properties">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language">
<xsl:with-param name="target" select="/*[1]"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:if test="$xep.extensions != 0">
<xsl:call-template name="xep-pis"/>
<xsl:call-template name="xep-document-information"/>
</xsl:if>
<xsl:if test="$axf.extensions != 0">
<xsl:call-template name="axf-document-information"/>
</xsl:if>
 
<xsl:call-template name="setup.pagemasters"/>
 
<xsl:if test="$fop.extensions != 0">
<xsl:apply-templates select="$document.element" mode="fop.outline"/>
</xsl:if>
 
<xsl:if test="$fop1.extensions != 0">
<xsl:variable name="bookmarks">
<xsl:apply-templates select="$document.element" mode="fop1.outline"/>
</xsl:variable>
<xsl:if test="string($bookmarks) != ''">
<fo:bookmark-tree>
<xsl:copy-of select="$bookmarks"/>
</fo:bookmark-tree>
</xsl:if>
</xsl:if>
 
<xsl:if test="$xep.extensions != 0">
<xsl:variable name="bookmarks">
<xsl:apply-templates select="$document.element" mode="xep.outline"/>
</xsl:variable>
<xsl:if test="string($bookmarks) != ''">
<rx:outline xmlns:rx="http://www.renderx.com/XSL/Extensions">
<xsl:copy-of select="$bookmarks"/>
</rx:outline>
</xsl:if>
</xsl:if>
 
<xsl:if test="$arbortext.extensions != 0 and $ati.xsl11.bookmarks != 0">
<xsl:variable name="bookmarks">
<xsl:apply-templates select="$document.element" mode="ati.xsl11.bookmarks"/>
</xsl:variable>
<xsl:if test="string($bookmarks) != ''">
<fo:bookmark-tree>
<xsl:copy-of select="$bookmarks"/>
</fo:bookmark-tree>
</xsl:if>
</xsl:if>
 
<xsl:apply-templates select="$document.element"/>
</fo:root>
</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:message>
<xsl:text>Making </xsl:text>
<xsl:value-of select="$page.orientation"/>
<xsl:text> pages on </xsl:text>
<xsl:value-of select="$paper.type"/>
<xsl:text> paper (</xsl:text>
<xsl:value-of select="$page.width"/>
<xsl:text>x</xsl:text>
<xsl:value-of select="$page.height"/>
<xsl:text>)</xsl:text>
</xsl:message>
</xsl:template>
 
<!-- ==================================================================== -->
 
</xsl:stylesheet>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/spaces.xsl
0,0 → 1,273
<?xml version='1.0' encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
 
<!-- ********************************************************************
$Id: spaces.xsl,v 1.1 2008-06-26 19:05:50 gleu Exp $
********************************************************************
XSL-FO specification treats all space characters like ordinary spaces.
We need to map them to fo:leader with different widths in order to
simulate desired behaviour.
******************************************************************** -->
 
<xsl:template match="text()[namespace-uri(..) = '']">
<xsl:choose>
<xsl:when test="$passivetex.extensions != 0">
<xsl:call-template name="passivetex.dash.subst">
<xsl:with-param name="string">
<xsl:call-template name="space.2000.subst">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2000.subst">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:param name="space.enquad.width">0.5em</xsl:param> <!-- U+2000 -->
<xsl:param name="space.emquad.width">1em</xsl:param> <!-- U+2001 -->
<xsl:param name="space.enspace.width">0.5em</xsl:param> <!-- U+2002 -->
<xsl:param name="space.emspace.width">1em</xsl:param> <!-- U+2003 -->
<xsl:param name="space.3emspace.width">0.33em</xsl:param><!-- U+2004 -->
<xsl:param name="space.4emspace.width">0.25em</xsl:param><!-- U+2005 -->
<xsl:param name="space.6emspace.width">0.16em</xsl:param><!-- U+2006 -->
<xsl:param name="space.figspace.width"></xsl:param> <!-- U+2007 -->
<xsl:param name="space.punctspace.width"></xsl:param> <!-- U+2008 -->
<xsl:param name="space.thinspace.width">0.2em</xsl:param><!-- U+2009 -->
<xsl:param name="space.hairspace.width">0.1em</xsl:param><!-- U+200A -->
 
<xsl:template name="space.2000.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2000;') and $space.enquad.width != ''">
<xsl:call-template name="space.2001.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2000;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.enquad.width}"/>
<xsl:call-template name="space.2000.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2000;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2001.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2001.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2001;') and $space.emquad.width != ''">
<xsl:call-template name="space.2002.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2001;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.emquad.width}"/>
<xsl:call-template name="space.2001.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2001;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2002.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2002.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2002;') and $space.enspace.width != ''">
<xsl:call-template name="space.2003.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2002;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.enspace.width}"/>
<xsl:call-template name="space.2002.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2002;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2003.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2003.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2003;') and $space.emspace.width != ''">
<xsl:call-template name="space.2004.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2003;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.emspace.width}"/>
<xsl:call-template name="space.2003.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2003;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2004.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2004.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2004;') and $space.3emspace.width != ''">
<xsl:call-template name="space.2005.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2004;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.3emspace.width}"/>
<xsl:call-template name="space.2004.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2004;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2005.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2005.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2005;') and $space.4emspace.width != ''">
<xsl:call-template name="space.2006.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2005;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.4emspace.width}"/>
<xsl:call-template name="space.2005.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2005;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2006.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2006.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2006;') and $space.6emspace.width != ''">
<xsl:call-template name="space.2007.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2006;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.6emspace.width}"/>
<xsl:call-template name="space.2006.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2006;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2007.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2007.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2007;') and $space.figspace.width != ''">
<xsl:call-template name="space.2008.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2007;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.figspace.width}"/>
<xsl:call-template name="space.2007.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2007;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2008.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2008.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2008;') and $space.punctspace.width != ''">
<xsl:call-template name="space.2009.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2008;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.punctspace.width}"/>
<xsl:call-template name="space.2008.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2008;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.2009.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.2009.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x2009;') and $space.thinspace.width != ''">
<xsl:call-template name="space.200A.subst">
<xsl:with-param name="string" select="substring-before($string, '&#x2009;')"/>
</xsl:call-template>
<fo:leader leader-length="{$space.thinspace.width}"/>
<xsl:call-template name="space.2009.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x2009;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="space.200A.subst">
<xsl:with-param name="string" select="$string"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="space.200A.subst">
<xsl:param name="string"/>
 
<xsl:choose>
<xsl:when test="contains($string, '&#x200A;') and $space.hairspace.width != ''">
<xsl:value-of select="substring-before($string, '&#x200A;')"/>
<fo:leader leader-length="{$space.hairspace.width}"/>
<xsl:call-template name="space.200A.subst">
<xsl:with-param name="string" select="substring-after($string, '&#x200A;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
</xsl:stylesheet>
 
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/docbook.xsl
0,0 → 1,331
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:ng="http://docbook.org/docbook-ng"
xmlns:db="http://docbook.org/ns/docbook"
exclude-result-prefixes="db ng exsl"
version='1.0'>
 
<!-- It is important to use indent="no" here, otherwise verbatim -->
<!-- environments get broken by indented tags...at least when the -->
<!-- callout extension is used...at least with some processors -->
<xsl:output method="xml" indent="no"/>
 
<!-- ********************************************************************
$Id: docbook.xsl,v 1.1 2008-06-26 19:05:49 gleu Exp $
********************************************************************
 
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/olink.xsl"/>
<xsl:include href="../common/targets.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="fo.xsl"/>
<xsl:include href="fo-rtf.xsl"/>
<xsl:include href="info.xsl"/>
<xsl:include href="keywords.xsl"/>
<xsl:include href="division.xsl"/>
<xsl:include href="index.xsl"/>
<xsl:include href="toc.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="pagesetup.xsl"/>
<xsl:include href="pi.xsl"/>
<xsl:include href="spaces.xsl"/>
<xsl:include href="ebnf.xsl"/>
<xsl:include href="../html/chunker.xsl"/>
<xsl:include href="annotations.xsl"/>
<xsl:include href="../common/stripns.xsl"/>
 
<xsl:include href="fop.xsl"/>
<xsl:include href="fop1.xsl"/>
<xsl:include href="passivetex.xsl"/>
<xsl:include href="xep.xsl"/>
<xsl:include href="axf.xsl"/>
<xsl:include href="ptc.xsl"/>
 
<xsl:param name="stylesheet.result.type" select="'fo'"/>
 
<!-- ==================================================================== -->
 
<xsl:key name="id" match="*" use="@id|@xml:id"/>
 
<!-- ==================================================================== -->
 
<xsl:template match="*">
<xsl:message>
<xsl:value-of select="name(.)"/>
<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>
<fo:block 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>
</fo:block>
</xsl:template>
 
<!-- Update this list if new root elements supported -->
<xsl:variable name="root.elements" select="' appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex '"/>
 
<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:variable name="root.element" select="key('id', $rootid)"/>
<xsl:choose>
<xsl:when test="count($root.element) = 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:when test="not(contains($root.elements, concat(' ', local-name($root.element), ' ')))">
<xsl:message terminate="yes">
<xsl:text>ERROR: Document root element ($rootid=</xsl:text>
<xsl:value-of select="$rootid"/>
<xsl:text>) for FO output </xsl:text>
<xsl:text>must be one of the following elements:</xsl:text>
<xsl:value-of select="$root.elements"/>
</xsl:message>
</xsl:when>
<!-- Otherwise proceed -->
<xsl:otherwise>
<xsl:if test="$collect.xref.targets = 'yes' or
$collect.xref.targets = 'only'">
<xsl:apply-templates select="$root.element"
mode="collect.targets"/>
</xsl:if>
<xsl:if test="$collect.xref.targets != 'only'">
<xsl:apply-templates select="$root.element"
mode="process.root"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- Otherwise process the document root element -->
<xsl:otherwise>
<xsl:variable name="document.element" select="*[1]"/>
<xsl:choose>
<xsl:when test="not(contains($root.elements,
concat(' ', local-name($document.element), ' ')))">
<xsl:message terminate="yes">
<xsl:text>ERROR: Document root element for FO output </xsl:text>
<xsl:text>must be one of the following elements:</xsl:text>
<xsl:value-of select="$root.elements"/>
</xsl:message>
</xsl:when>
<!-- Otherwise proceed -->
<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>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="*" mode="process.root">
<xsl:variable name="document.element" select="self::*"/>
 
<xsl:call-template name="root.messages"/>
 
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$document.element/title[1]">
<xsl:value-of select="$document.element/title[1]"/>
</xsl:when>
<xsl:otherwise>[could not find document title]</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Include all id values in XEP output -->
<xsl:if test="$xep.extensions != 0">
<xsl:processing-instruction
name="xep-pdf-drop-unused-destinations">false</xsl:processing-instruction>
</xsl:if>
 
<fo:root xsl:use-attribute-sets="root.properties">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language">
<xsl:with-param name="target" select="/*[1]"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:if test="$xep.extensions != 0">
<xsl:call-template name="xep-pis"/>
<xsl:call-template name="xep-document-information"/>
</xsl:if>
<xsl:if test="$axf.extensions != 0">
<xsl:call-template name="axf-document-information"/>
</xsl:if>
 
<xsl:call-template name="setup.pagemasters"/>
 
<xsl:if test="$fop.extensions != 0">
<xsl:apply-templates select="$document.element" mode="fop.outline"/>
</xsl:if>
 
<xsl:if test="$fop1.extensions != 0">
<xsl:variable name="bookmarks">
<xsl:apply-templates select="$document.element"
mode="fop1.outline"/>
</xsl:variable>
<xsl:if test="string($bookmarks) != ''">
<fo:bookmark-tree>
<xsl:copy-of select="$bookmarks"/>
</fo:bookmark-tree>
</xsl:if>
</xsl:if>
 
<xsl:if test="$xep.extensions != 0">
<xsl:variable name="bookmarks">
<xsl:apply-templates select="$document.element" mode="xep.outline"/>
</xsl:variable>
<xsl:if test="string($bookmarks) != ''">
<rx:outline xmlns:rx="http://www.renderx.com/XSL/Extensions">
<xsl:copy-of select="$bookmarks"/>
</rx:outline>
</xsl:if>
</xsl:if>
 
<xsl:if test="$arbortext.extensions != 0 and $ati.xsl11.bookmarks != 0">
<xsl:variable name="bookmarks">
<xsl:apply-templates select="$document.element"
mode="ati.xsl11.bookmarks"/>
</xsl:variable>
<xsl:if test="string($bookmarks) != ''">
<fo:bookmark-tree>
<xsl:copy-of select="$bookmarks"/>
</fo:bookmark-tree>
</xsl:if>
</xsl:if>
 
<xsl:apply-templates select="$document.element"/>
</fo:root>
</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:message>
<xsl:text>Making </xsl:text>
<xsl:value-of select="$page.orientation"/>
<xsl:text> pages on </xsl:text>
<xsl:value-of select="$paper.type"/>
<xsl:text> paper (</xsl:text>
<xsl:value-of select="$page.width"/>
<xsl:text>x</xsl:text>
<xsl:value-of select="$page.height"/>
<xsl:text>)</xsl:text>
</xsl:message>
</xsl:template>
 
<!-- ==================================================================== -->
 
</xsl:stylesheet>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/formal.xsl
0,0 → 1,534
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
 
<!-- ********************************************************************
$Id: formal.xsl,v 1.1 2008-06-26 19:05:49 gleu Exp $
********************************************************************
 
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.
 
******************************************************************** -->
 
<!-- formal.object creates a basic block containing the
result of processing the object, including its title
and any keep-together properties.
The template calling formal.object may wrap these results in a
float or pgwide block. -->
 
<xsl:template name="formal.object">
<xsl:param name="placement" select="'before'"/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="content">
<xsl:if test="$placement = 'before'">
<xsl:call-template name="formal.object.heading">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:if>
<xsl:apply-templates/>
<xsl:if test="$placement != 'before'">
<xsl:call-template name="formal.object.heading">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
 
<xsl:variable name="keep.together">
<xsl:call-template name="pi.dbfo_keep-together"/>
</xsl:variable>
 
<xsl:choose>
<!-- tables have their own templates and
are not handled by formal.object -->
<xsl:when test="self::figure">
<fo:block id="{$id}"
xsl:use-attribute-sets="figure.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:block>
</xsl:when>
<xsl:when test="self::example">
<fo:block id="{$id}"
xsl:use-attribute-sets="example.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:block>
</xsl:when>
<xsl:when test="self::equation">
<fo:block id="{$id}"
xsl:use-attribute-sets="equation.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:block>
</xsl:when>
<xsl:when test="self::procedure">
<fo:block id="{$id}"
xsl:use-attribute-sets="procedure.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block id="{$id}"
xsl:use-attribute-sets="formal.object.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="formal.object.heading">
<xsl:param name="object" select="."/>
<xsl:param name="placement" select="'before'"/>
 
<fo:block xsl:use-attribute-sets="formal.title.properties">
<xsl:choose>
<xsl:when test="$placement = 'before'">
<xsl:attribute
name="keep-with-next.within-column">always</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute
name="keep-with-previous.within-column">always</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="$object" mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:apply-templates>
</fo:block>
</xsl:template>
 
<xsl:template name="informal.object">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="keep.together">
<xsl:call-template name="pi.dbfo_keep-together"/>
</xsl:variable>
 
<xsl:choose>
<!-- informaltables have their own templates and
are not handled by formal.object -->
<xsl:when test="local-name(.) = 'equation'">
<fo:block id="{$id}"
xsl:use-attribute-sets="equation.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:when test="local-name(.) = 'procedure'">
<fo:block id="{$id}"
xsl:use-attribute-sets="procedure.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:when test="local-name(.) = 'informalfigure'">
<fo:block id="{$id}"
xsl:use-attribute-sets="informalfigure.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:when test="local-name(.) = 'informalexample'">
<fo:block id="{$id}"
xsl:use-attribute-sets="informalexample.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:when test="local-name(.) = 'informalequation'">
<fo:block id="{$id}"
xsl:use-attribute-sets="informalequation.properties">
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block id="{$id}"
xsl:use-attribute-sets="informal.object.properties">
<xsl:if test="$keep.together != ''">
<xsl:attribute name="keep-together.within-column"><xsl:value-of
select="$keep.together"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template name="semiformal.object">
<xsl:param name="placement" select="'before'"/>
<xsl:choose>
<xsl:when test="./title">
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="informal.object"/>
</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:variable name="figure">
<xsl:choose>
<xsl:when test="@pgwide = '1'">
<fo:block xsl:use-attribute-sets="pgwide.properties">
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</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="position" select="$floatstyle"/>
<xsl:with-param name="content" select="$figure"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$figure"/>
</xsl:otherwise>
</xsl:choose>
</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>
 
<!-- Example doesn't have a pgwide attribute, so may use a PI -->
<xsl:variable name="pgwide.pi">
<xsl:call-template name="pi.dbfo_pgwide"/>
</xsl:variable>
 
<xsl:variable name="pgwide">
<xsl:choose>
<xsl:when test="$pgwide.pi">
<xsl:value-of select="$pgwide.pi"/>
</xsl:when>
<!-- child element may set pgwide -->
<xsl:when test="*[@pgwide]">
<xsl:value-of select="*[@pgwide][1]/@pgwide"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
 
<!-- Get align value from internal mediaobject -->
<xsl:variable name="align">
<xsl:if test="mediaobject|mediaobjectco">
<xsl:variable name="olist" select="mediaobject/imageobject
|mediaobjectco/imageobjectco
|mediaobject/videoobject
|mediaobject/audioobject
|mediaobject/textobject"/>
 
<xsl:variable name="object.index">
<xsl:call-template name="select.mediaobject.index">
<xsl:with-param name="olist" select="$olist"/>
<xsl:with-param name="count" select="1"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="object" select="$olist[position() = $object.index]"/>
 
<xsl:value-of select="$object/descendant::imagedata[@align][1]/@align"/>
</xsl:if>
</xsl:variable>
 
<xsl:variable name="example">
<xsl:choose>
<xsl:when test="$pgwide = '1'">
<fo:block xsl:use-attribute-sets="pgwide.properties">
<xsl:if test="$align != ''">
<xsl:attribute name="text-align">
<xsl:value-of select="$align"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block>
<xsl:if test="$align != ''">
<xsl:attribute name="text-align">
<xsl:value-of select="$align"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="formal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</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="position" select="$floatstyle"/>
<xsl:with-param name="content" select="$example"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$example"/>
</xsl:otherwise>
</xsl:choose>
 
</xsl:template>
 
<!-- Unified handling of CALS and HTML tables, formal and not -->
<!-- Creates a hierarchy of nested containers:
- Outer container does a float.
- Nested container does block-container for rotation
- Nested block contains title, layout table and footnotes
- Nested layout table placeholder template supports extensions.
- fo:table is innermost.
Created from the innermost and working out.
Not all layers apply to every table.
-->
<xsl:template match="table|informaltable">
<xsl:if test="tgroup/tbody/tr
|tgroup/thead/tr
|tgroup/tfoot/tr">
<xsl:message terminate="yes">
<xsl:text>Broken table: tr descendent of CALS Table.</xsl:text>
<xsl:text>The text in the first tr is:&#10;</xsl:text>
<xsl:value-of
select="(tgroup//tr)[1]"/>
</xsl:message>
</xsl:if>
<xsl:if test="not(tgroup) and .//row">
<xsl:message terminate="yes">
<xsl:text>Broken table: row descendent of HTML table.</xsl:text>
<xsl:text>The text in the first row is:&#10;</xsl:text>
<xsl:value-of
select=".//row[1]"/>
</xsl:message>
</xsl:if>
 
<!-- Contains fo:table, not title or footnotes -->
<xsl:variable name="table.content">
<xsl:call-template name="make.table.content"/>
</xsl:variable>
 
<!-- Optional layout table template for extensions -->
<xsl:variable name="table.layout">
<xsl:call-template name="table.layout">
<xsl:with-param name="table.content" select="$table.content"/>
</xsl:call-template>
</xsl:variable>
 
<!-- fo:block contains title, layout table, and footnotes -->
<xsl:variable name="table.block">
<xsl:call-template name="table.block">
<xsl:with-param name="table.layout" select="$table.layout"/>
</xsl:call-template>
</xsl:variable>
 
<!-- pgwide or orient container -->
<xsl:variable name="table.container">
<xsl:call-template name="table.container">
<xsl:with-param name="table.block" select="$table.block"/>
</xsl:call-template>
</xsl:variable>
 
<!-- float or not -->
<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="position" select="$floatstyle"/>
<xsl:with-param name="content" select="$table.container"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$table.container"/>
</xsl:otherwise>
</xsl:choose>
</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>
 
<!-- Equation doesn't have a pgwide attribute, so may use a PI -->
<xsl:variable name="pgwide">
<xsl:call-template name="pi.dbfo_pgwide"/>
</xsl:variable>
 
<xsl:variable name="equation">
<xsl:choose>
<xsl:when test="$pgwide = '1'">
<fo:block xsl:use-attribute-sets="pgwide.properties">
<xsl:call-template name="semiformal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="semiformal.object">
<xsl:with-param name="placement" select="$placement"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</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="position" select="$floatstyle"/>
<xsl:with-param name="content" select="$equation"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$equation"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="figure/title"></xsl:template>
<xsl:template match="figure/titleabbrev"></xsl:template>
<xsl:template match="table/title"></xsl:template>
<xsl:template match="table/titleabbrev"></xsl:template>
<xsl:template match="table/textobject"></xsl:template>
<xsl:template match="example/title"></xsl:template>
<xsl:template match="example/titleabbrev"></xsl:template>
<xsl:template match="equation/title"></xsl:template>
<xsl:template match="equation/titleabbrev"></xsl:template>
 
<xsl:template match="informalfigure">
<xsl:call-template name="informal.object"/>
</xsl:template>
 
<xsl:template match="informalexample">
<xsl:call-template name="informal.object"/>
</xsl:template>
 
<xsl:template match="informaltable/textobject"></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:stylesheet>
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/division.xsl
0,0 → 1,611
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
version='1.0'>
 
<!-- ********************************************************************
$Id: division.xsl,v 1.1 2008-06-26 19:05:49 gleu Exp $
********************************************************************
 
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="division.title">
<xsl:param name="node" select="."/>
<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="title">
<xsl:apply-templates select="$node" mode="object.title.markup"/>
</xsl:variable>
 
<xsl:if test="$passivetex.extensions != 0">
<fotex:bookmark xmlns:fotex="http://www.tug.org/fotex"
fotex-bookmark-level="1"
fotex-bookmark-label="{$id}">
<xsl:value-of select="$title"/>
</fotex:bookmark>
</xsl:if>
 
<fo:block keep-with-next.within-column="always"
hyphenate="false">
<xsl:if test="$axf.extensions != 0">
<xsl:attribute name="axf:outline-level">
<xsl:choose>
<xsl:when test="count($node/ancestor::*) > 0">
<xsl:value-of select="count($node/ancestor::*)"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="axf:outline-expand">false</xsl:attribute>
<xsl:attribute name="axf:outline-title">
<xsl:value-of select="normalize-space($title)"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$title"/>
</fo:block>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="set">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="preamble"
select="*[not(self::book or self::setindex)]"/>
 
<xsl:variable name="content" select="book|setindex"/>
 
<xsl:variable name="titlepage-master-reference">
<xsl:call-template name="select.pagemaster">
<xsl:with-param name="pageclass" select="'titlepage'"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="lot-master-reference">
<xsl:call-template name="select.pagemaster">
<xsl:with-param name="pageclass" select="'lot'"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:if test="$preamble">
<fo:page-sequence hyphenate="{$hyphenate}"
master-reference="{$titlepage-master-reference}">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language"/>
</xsl:attribute>
<xsl:attribute name="format">
<xsl:call-template name="page.number.format">
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="initial-page-number">
<xsl:call-template name="initial.page.number">
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="force-page-count">
<xsl:call-template name="force.page.count">
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="hyphenation-character">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-character'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-push-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-remain-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:apply-templates select="." mode="running.head.mode">
<xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
</xsl:apply-templates>
 
<xsl:apply-templates select="." mode="running.foot.mode">
<xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
</xsl:apply-templates>
 
<fo:flow flow-name="xsl-region-body">
<xsl:call-template name="set.flow.properties">
<xsl:with-param name="element" select="local-name(.)"/>
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
</xsl:call-template>
 
<fo:block id="{$id}">
<xsl:call-template name="set.titlepage"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:if>
 
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:if test="contains($toc.params, 'toc')">
<fo:page-sequence hyphenate="{$hyphenate}"
master-reference="{$lot-master-reference}">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language"/>
</xsl:attribute>
<xsl:attribute name="format">
<xsl:call-template name="page.number.format">
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="initial-page-number">
<xsl:call-template name="initial.page.number">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="force-page-count">
<xsl:call-template name="force.page.count">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="hyphenation-character">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-character'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-push-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-remain-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:apply-templates select="." mode="running.head.mode">
<xsl:with-param name="master-reference" select="$lot-master-reference"/>
</xsl:apply-templates>
 
<xsl:apply-templates select="." mode="running.foot.mode">
<xsl:with-param name="master-reference" select="$lot-master-reference"/>
</xsl:apply-templates>
 
<fo:flow flow-name="xsl-region-body">
<xsl:call-template name="set.flow.properties">
<xsl:with-param name="element" select="local-name(.)"/>
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
</xsl:call-template>
 
<xsl:call-template name="set.toc"/>
</fo:flow>
</fo:page-sequence>
</xsl:if>
 
<xsl:apply-templates select="$content"/>
</xsl:template>
 
<xsl:template match="set/setinfo"></xsl:template>
<xsl:template match="set/title"></xsl:template>
<xsl:template match="set/subtitle"></xsl:template>
<xsl:template match="set/titleabbrev"></xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="book">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="preamble"
select="title|subtitle|titleabbrev|bookinfo|info"/>
 
<xsl:variable name="content"
select="node()[not(self::title or self::subtitle
or self::titleabbrev
or self::info
or self::bookinfo)]"/>
 
<xsl:variable name="titlepage-master-reference">
<xsl:call-template name="select.pagemaster">
<xsl:with-param name="pageclass" select="'titlepage'"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:call-template name="front.cover"/>
 
<xsl:if test="$preamble">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
<xsl:with-param name="content">
<fo:block id="{$id}">
<xsl:call-template name="book.titlepage"/>
</fo:block>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
 
<xsl:apply-templates select="dedication" mode="dedication"/>
 
<xsl:call-template name="make.book.tocs"/>
 
<xsl:apply-templates select="$content"/>
 
<xsl:call-template name="back.cover"/>
 
</xsl:template>
 
<xsl:template match="book/bookinfo"></xsl:template>
<xsl:template match="book/info"></xsl:template>
<xsl:template match="book/title"></xsl:template>
<xsl:template match="book/subtitle"></xsl:template>
<xsl:template match="book/titleabbrev"></xsl:template>
 
<!-- Placeholder templates -->
<xsl:template name="front.cover"/>
<xsl:template name="back.cover"/>
 
<!-- ================================================================= -->
<xsl:template name="make.book.tocs">
 
<xsl:variable name="lot-master-reference">
<xsl:call-template name="select.pagemaster">
<xsl:with-param name="pageclass" select="'lot'"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:if test="contains($toc.params, 'toc')">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="gentext-key" select="'TableofContents'"/>
<xsl:with-param name="content">
<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:if>
 
<xsl:if test="contains($toc.params,'figure') and .//figure">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="gentext-key" select="'ListofFigures'"/>
<xsl:with-param name="content">
<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:if>
 
<xsl:if test="contains($toc.params,'table') and .//table">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="gentext-key" select="'ListofTables'"/>
<xsl:with-param name="content">
<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:if>
 
<xsl:if test="contains($toc.params,'example') and .//example">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="gentext-key" select="'ListofExample'"/>
<xsl:with-param name="content">
<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:if>
 
<xsl:if test="contains($toc.params,'equation') and
.//equation[title or info/title]">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="gentext-key" select="'ListofEquations'"/>
<xsl:with-param name="content">
<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:with-param>
</xsl:call-template>
</xsl:if>
 
<xsl:if test="contains($toc.params,'procedure') and
.//procedure[title or info/title]">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="gentext-key" select="'ListofProcedures'"/>
<xsl:with-param name="content">
<xsl:call-template name="list.of.titles">
<xsl:with-param name="titles" select="'procedure'"/>
<xsl:with-param name="nodes"
select=".//procedure[title or info/title]"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
 
<xsl:template match="part">
<xsl:if test="not(partintro)">
<xsl:apply-templates select="." mode="part.titlepage.mode"/>
<xsl:call-template name="generate.part.toc"/>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
 
<xsl:template match="part" mode="part.titlepage.mode">
<!-- done this way to force the context node to be the part -->
<xsl:param name="additional.content"/>
 
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
 
<xsl:variable name="titlepage-master-reference">
<xsl:call-template name="select.pagemaster">
<xsl:with-param name="pageclass" select="'titlepage'"/>
</xsl:call-template>
</xsl:variable>
 
<fo:page-sequence hyphenate="{$hyphenate}"
master-reference="{$titlepage-master-reference}">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language"/>
</xsl:attribute>
<xsl:attribute name="format">
<xsl:call-template name="page.number.format">
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="initial-page-number">
<xsl:call-template name="initial.page.number">
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="force-page-count">
<xsl:call-template name="force.page.count">
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="hyphenation-character">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-character'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-push-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-remain-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:apply-templates select="." mode="running.head.mode">
<xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
</xsl:apply-templates>
 
<xsl:apply-templates select="." mode="running.foot.mode">
<xsl:with-param name="master-reference" select="$titlepage-master-reference"/>
</xsl:apply-templates>
 
<fo:flow flow-name="xsl-region-body">
<xsl:call-template name="set.flow.properties">
<xsl:with-param name="element" select="local-name(.)"/>
<xsl:with-param name="master-reference"
select="$titlepage-master-reference"/>
</xsl:call-template>
 
<fo:block id="{$id}">
<xsl:call-template name="part.titlepage"/>
</fo:block>
<xsl:copy-of select="$additional.content"/>
</fo:flow>
</fo:page-sequence>
</xsl:template>
 
<xsl:template match="part/docinfo|partinfo"></xsl:template>
<xsl:template match="part/info"></xsl:template>
<xsl:template match="part/title"></xsl:template>
<xsl:template match="part/subtitle"></xsl:template>
<xsl:template match="part/titleabbrev"></xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template name="generate.part.toc">
<xsl:param name="part" select="."/>
 
<xsl:variable name="lot-master-reference">
<xsl:call-template name="select.pagemaster">
<xsl:with-param name="pageclass" select="'lot'"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="node" select="$part"/>
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:variable name="nodes" select="reference|
preface|
chapter|
appendix|
article|
bibliography|
glossary|
index"/>
 
<xsl:if test="count($nodes) &gt; 0 and contains($toc.params, 'toc')">
<fo:page-sequence hyphenate="{$hyphenate}"
master-reference="{$lot-master-reference}">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language"/>
</xsl:attribute>
<xsl:attribute name="format">
<xsl:call-template name="page.number.format">
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="initial-page-number">
<xsl:call-template name="initial.page.number">
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="force-page-count">
<xsl:call-template name="force.page.count">
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="hyphenation-character">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-character'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-push-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-remain-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:apply-templates select="$part" mode="running.head.mode">
<xsl:with-param name="master-reference" select="$lot-master-reference"/>
</xsl:apply-templates>
 
<xsl:apply-templates select="$part" mode="running.foot.mode">
<xsl:with-param name="master-reference" select="$lot-master-reference"/>
</xsl:apply-templates>
 
<fo:flow flow-name="xsl-region-body">
<xsl:call-template name="set.flow.properties">
<xsl:with-param name="element" select="local-name(.)"/>
<xsl:with-param name="master-reference"
select="$lot-master-reference"/>
</xsl:call-template>
 
<xsl:call-template name="division.toc">
<xsl:with-param name="toc-context" select="$part"/>
<xsl:with-param name="toc.title.p"
select="contains($toc.params, 'title')"/>
</xsl:call-template>
 
</fo:flow>
</fo:page-sequence>
</xsl:if>
</xsl:template>
 
<!-- ==================================================================== -->
 
<xsl:template match="part/partintro">
<xsl:apply-templates select=".." mode="part.titlepage.mode">
<xsl:with-param name="additional.content">
<xsl:if test="title">
<xsl:call-template name="partintro.titlepage"/>
</xsl:if>
<xsl:apply-templates/>
</xsl:with-param>
</xsl:apply-templates>
 
<xsl:call-template name="generate.part.toc">
<xsl:with-param name="part" select=".."/>
</xsl:call-template>
</xsl:template>
 
<xsl:template match="partintro/title"></xsl:template>
<xsl:template match="partintro/subtitle"></xsl:template>
<xsl:template match="partintro/titleabbrev"></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:stylesheet>
 
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/fop.xsl
0,0 → 1,92
<?xml version='1.0' encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xml.apache.org/fop/extensions"
version='1.0'>
 
<!-- ********************************************************************
$Id: fop.xsl,v 1.1 2008-06-26 19:05:49 gleu Exp $
********************************************************************
(c) Stephane Bline Peregrine Systems 2001
Driver file to allow pdf bookmarking (based on fop implementation).
******************************************************************** -->
<!--
In PDF bookmarks can't be used characters with code>255. This version of file
translates characters with code>255 back to ASCII.
 
Pavel Zampach (zampach@volny.cz)
-->
 
<xsl:variable name="a-dia" select=
"'&#257;&#259;&#261;&#263;&#265;&#267;&#269;&#271;&#273;&#275;&#277;&#279;&#281;&#283;&#339;&#285;&#287;&#289;&#291;&#293;&#295;&#297;&#299;&#301;&#303;&#305;&#309;&#311;&#314;&#316;&#318;&#320;&#322;&#324;&#326;&#328;&#331;&#333;&#335;&#337;&#341;&#343;&#345;&#347;&#349;&#351;&#353;&#355;&#357;&#359;&#361;&#363;&#365;&#367;&#369;&#371;&#373;&#375;&#378;&#380;&#382;&#256;&#258;&#260;&#262;&#264;&#266;&#268;&#270;&#272;&#274;&#276;&#278;&#280;&#282;&#338;&#284;&#286;&#288;&#290;&#292;&#294;&#296;&#298;&#300;&#302;&#304;&#308;&#310;&#313;&#315;&#317;&#319;&#321;&#323;&#325;&#327;&#330;&#332;&#334;&#336;&#340;&#342;&#344;&#346;&#348;&#350;&#352;&#354;&#356;&#358;&#360;&#362;&#364;&#366;&#368;&#370;&#372;&#374;&#376;&#377;&#379;&#381;'"/>
<xsl:variable name="a-asc" select=
"'aaaccccddeeeeeegggghhiiiiijklllllnnnnooorrrsssstttuuuuuuwyzzzAAACCCCDDEEEEEEGGGGHHIIIIIJKLLLLLNNNNOOORRRSSSSTTTUUUUUUWYYZZZ'"/>
 
<xsl:template match="*" mode="fop.outline">
<xsl:variable name="id">
<xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:variable>
<xsl:if test="$id != ''">
<fox:destination internal-destination="{$id}"/>
</xsl:if>
<xsl:apply-templates select="*" mode="fop.outline"/>
</xsl:template>
 
<xsl:template match="set|book|part|reference|preface|chapter|appendix|article
|glossary|bibliography|index|setindex
|refentry
|sect1|sect2|sect3|sect4|sect5|section"
mode="fop.outline">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:variable name="bookmark-label">
<xsl:apply-templates select="." mode="object.title.markup"/>
</xsl:variable>
 
<!-- Put the root element bookmark at the same level as its children -->
<!-- If the object is a set or book, generate a bookmark for the toc -->
 
<xsl:choose>
<xsl:when test="parent::*">
<fox:outline internal-destination="{$id}">
<fox:label>
<xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
</fox:label>
<xsl:apply-templates select="*" mode="fop.outline"/>
</fox:outline>
</xsl:when>
<xsl:otherwise>
<fox:outline internal-destination="{$id}">
<fox:label>
<xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
</fox:label>
</fox:outline>
 
<xsl:variable name="toc.params">
<xsl:call-template name="find.path.params">
<xsl:with-param name="table" select="normalize-space($generate.toc)"/>
</xsl:call-template>
</xsl:variable>
 
<xsl:if test="contains($toc.params, 'toc')
and (book|part|reference|preface|chapter|appendix|article
|glossary|bibliography|index|setindex
|refentry
|sect1|sect2|sect3|sect4|sect5|section)">
<fox:outline internal-destination="toc...{$id}">
<fox:label>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'TableofContents'"/>
</xsl:call-template>
</fox:label>
</fox:outline>
</xsl:if>
<xsl:apply-templates select="*" mode="fop.outline"/>
</xsl:otherwise>
</xsl:choose>
<fox:destination internal-destination="{$id}"/>
</xsl:template>
 
</xsl:stylesheet>
 
/trunk/lfs/stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/toc.xsl
0,0 → 1,280
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
 
<!-- ********************************************************************
$Id: toc.xsl,v 1.1 2008-06-26 19:05:50 gleu Exp $
********************************************************************
 
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.
 
******************************************************************** -->
 
<!-- ==================================================================== -->
 
<!-- FIXME: in the contexts where <toc> can occur, I think it's always
the case that a page-sequence is required. Is that true? -->
 
<xsl:template match="toc">
<xsl:variable name="master-reference">
<xsl:call-template name="select.pagemaster"/>
</xsl:variable>
 
<xsl:choose>
<xsl:when test="*">
<xsl:if test="$process.source.toc != 0">
<!-- if the toc isn't empty, process it -->
<fo:page-sequence hyphenate="{$hyphenate}"
master-reference="{$master-reference}">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language"/>
</xsl:attribute>
<xsl:attribute name="format">
<xsl:call-template name="page.number.format">
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="master-reference"
select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="initial-page-number">
<xsl:call-template name="initial.page.number">
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="master-reference"
select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="force-page-count">
<xsl:call-template name="force.page.count">
<xsl:with-param name="master-reference"
select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="hyphenation-character">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-character'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-push-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-remain-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:apply-templates select="." mode="running.head.mode">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:apply-templates>
<xsl:apply-templates select="." mode="running.foot.mode">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:apply-templates>
 
<fo:flow flow-name="xsl-region-body">
<xsl:call-template name="set.flow.properties">
<xsl:with-param name="element" select="local-name(.)"/>
<xsl:with-param name="master-reference"
select="$master-reference"/>
</xsl:call-template>
 
<fo:block xsl:use-attribute-sets="toc.margin.properties">
<xsl:call-template name="table.of.contents.titlepage"/>
<xsl:apply-templates/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$process.empty.source.toc != 0">
<fo:page-sequence hyphenate="{$hyphenate}"
master-reference="{$master-reference}">
<xsl:attribute name="language">
<xsl:call-template name="l10n.language"/>
</xsl:attribute>
<xsl:attribute name="format">
<xsl:call-template name="page.number.format">
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="master-reference"
select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="initial-page-number">
<xsl:call-template name="initial.page.number">
<xsl:with-param name="element" select="'toc'"/>
<xsl:with-param name="master-reference"
select="$master-reference"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:attribute name="hyphenation-character">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-character'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-push-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="hyphenation-remain-character-count">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
</xsl:call-template>
</xsl:attribute>
 
<xsl:apply-templates select="." mode="running.head.mode">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:apply-templates>
<xsl:apply-templates select="." mode="running.foot.mode">
<xsl:with-param name="master-reference" select="$master-reference"/>
</xsl:apply-templates>
 
<fo:flow flow-name="xsl-region-body">
<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>
</fo:flow>
</fo:page-sequence>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
 
<xsl:template match="tocpart|tocchap
|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
<xsl:apply-templates select="tocentry"/>
<xsl:if test="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5">
<fo:block start-indent="{count(ancestor::*)*2}pc">
<xsl:apply-templates select="tocchap|toclevel1|toclevel2|toclevel3|toclevel4|toclevel5"/>
</fo:block>
</xsl:if>
</xsl:template>
 
<xsl:template match="tocentry|tocfront|tocback">
<fo:block text-align-last="justify"
end-indent="2pc"
last-line-end-indent="-2pc">
<fo:inline keep-with-next.within-line="always">
<xsl:choose>
<xsl:when test="@linkend">
<fo:basic-link internal-destination="{@linkend}">
<xsl:apply-templates/>
</fo:basic-link>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</fo:inline>
 
<xsl:choose>
<xsl:when test="@linkend">
<fo:inline keep-together.within-line="always">
<xsl:text> </xsl:text>
<fo:leader leader-pattern="dots"
keep-with-next.within-line="always"/>
<xsl:text> </xsl:text>
<fo:basic-link internal-destination="{@linkend}">
<xsl:choose>
<xsl:when test="@pagenum">
<xsl:value-of select="@pagenum"/>
</xsl:when>
<xsl:otherwise>
<fo:page-number-citation ref-id="{@linkend}"/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
</fo:inline>
</xsl:when>
<xsl:when test="@pagenum">
<fo:inline keep-together.within-line="always">
<xsl:text> </xsl:text>
<fo:leader leader-pattern="dots"
keep-with-next.within-line="always"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@pagenum"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<!-- just the leaders, what else can I do? -->
<fo:inline keep-together.within-line="always">
<xsl:text> </xsl:text>
<fo:leader leader-pattern="space"
keep-with-next.within-line="always"/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</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/fo/biblio-iso690.xsl
0,0 → 1,1300
<?xml version="1.0" encoding="windows-1250"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version='1.0'>
 
<!-- ********************************************************************
$Id: biblio-iso690.xsl,v 1.1 2008-06-26 19:05:49 gleu Exp $
********************************************************************
 
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 n°) [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:when>
<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'">
<fo:inline text-transform="uppercase">
<xsl:apply-templates mode="iso690.mode" select="$node//surname[1]"/>
</fo:inline>
<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>
<fo:inline text-transform="uppercase">
<xsl:apply-templates mode="iso690.mode" select="$node"/>
</fo:inline>
</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">
<fo:inline font-style="italic">
<xsl:call-template name="iso690.make.title"/>
</fo:inline>
</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>
&