Browse Source

Added new-xsl files.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8196 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia 18 years ago
parent
commit
c873d8072e
100 changed files with 54830 additions and 0 deletions
  1. 53 0
      stylesheets/lfs-xsl/chunk-master.xsl
  2. 69 0
      stylesheets/lfs-xsl/chunk-slave.xsl
  3. 76 0
      stylesheets/lfs-xsl/chunkfast.xsl
  4. 458 0
      stylesheets/lfs-xsl/common.xsl
  5. 47 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/COPYING
  6. 91 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/VERSION
  7. 2028 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/common.xsl
  8. 653 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/de.xml
  9. 1216 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/en.xml
  10. 15 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/entities.ent
  11. 663 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/es.xml
  12. 677 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/fr.xml
  13. 831 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/gentext.xsl
  14. 111 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/insertfile.xsl
  15. 1216 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/it.xml
  16. 63 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/l10n.dtd
  17. 19 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/l10n.xml
  18. 441 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/l10n.xsl
  19. 850 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/labels.xsl
  20. 1149 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/olink.xsl
  21. 211 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/pi.xsl
  22. 1288 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/refentry.xsl
  23. 367 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/stripns.xsl
  24. 155 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/subtitles.xsl
  25. 514 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/table.xsl
  26. 49 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/targetdatabase.dtd
  27. 272 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/targets.xsl
  28. 740 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/titles.xsl
  29. 304 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/utility.xsl
  30. 647 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_cn.xml
  31. 1216 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_tw.xml
  32. 126 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/admon.xsl
  33. 18 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/annotations.xsl
  34. 178 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autoidx-kimber.xsl
  35. 150 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autoidx-kosek.xsl
  36. 20 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autoidx-ng.xsl
  37. 1310 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autoidx.xsl
  38. 855 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autotoc.xsl
  39. 110 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/axf.xsl
  40. 1300 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/biblio-iso690.xsl
  41. 1169 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/biblio.xsl
  42. 600 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/block.xsl
  43. 231 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/callout.xsl
  44. 782 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/component.xsl
  45. 611 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/division.xsl
  46. 331 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/docbook.xsl
  47. 325 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/ebnf.xsl
  48. 154 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/fo-rtf.xsl
  49. 71 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/fo.xsl
  50. 186 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/footnote.xsl
  51. 92 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/fop.xsl
  52. 71 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/fop1.xsl
  53. 534 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/formal.xsl
  54. 1139 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/glossary.xsl
  55. 629 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/graphics.xsl
  56. 57 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/highlight.xsl
  57. 217 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/htmltbl.xsl
  58. 479 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/index.xsl
  59. 34 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/info.xsl
  60. 1234 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/inline.xsl
  61. 21 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/keywords.xsl
  62. 1275 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/lists.xsl
  63. 128 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/math.xsl
  64. 2314 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/pagesetup.xsl
  65. 886 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/param.xsl
  66. 36 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/passivetex.xsl
  67. 140 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/pdf2index
  68. 860 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/pi.xsl
  69. 284 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/profile-docbook.xsl
  70. 76 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/ptc.xsl
  71. 393 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/qandaset.xsl
  72. 637 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/refentry.xsl
  73. 764 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/sections.xsl
  74. 273 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/spaces.xsl
  75. 967 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/synop.xsl
  76. 1549 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/table.xsl
  77. 81 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/task.xsl
  78. 1311 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/titlepage.templates.xml
  79. 5094 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/titlepage.templates.xsl
  80. 738 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/titlepage.xsl
  81. 280 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/toc.xsl
  82. 416 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/verbatim.xsl
  83. 180 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/xep.xsl
  84. 1429 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/xref.xsl
  85. 16 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/highlighting/common.xsl
  86. 439 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/html/chunker.xsl
  87. 542 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/lib/lib.xsl
  88. 239 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/profile-mode.xsl
  89. 49 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/profile.xsl
  90. 27 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/strip-attributes.xsl
  91. 159 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/xsl2profile.xsl
  92. 133 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/admon.xsl
  93. 158 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/annotations.xsl
  94. 139 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx-kimber.xsl
  95. 109 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx-kosek.xsl
  96. 21 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx-ng.xsl
  97. 23 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx.xsl
  98. 625 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autotoc.xsl
  99. 1300 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/biblio-iso690.xsl
  100. 1217 0
      stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/biblio.xsl

+ 53 - 0
stylesheets/lfs-xsl/chunk-master.xsl

@@ -0,0 +1,53 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy$
+$Date$
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+   <!-- Top-level chunked code for normal processing.
+        Import customized output templates.
+        Include customized chunk templates.
+        Replaces {docbook-xsl}/xhtml/chunk.xsl -->
+
+    <!-- Our master non-chunking presentation templates -->
+  <xsl:import href="chunk-slave.xsl"/>
+
+    <!-- Upstream chunk code named templates -->
+  <xsl:import href="docbook-xsl-snapshot/xhtml/chunk-common.xsl"/>
+
+    <!-- Upstream chunk code match templates -->
+  <xsl:include href="docbook-xsl-snapshot/xhtml/chunk-code.xsl"/>
+
+    <!-- Including our customized chunks templates -->
+  <xsl:include href="xhtml/lfs-index.xsl"/>
+  <xsl:include href="xhtml/lfs-legalnotice.xsl"/>
+  <xsl:include href="xhtml/lfs-navigational.xsl"/>
+
+    <!-- sect1:
+           Prevent creation of dummy sect1 files used to emulate sub-chapters. -->
+    <!-- The original template is in {docbook-xsl}/xhtml/chunk-code.xsl
+         It match also others sect* tags. The code for that tags is unchanged. -->
+  <xsl:template match="sect1">
+    <xsl:variable name="ischunk">
+      <xsl:call-template name="chunk"/>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="@role = 'dummy'"/>
+      <xsl:when test="not(parent::*)">
+        <xsl:call-template name="process-chunk-element"/>
+      </xsl:when>
+      <xsl:when test="$ischunk = 0">
+        <xsl:apply-imports/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="process-chunk-element"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>

+ 69 - 0
stylesheets/lfs-xsl/chunk-slave.xsl

@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy$
+$Date$
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+   <!-- Second level chunked output template.
+        Sets global params and include customized elements templates. -->
+
+    <!-- Upstream XHTML presentation templates -->
+  <xsl:import href="docbook-xsl-snapshot/xhtml/docbook.xsl"/>
+
+    <!-- Use ISO-8859-1 for output instead of default UTF-8 -->
+  <xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
+
+    <!-- Including our customized elements templates -->
+  <xsl:include href="common.xsl"/>
+  <xsl:include href="xhtml/lfs-admon.xsl"/>
+  <xsl:include href="xhtml/lfs-mixed.xsl"/>
+  <xsl:include href="xhtml/lfs-sections.xsl"/>
+  <xsl:include href="xhtml/lfs-titles.xsl"/>
+  <xsl:include href="xhtml/lfs-toc.xsl"/>
+  <xsl:include href="xhtml/lfs-xref.xsl"/>
+
+    <!-- The CSS Stylesheets. We set here relative path from sub-dirs HTML files.
+    The path from top-level HTML files (index.html, partX.html, etc) MUST be
+    fixed via a sed in the Makefile-->
+    <!-- Master CSS Stylesheet -->
+  <xsl:param name="html.stylesheet" select="'../stylesheets/lfs.css'"/>
+    <!-- Print CSS Stylesheet -->
+    <!-- The original template is in {docbook-xsl}/xhtml/docbook.xsl -->
+  <xsl:template name='user.head.content'>
+     <link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print"/>
+  </xsl:template>
+
+    <!-- Dropping some unwanted style attributes -->
+  <xsl:param name="ulink.target" select="''"/>
+  <xsl:param name="css.decoration" select="0"/>
+
+    <!-- No XML declaration -->
+  <xsl:param name="chunker.output.omit-xml-declaration" select="'yes'"/>
+
+    <!-- Control generation of ToCs and LoTs -->
+  <xsl:param name="generate.toc">
+    book      toc,title
+    preface   toc
+    part      toc
+    chapter   toc
+    appendix  nop
+    sect1     nop
+    sect2     nop
+    sect3     nop
+    sect4     nop
+    sect5     nop
+    section   nop
+  </xsl:param>
+
+    <!-- How deep should recursive sections appear in the TOC? -->
+  <xsl:param name="toc.section.depth">1</xsl:param>
+
+    <!-- How maximaly deep should be each TOC? -->
+  <xsl:param name="toc.max.depth">3</xsl:param>
+
+</xsl:stylesheet>

+ 76 - 0
stylesheets/lfs-xsl/chunkfast.xsl

@@ -0,0 +1,76 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy$
+$Date$
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:exsl="http://exslt.org/common"
+                xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0"
+                version="1.0"
+                exclude-result-prefixes="cf exsl">
+
+   <!-- Top-level chunked code for fast processing.
+        Import standart customized chunk code.
+        Replaces {docbook-xsl}/xhtml/chunkfast.xsl
+
+        Note: Using this file as the top-level for chunked output implies that
+              profiling must be done on a previous step. -->
+
+    <!-- Our master chunking templates -->
+  <xsl:import href="chunk-master.xsl"/>
+
+    <!-- Use chunk.fast code? 1 = yes, 0 = no -->
+  <xsl:param name="chunk.fast" select="1"/>
+
+  <!-- The code below was copied as-is from {docbook-xsl}/xhtml/chunkfast.xsl -->
+
+  <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
+
+  <xsl:template name="process-chunk-element">
+    <xsl:choose>
+      <xsl:when test="$chunk.fast != 0 and function-available('exsl:node-set')">
+        <xsl:variable name="genid" select="generate-id()"/>
+
+        <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
+
+        <xsl:variable name="prevdiv" select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
+        <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
+
+        <xsl:variable name="nextdiv" select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
+        <xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
+
+        <xsl:choose>
+          <xsl:when test="$onechunk != 0 and parent::*">
+            <xsl:apply-imports/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="process-chunk">
+              <xsl:with-param name="prev" select="$prev"/>
+              <xsl:with-param name="next" select="$next"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="$onechunk != 0 and not(parent::*)">
+            <xsl:call-template name="chunk-all-sections"/>
+          </xsl:when>
+          <xsl:when test="$onechunk != 0">
+            <xsl:apply-imports/>
+          </xsl:when>
+          <xsl:when test="$chunk.first.sections = 0">
+            <xsl:call-template name="chunk-first-section-with-parent"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="chunk-all-sections"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>

+ 458 - 0
stylesheets/lfs-xsl/common.xsl

@@ -0,0 +1,458 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<!--
+$LastChangedBy$
+$Date$
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+  <!-- This stylesheet contains common params and templates for all outputs. -->
+
+    <!-- This file contains our localization strings (for internationalization) -->
+  <xsl:param name="local.l10n.xml" select="document('lfs-l10n.xml')"/>
+
+
+<!-- INDEX -->
+
+    <!-- Should the Index be generated? 1 = yes, 0 = no -->
+  <xsl:param name="generate.index" select="1"></xsl:param>
+
+    <!-- The indexing method used. Only 'basic' is supported by xsltproc -->
+  <xsl:param name="index.method" select="'basic'"></xsl:param>
+
+    <!-- The Index title:
+           We create this param to can have gentext support in both
+           the Index page title and links that point to the Index page.
+           It also allow us to change the title, if wanted.
+           Note: To change the title involves creating the appropiate
+           entries in lfs-l10n.xml -->
+  <xsl:param name="index-title">Index</xsl:param>
+
+    <!-- Index title generation. -->
+    <!-- The original template is in {docbook-xsl}/common/titles.xsl -->
+  <xsl:template match="index" mode="title.markup">
+    <xsl:param name="allow-anchors" select="0"/>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="$index-title"/>
+    </xsl:call-template>
+  </xsl:template>
+
+    <!-- indexterm:
+           Dropping unneeded anchors and fo:wraper elemments. -->
+    <!-- The original templates are in {docbook-xsl}/{xhtml,fo}/index.xsl -->
+  <xsl:template match="indexterm"/>
+
+<!-- -->
+
+<!-- LABELS -->
+
+    <!-- Are sections enumerated? 1 = yes, 0 = no -->
+  <xsl:param name="section.autolabel" select="1"/>
+
+    <!-- Do section labels include the component label? 1 = yes, 0 = no -->
+  <xsl:param name="section.label.includes.component.label" select="1"/>
+
+    <!-- sect1 label.markup:
+           Use lowercase roman numbers for sect1 in preface. -->
+    <!-- The original template is in {docbook-xsl}/common/labels.xsl -->
+  <xsl:template match="sect1" mode="label.markup">
+    <!-- if the parent is a component, maybe label that too -->
+    <xsl:variable name="parent.is.component">
+      <xsl:call-template name="is.component">
+        <xsl:with-param name="node" select=".."/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:variable name="component.label">
+      <xsl:if test="$section.label.includes.component.label != 0
+                    and $parent.is.component != 0">
+        <xsl:variable name="parent.label">
+          <xsl:apply-templates select=".." mode="label.markup"/>
+        </xsl:variable>
+        <xsl:if test="$parent.label != ''">
+          <xsl:apply-templates select=".." mode="label.markup"/>
+          <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+        </xsl:if>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="@label">
+        <xsl:value-of select="@label"/>
+      </xsl:when>
+      <xsl:when test="$section.autolabel != 0">
+        <xsl:copy-of select="$component.label"/>
+        <xsl:choose>
+          <xsl:when test="ancestor::preface">
+            <xsl:number format="i" count="sect1"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:number format="1" count="sect1"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+    <!-- sect2 label.markup:
+           Skip numeration for sect2 with empty title. -->
+    <!-- The original template is in {docbook-xsl}/common/labels.xsl
+         It match also sect3, sect4, and sect5, that are unchanged. -->
+  <xsl:template match="sect2" mode="label.markup">
+      <!-- label the parent -->
+      <xsl:variable name="parent.section.label">
+        <xsl:call-template name="label.this.section">
+          <xsl:with-param name="section" select=".."/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:if test="$parent.section.label != '0'">
+        <xsl:apply-templates select=".." mode="label.markup"/>
+        <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+      </xsl:if>
+      <xsl:choose>
+        <xsl:when test="@label">
+          <xsl:value-of select="@label"/>
+        </xsl:when>
+        <xsl:when test="$section.autolabel != 0">
+          <xsl:choose>
+            <!-- If the first sect2 isn't numbered, renumber the remainig sections -->
+            <xsl:when test="string-length(../sect2[1]/title) = 0">
+              <xsl:variable name="totalsect2">
+                <xsl:number count="sect2"/>
+              </xsl:variable>
+              <xsl:number value="$totalsect2 - 1"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:number count="sect2"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+      </xsl:choose>
+  </xsl:template>
+
+    <!-- object.title.template:
+           Skip numeration for sectX > sect1 in preface. -->
+    <!-- The original template is in {docbook-xsl}/common/gentext.xsl. -->
+  <xsl:template match="section|sect1|sect2|sect3|sect4|sect5|simplesect|bridgehead"
+                mode="object.title.template">
+    <xsl:variable name="is.numbered">
+      <xsl:call-template name="label.this.section"/>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$is.numbered != 0 and not(ancestor::preface/sect1)">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'title-numbered'"/>
+          <xsl:with-param name="name">
+            <xsl:call-template name="xpath.location"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'title-unnumbered'"/>
+          <xsl:with-param name="name">
+            <xsl:call-template name="xpath.location"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<!-- -->
+
+<!-- XREF (see {xhtml,pdf}/xref.xsl) -->
+
+    <!-- mode object.xref.markup:
+           Propagate role to named template substitute-markup -->
+    <!-- The original template is in {docbook-xsl}/common/gentext.xsl -->
+  <xsl:template match="*" mode="object.xref.markup">
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="referrer"/>
+    <xsl:param name="verbose" select="1"/>
+    <xsl:param name="role"/>
+    <xsl:variable name="template">
+      <xsl:choose>
+        <xsl:when test="starts-with(normalize-space($xrefstyle), 'select:')">
+          <xsl:call-template name="make.gentext.template">
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="referrer" select="$referrer"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="starts-with(normalize-space($xrefstyle), 'template:')">
+          <xsl:value-of select="substring-after(normalize-space($xrefstyle), 'template:')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="." mode="object.xref.template">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="referrer" select="$referrer"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:if test="$template = '' and $verbose != 0">
+      <xsl:message>
+        <xsl:text>object.xref.markup: empty xref template</xsl:text>
+        <xsl:text> for linkend="</xsl:text>
+        <xsl:value-of select="@id|@xml:id"/>
+        <xsl:text>" and @xrefstyle="</xsl:text>
+        <xsl:value-of select="$xrefstyle"/>
+        <xsl:text>"</xsl:text>
+      </xsl:message>
+    </xsl:if>
+    <xsl:call-template name="substitute-markup">
+      <xsl:with-param name="purpose" select="$purpose"/>
+      <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+      <xsl:with-param name="referrer" select="$referrer"/>
+      <xsl:with-param name="template" select="$template"/>
+      <xsl:with-param name="verbose" select="$verbose"/>
+      <xsl:with-param name="role" select="$role"/>
+    </xsl:call-template>
+  </xsl:template>
+
+    <!-- substitute-markup:
+           Propagate role to mode insert.title.markup -->
+    <!-- The original template is in {docbook-xsl}/common/gentext.xsl -->
+  <xsl:template name="substitute-markup">
+    <xsl:param name="template" select="''"/>
+    <xsl:param name="allow-anchors" select="'0'"/>
+    <xsl:param name="title" select="''"/>
+    <xsl:param name="subtitle" select="''"/>
+    <xsl:param name="docname" select="''"/>
+    <xsl:param name="label" select="''"/>
+    <xsl:param name="pagenumber" select="''"/>
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="referrer"/>
+    <xsl:param name="verbose"/>
+    <xsl:param name="role"/>
+    <xsl:choose>
+      <xsl:when test="contains($template, '%')">
+        <xsl:value-of select="substring-before($template, '%')"/>
+        <xsl:variable name="candidate"
+                      select="substring(substring-after($template, '%'), 1, 1)"/>
+        <xsl:choose>
+          <xsl:when test="$candidate = 't'">
+            <xsl:apply-templates select="." mode="insert.title.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="role" select="$role"/>
+              <xsl:with-param name="title">
+                <xsl:choose>
+                  <xsl:when test="$title != ''">
+                    <xsl:copy-of select="$title"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="title.markup">
+                      <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+                      <xsl:with-param name="verbose" select="$verbose"/>
+                    </xsl:apply-templates>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 's'">
+            <xsl:apply-templates select="." mode="insert.subtitle.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="subtitle">
+                <xsl:choose>
+                  <xsl:when test="$subtitle != ''">
+                    <xsl:copy-of select="$subtitle"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="subtitle.markup">
+                      <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+                    </xsl:apply-templates>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'n'">
+            <xsl:apply-templates select="." mode="insert.label.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="label">
+                <xsl:choose>
+                  <xsl:when test="$label != ''">
+                    <xsl:copy-of select="$label"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="label.markup"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'p'">
+            <xsl:apply-templates select="." mode="insert.pagenumber.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="pagenumber">
+                <xsl:choose>
+                  <xsl:when test="$pagenumber != ''">
+                    <xsl:copy-of select="$pagenumber"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="pagenumber.markup"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'o'">
+            <!-- olink target document title -->
+            <xsl:apply-templates select="." mode="insert.olink.docname.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="docname">
+                <xsl:choose>
+                  <xsl:when test="$docname != ''">
+                    <xsl:copy-of select="$docname"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="olink.docname.markup"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'd'">
+            <xsl:apply-templates select="." mode="insert.direction.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="direction">
+                <xsl:choose>
+                  <xsl:when test="$referrer">
+                    <xsl:variable name="referent-is-below">
+                      <xsl:for-each select="preceding::xref">
+                        <xsl:if test="generate-id(.) = generate-id($referrer)">1</xsl:if>
+                      </xsl:for-each>
+                    </xsl:variable>
+                    <xsl:choose>
+                      <xsl:when test="$referent-is-below = ''">
+                        <xsl:call-template name="gentext">
+                          <xsl:with-param name="key" select="'above'"/>
+                        </xsl:call-template>
+                      </xsl:when>
+                      <xsl:otherwise>
+                        <xsl:call-template name="gentext">
+                          <xsl:with-param name="key" select="'below'"/>
+                        </xsl:call-template>
+                      </xsl:otherwise>
+                    </xsl:choose>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:message>Attempt to use %d in gentext with no referrer!</xsl:message>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = '%' ">
+            <xsl:text>%</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>%</xsl:text><xsl:value-of select="$candidate"/>
+          </xsl:otherwise>
+        </xsl:choose>
+        <!-- recurse with the rest of the template string -->
+        <xsl:variable name="rest"
+              select="substring($template,
+              string-length(substring-before($template, '%'))+3)"/>
+        <xsl:call-template name="substitute-markup">
+          <xsl:with-param name="template" select="$rest"/>
+          <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+          <xsl:with-param name="title" select="$title"/>
+          <xsl:with-param name="subtitle" select="$subtitle"/>
+          <xsl:with-param name="docname" select="$docname"/>
+          <xsl:with-param name="label" select="$label"/>
+          <xsl:with-param name="pagenumber" select="$pagenumber"/>
+          <xsl:with-param name="purpose" select="$purpose"/>
+          <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+          <xsl:with-param name="referrer" select="$referrer"/>
+          <xsl:with-param name="verbose" select="$verbose"/>
+          <xsl:with-param name="role" select="$role"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$template"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<!-- -->
+
+<!-- Total packages size calculation -->
+
+    <!-- returnvalue:
+            If the tag is not empty, apply the original template.
+            Otherwise apply the calculation template. -->
+  <xsl:template match="returnvalue">
+    <xsl:choose>
+      <xsl:when test="count(*)&gt;0">
+        <xsl:apply-imports/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="calculation">
+          <xsl:with-param name="scope" select="../../variablelist"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+    <!-- Self-made calculation template. -->
+  <xsl:template name="calculation">
+    <xsl:param name="scope"/>
+    <xsl:param name="total">0</xsl:param>
+    <xsl:param name="position">1</xsl:param>
+    <xsl:variable name="tokens" select="count($scope/varlistentry)"/>
+    <xsl:variable name="token" select="$scope/varlistentry[$position]/term/token"/>
+    <xsl:variable name="size" select="substring-before($token,' KB')"/>
+    <xsl:variable name="rawsize">
+      <xsl:choose>
+        <xsl:when test="contains($size,',')">
+          <xsl:value-of select="concat(substring-before($size,','),substring-after($size,','))"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$size"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$position &lt;= $tokens">
+        <xsl:call-template name="calculation">
+          <xsl:with-param name="scope" select="$scope"/>
+          <xsl:with-param name="position" select="$position +1"/>
+          <xsl:with-param name="total" select="$total + $rawsize"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="$total &lt; '1000'">
+            <xsl:value-of select="$total"/>
+            <xsl:text>  KB</xsl:text>
+          </xsl:when>
+          <xsl:when test="$total &gt; '1000' and $total &lt; '5000'">
+            <xsl:value-of select="substring($total,1,1)"/>
+            <xsl:text>,</xsl:text>
+            <xsl:value-of select="substring($total,2)"/>
+            <xsl:text>  KB</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="round($total div 1024)"/>
+            <xsl:text>  MB</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+<!-- -->
+
+</xsl:stylesheet>

+ 47 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/COPYING

@@ -0,0 +1,47 @@
+Copyright
+---------
+Copyright (C) 1999-2007 Norman Walsh
+Copyright (C) 2003 Jiří Kosek
+Copyright (C) 2004-2007 Steve Ball
+Copyright (C) 2005-2007 The DocBook Project
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the ``Software''), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+Except as contained in this notice, the names of individuals
+credited with contribution to this software shall not be used in
+advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization
+from the individuals in question.
+
+Any stylesheet derived from this Software that is publically
+distributed will be identified with a different name and the
+version strings in any derived Software will be changed so that
+no possibility of confusion between the derived package and this
+Software will exist.
+
+Warranty
+--------
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT.  IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER
+CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Contacting the Author
+---------------------
+The DocBook XSL stylesheets are maintained by Norman Walsh,
+<ndw@nwalsh.com>, and members of the DocBook Project,
+<docbook-developers@sf.net>

+ 91 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/VERSION

@@ -0,0 +1,91 @@
+<?xml version='1.0'?> <!-- -*- nxml -*- vim: set foldlevel=2: -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
+  xmlns:sf="http://sourceforge.net/"
+  exclude-result-prefixes="fm sf"
+  version='1.0'>
+
+<xsl:param name="VERSION" select="string(document('')//fm:Version[1])"/>
+<xsl:param name="DistroTitle" select="string(document('')//fm:Branch[1])"/>
+<xsl:param name="DistroName">docbook-xsl</xsl:param>
+<xsl:param name="PreviousRelease">1.72.0</xsl:param>
+<xsl:param name="PreviousReleaseRevision">6553</xsl:param>
+<xsl:param name="Revision">$Revision$</xsl:param>
+<xsl:param name="VersionFileURL">$URL: https://svn.sourceforge.net/svnroot/docbook/trunk/xsl/VERSION $</xsl:param>
+<xsl:param name="sf-relid" select="0"/>
+<xsl:strip-space elements="fm:*"/>
+
+<fm:project>
+  <fm:Project>DocBook</fm:Project>
+  <fm:Branch>XSL Stylesheets</fm:Branch>
+  <fm:Version>snapshot_6933</fm:Version>
+<!--
+  <fm:License>MIT/X Consortium License</fm:License>
+-->
+  <fm:Release-Focus>
+<!-- * Initial freshmeat announcement -->
+<!-- * Documentation -->
+<!-- * Code cleanup -->
+<!-- * Minor feature enhancements -->
+Major feature enhancements
+<!-- * Minor bugfixes -->
+<!-- * Major bugfixes -->
+<!-- * Minor security fixes -->
+<!-- * Major security fixes -->
+  </fm:Release-Focus>
+  <fm:Home-Page-URL>http://sourceforge.net/projects/docbook/</fm:Home-Page-URL>
+  <fm:Gzipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.tar.gz?download</fm:Gzipped-Tar-URL>
+  <fm:Zipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.zip?download</fm:Zipped-Tar-URL>
+  <fm:Bzipped-Tar-URL>http://prdownloads.sourceforge.net/docbook/{DISTRONAME-VERSION}.bz2?download</fm:Bzipped-Tar-URL>
+  <fm:Changelog-URL>http://sourceforge.net/project/shownotes.php?release_id={SFRELID}</fm:Changelog-URL>
+  <fm:CVS-URL>http://docbook.svn.sourceforge.net/viewvc/docbook/</fm:CVS-URL>
+  <fm:Mailing-List-URL>http://lists.oasis-open.org/archives/docbook-apps/</fm:Mailing-List-URL>
+  <fm:Changes>This is a bug-fix release with a few feature enhancements.
+</fm:Changes>
+</fm:project>
+
+<xsl:template match="/" priority="-100">
+  <xsl:if test="$sf-relid = 0">
+    <xsl:message terminate="yes">
+      <xsl:text>You must specify the sf-relid as a parameter.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:apply-templates select="//fm:project"/>
+</xsl:template>
+
+<xsl:template match="fm:project">
+  <xsl:text>&#10;</xsl:text>
+  <xsl:apply-templates/>
+  <xsl:text>&#10;</xsl:text>
+  <xsl:apply-templates select="fm:Changes" mode="text"/>
+</xsl:template>
+
+<xsl:template match="fm:Changes"/>
+
+<xsl:template match="fm:Gzipped-Tar-URL|fm:Zipped-Tar-URL|fm:Bzipped-Tar-URL">
+  <xsl:value-of select="local-name(.)"/>
+  <xsl:text>: </xsl:text>
+  <xsl:value-of select="substring-before(., '{DISTRONAME-VERSION}')"/>
+  <xsl:value-of select="concat($DistroName, '-', $VERSION)"/>
+  <xsl:value-of select="substring-after(., '{DISTRONAME-VERSION}')"/>
+  <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="fm:Changelog-URL">
+  <xsl:value-of select="local-name(.)"/>
+  <xsl:text>: </xsl:text>
+  <xsl:value-of select="substring-before(., '{SFRELID}')"/>
+  <xsl:value-of select="$sf-relid"/>
+  <xsl:value-of select="substring-after(., '{SFRELID}')"/>
+  <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="fm:*">
+  <xsl:value-of select="local-name(.)"/>
+  <xsl:text>: </xsl:text>
+  <xsl:value-of select="normalize-space(.)"/>
+  <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>

+ 2028 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/common.xsl

@@ -0,0 +1,2028 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                xmlns:dyn="http://exslt.org/dynamic"
+                xmlns:saxon="http://icl.com/saxon"
+                exclude-result-prefixes="doc dyn saxon"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     This file contains general templates common to both the HTML and FO
+     versions of the DocBook stylesheets.
+     ******************************************************************** -->
+
+<doc:reference xmlns="">
+<referenceinfo>
+<releaseinfo role="meta">
+$Id$
+</releaseinfo>
+<author><surname>Walsh</surname>
+<firstname>Norman</firstname></author>
+<copyright><year>1999-2007</year>
+<holder>Norman Walsh</holder>
+</copyright>
+</referenceinfo>
+<title>Common Template Reference</title>
+
+<partintro id="partintro">
+<title>Introduction</title>
+
+<para>This is technical reference documentation for the “common”
+templates in the DocBook XSL Stylesheets. The common templates are
+“common” because they are shared across output formats (that is,
+they’re not output-format-dependent).</para>
+
+<para>This documentation is not intended to be <quote>user</quote>
+documentation.  It is provided for developers writing
+customization layers for the stylesheets, and for anyone who's
+interested in <quote>how it works</quote>.</para>
+
+</partintro>
+
+</doc:reference>
+
+<!-- ==================================================================== -->
+<!-- Establish strip/preserve whitespace rules -->
+
+<xsl:preserve-space elements="*"/>
+
+<xsl:strip-space elements="
+abstract affiliation anchor answer appendix area areaset areaspec
+artheader article audiodata audioobject author authorblurb authorgroup
+beginpage bibliodiv biblioentry bibliography biblioset blockquote book
+bookbiblio bookinfo callout calloutlist caption caution chapter
+citerefentry cmdsynopsis co collab colophon colspec confgroup
+copyright dedication docinfo editor entrytbl epigraph equation
+example figure footnote footnoteref formalpara funcprototype
+funcsynopsis glossary glossdef glossdiv glossentry glosslist graphicco
+group highlights imagedata imageobject imageobjectco important index
+indexdiv indexentry indexterm info informalequation informalexample
+informalfigure informaltable inlineequation inlinemediaobject
+itemizedlist itermset keycombo keywordset legalnotice listitem lot
+mediaobject mediaobjectco menuchoice msg msgentry msgexplan msginfo
+msgmain msgrel msgset msgsub msgtext note objectinfo
+orderedlist othercredit part partintro preface printhistory procedure
+programlistingco publisher qandadiv qandaentry qandaset question
+refentry reference refmeta refnamediv refsection refsect1 refsect1info refsect2
+refsect2info refsect3 refsect3info refsynopsisdiv refsynopsisdivinfo
+revhistory revision row sbr screenco screenshot sect1 sect1info sect2
+sect2info sect3 sect3info sect4 sect4info sect5 sect5info section
+sectioninfo seglistitem segmentedlist seriesinfo set setindex setinfo
+shortcut sidebar simplelist simplesect spanspec step subject
+subjectset substeps synopfragment table tbody textobject tfoot tgroup
+thead tip toc tocchap toclevel1 toclevel2 toclevel3 toclevel4
+toclevel5 tocpart varargs variablelist varlistentry videodata
+videoobject void warning subjectset
+
+classsynopsis
+constructorsynopsis
+destructorsynopsis
+fieldsynopsis
+methodparam
+methodsynopsis
+ooclass
+ooexception
+oointerface
+simplemsgentry
+manvolnum
+"/>
+<!-- ====================================================================== -->
+
+<doc:template name="is.component" xmlns="">
+<refpurpose>Tests if a given node is a component-level element</refpurpose>
+
+<refdescription id="is.component-desc">
+<para>This template returns '1' if the specified node is a component
+(Chapter, Appendix, etc.), and '0' otherwise.</para>
+</refdescription>
+
+<refparameter id="is.component-params">
+<variablelist>
+<varlistentry><term>node</term>
+<listitem>
+<para>The node which is to be tested.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn id="is.component-returns">
+<para>This template returns '1' if the specified node is a component
+(Chapter, Appendix, etc.), and '0' otherwise.</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="is.component">
+  <xsl:param name="node" select="."/>
+  <xsl:choose>
+    <xsl:when test="local-name($node) = 'appendix'
+                    or local-name($node) = 'article'
+                    or local-name($node) = 'chapter'
+                    or local-name($node) = 'preface'
+                    or local-name($node) = 'bibliography'
+                    or local-name($node) = 'glossary'
+                    or local-name($node) = 'index'">1</xsl:when>
+    <xsl:otherwise>0</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<doc:template name="is.section" xmlns="">
+<refpurpose>Tests if a given node is a section-level element</refpurpose>
+
+<refdescription id="is.section-desc">
+<para>This template returns '1' if the specified node is a section
+(Section, Sect1, Sect2, etc.), and '0' otherwise.</para>
+</refdescription>
+
+<refparameter id="is.section-params">
+<variablelist>
+<varlistentry><term>node</term>
+<listitem>
+<para>The node which is to be tested.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn id="is.section-returns">
+<para>This template returns '1' if the specified node is a section
+(Section, Sect1, Sect2, etc.), and '0' otherwise.</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="is.section">
+  <xsl:param name="node" select="."/>
+  <xsl:choose>
+    <xsl:when test="local-name($node) = 'section'
+                    or local-name($node) = 'sect1'
+                    or local-name($node) = 'sect2'
+                    or local-name($node) = 'sect3'
+                    or local-name($node) = 'sect4'
+                    or local-name($node) = 'sect5'
+                    or local-name($node) = 'refsect1'
+                    or local-name($node) = 'refsect2'
+                    or local-name($node) = 'refsect3'
+                    or local-name($node) = 'simplesect'">1</xsl:when>
+    <xsl:otherwise>0</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<doc:template name="section.level" xmlns="">
+<refpurpose>Returns the hierarchical level of a section</refpurpose>
+
+<refdescription id="section.level-desc">
+<para>This template calculates the hierarchical level of a section.
+The element <sgmltag>sect1</sgmltag> is at level 1, <sgmltag>sect2</sgmltag> is
+at level 2, etc.</para>
+
+<para>Recursive sections are calculated down to the fifth level.</para>
+</refdescription>
+
+<refparameter id="section.level-params">
+<variablelist>
+<varlistentry><term>node</term>
+<listitem>
+<para>The section node for which the level should be calculated.
+Defaults to the context node.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn id="section.level-returns">
+<para>The section level, <quote>1</quote>, <quote>2</quote>, etc.
+</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="section.level">
+  <xsl:param name="node" select="."/>
+  <xsl:choose>
+    <xsl:when test="local-name($node)='sect1'">1</xsl:when>
+    <xsl:when test="local-name($node)='sect2'">2</xsl:when>
+    <xsl:when test="local-name($node)='sect3'">3</xsl:when>
+    <xsl:when test="local-name($node)='sect4'">4</xsl:when>
+    <xsl:when test="local-name($node)='sect5'">5</xsl:when>
+    <xsl:when test="local-name($node)='section'">
+      <xsl:choose>
+        <xsl:when test="$node/../../../../../../section">6</xsl:when>
+        <xsl:when test="$node/../../../../../section">5</xsl:when>
+        <xsl:when test="$node/../../../../section">4</xsl:when>
+        <xsl:when test="$node/../../../section">3</xsl:when>
+        <xsl:when test="$node/../../section">2</xsl:when>
+        <xsl:otherwise>1</xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="local-name($node)='refsect1' or
+                    local-name($node)='refsect2' or
+                    local-name($node)='refsect3' or
+                    local-name($node)='refsection' or
+                    local-name($node)='refsynopsisdiv'">
+      <xsl:call-template name="refentry.section.level">
+        <xsl:with-param name="node" select="$node"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="local-name($node)='simplesect'">
+      <xsl:choose>
+        <xsl:when test="$node/../../sect1">2</xsl:when>
+        <xsl:when test="$node/../../sect2">3</xsl:when>
+        <xsl:when test="$node/../../sect3">4</xsl:when>
+        <xsl:when test="$node/../../sect4">5</xsl:when>
+        <xsl:when test="$node/../../sect5">5</xsl:when>
+        <xsl:when test="$node/../../section">
+          <xsl:choose>
+            <xsl:when test="$node/../../../../../section">5</xsl:when>
+            <xsl:when test="$node/../../../../section">4</xsl:when>
+            <xsl:when test="$node/../../../section">3</xsl:when>
+            <xsl:otherwise>2</xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>1</xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>1</xsl:otherwise>
+  </xsl:choose>
+</xsl:template><!-- section.level -->
+
+<doc:template name="qanda.section.level" xmlns="">
+<refpurpose>Returns the hierarchical level of a QandASet</refpurpose>
+
+<refdescription id="qanda.section.level-desc">
+<para>This template calculates the hierarchical level of a QandASet.
+</para>
+</refdescription>
+
+<refreturn id="qanda.section.level-returns">
+<para>The level, <quote>1</quote>, <quote>2</quote>, etc.
+</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="qanda.section.level">
+  <xsl:variable name="section"
+                select="(ancestor::section
+                         |ancestor::simplesect
+                         |ancestor::sect5
+                         |ancestor::sect4
+                         |ancestor::sect3
+                         |ancestor::sect2
+                         |ancestor::sect1
+                         |ancestor::refsect3
+                         |ancestor::refsect2
+                         |ancestor::refsect1)[last()]"/>
+
+  <xsl:choose>
+    <xsl:when test="count($section) = '0'">1</xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="slevel">
+        <xsl:call-template name="section.level">
+          <xsl:with-param name="node" select="$section"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:value-of select="$slevel + 1"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- Finds the total section depth of a section in a refentry -->
+<xsl:template name="refentry.section.level">
+  <xsl:param name="node" select="."/>
+
+  <xsl:variable name="RElevel">
+    <xsl:call-template name="refentry.level">
+      <xsl:with-param name="node" select="$node/ancestor::refentry[1]"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="levelinRE">
+    <xsl:choose>
+      <xsl:when test="local-name($node)='refsynopsisdiv'">1</xsl:when>
+      <xsl:when test="local-name($node)='refsect1'">1</xsl:when>
+      <xsl:when test="local-name($node)='refsect2'">2</xsl:when>
+      <xsl:when test="local-name($node)='refsect3'">3</xsl:when>
+      <xsl:when test="local-name($node)='refsection'">
+        <xsl:choose>
+          <xsl:when test="$node/../../../../../refsection">5</xsl:when>
+          <xsl:when test="$node/../../../../refsection">4</xsl:when>
+          <xsl:when test="$node/../../../refsection">3</xsl:when>
+          <xsl:when test="$node/../../refsection">2</xsl:when>
+          <xsl:otherwise>1</xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:value-of select="$levelinRE + $RElevel"/>
+</xsl:template>
+
+<!-- Finds the section depth of a refentry -->
+<xsl:template name="refentry.level">
+  <xsl:param name="node" select="."/>
+  <xsl:variable name="container"
+                select="($node/ancestor::section |
+                        $node/ancestor::sect1 |
+                        $node/ancestor::sect2 |
+                        $node/ancestor::sect3 |
+                        $node/ancestor::sect4 |
+                        $node/ancestor::sect5)[last()]"/>
+
+  <xsl:choose>
+    <xsl:when test="$container">
+      <xsl:variable name="slevel">
+        <xsl:call-template name="section.level">
+          <xsl:with-param name="node" select="$container"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:value-of select="$slevel + 1"/>
+    </xsl:when>
+    <xsl:otherwise>1</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="qandadiv.section.level">
+  <xsl:variable name="section.level">
+    <xsl:call-template name="qanda.section.level"/>
+  </xsl:variable>
+  <xsl:variable name="anc.divs" select="ancestor::qandadiv"/>
+
+  <xsl:value-of select="count($anc.divs) + number($section.level)"/>
+</xsl:template>
+
+<xsl:template name="question.answer.label">
+  <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="label" select="@label"/>
+
+<!--
+ (hnr      (hierarchical-number-recursive (normalize "qandadiv") node))
+
+         (parsect  (ancestor-member node (section-element-list)))
+
+         (defnum   (if (and %qanda-inherit-numeration% 
+                            %section-autolabel%)
+                       (if (node-list-empty? parsect)
+                           (section-autolabel-prefix node)
+                           (section-autolabel parsect))
+                       ""))
+
+         (hnumber  (let loop ((numlist hnr) (number defnum) 
+                              (sep (if (equal? defnum "") "" ".")))
+                     (if (null? numlist)
+                         number
+                         (loop (cdr numlist) 
+                               (string-append number
+                                              sep
+                                              (number->string (car numlist)))
+                               "."))))
+         (cnumber  (child-number (parent node)))
+         (number   (string-append hnumber 
+                                  (if (equal? hnumber "")
+                                      ""
+                                      ".")
+                                  (number->string cnumber))))
+-->
+
+  <xsl:choose>
+    <xsl:when test="$deflabel = 'qanda'">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key">
+          <xsl:choose>
+            <xsl:when test="local-name(.) = 'question'">question</xsl:when>
+            <xsl:when test="local-name(.) = 'answer'">answer</xsl:when>
+            <xsl:when test="local-name(.) = 'qandadiv'">qandadiv</xsl:when>
+            <xsl:otherwise>qandaset</xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$deflabel = 'label'">
+      <xsl:value-of select="$label"/>
+    </xsl:when>
+    <xsl:when test="$deflabel = 'number'
+                    and local-name(.) = 'question'">
+      <xsl:apply-templates select="ancestor::qandaset[1]"
+                           mode="number"/>
+      <xsl:choose>
+        <xsl:when test="ancestor::qandadiv">
+          <xsl:apply-templates select="ancestor::qandadiv[1]"
+                               mode="number"/>
+          <xsl:apply-templates select="ancestor::qandaentry"
+                               mode="number"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="ancestor::qandaentry"
+                               mode="number"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- nothing -->
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="qandaset" mode="number">
+  <!-- FIXME: -->
+</xsl:template>
+
+<xsl:template match="qandadiv" mode="number">
+  <xsl:number level="multiple" from="qandaset" format="1."/>
+</xsl:template>
+
+<xsl:template match="qandaentry" mode="number">
+  <xsl:choose>
+    <xsl:when test="ancestor::qandadiv">
+      <xsl:number level="single" from="qandadiv" format="1."/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:number level="single" from="qandaset" format="1."/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<xsl:template name="object.id">
+  <xsl:param name="object" select="."/>
+  <xsl:choose>
+    <xsl:when test="$object/@id">
+      <xsl:value-of select="$object/@id"/>
+    </xsl:when>
+    <xsl:when test="$object/@xml:id">
+      <xsl:value-of select="$object/@xml:id"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="generate-id($object)"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="person.name">
+  <!-- Formats a personal name. Handles corpauthor as a special case. -->
+  <xsl:param name="node" select="."/>
+
+  <xsl:variable name="style">
+    <xsl:choose>
+      <xsl:when test="$node/@role">
+        <xsl:value-of select="$node/@role"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'styles'"/>
+          <xsl:with-param name="name" select="'person-name'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <!-- the personname element is a specialcase -->
+    <xsl:when test="$node/personname">
+      <xsl:call-template name="person.name">
+        <xsl:with-param name="node" select="$node/personname"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <!-- handle corpauthor as a special case...-->
+    <!-- * MikeSmith 2007-06: I'm wondering if the person.name template -->
+    <!-- * actually ever gets called to handle corpauthor.. maybe -->
+    <!-- * we don't actually need to check for corpauthor here. -->
+    <xsl:when test="local-name($node)='corpauthor'">
+      <xsl:apply-templates select="$node"/>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:choose>
+        <!-- Handle case when personname contains only general markup (DocBook 5.0) -->
+        <xsl:when test="$node/self::personname and not($node/firstname or $node/honorific or $node/lineage or $node/othername or $node/surname)">
+          <xsl:apply-templates select="$node/node()"/>
+        </xsl:when>
+        <xsl:when test="$style = 'family-given'">
+          <xsl:call-template name="person.name.family-given">
+            <xsl:with-param name="node" select="$node"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="$style = 'last-first'">
+          <xsl:call-template name="person.name.last-first">
+            <xsl:with-param name="node" select="$node"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="person.name.first-last">
+            <xsl:with-param name="node" select="$node"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="person.name.family-given">
+  <xsl:param name="node" select="."/>
+
+  <!-- The family-given style applies a convention for identifying given -->
+  <!-- and family names in locales where it may be ambiguous -->
+  <xsl:apply-templates select="$node//surname[1]"/>
+
+  <xsl:if test="$node//surname and $node//firstname">
+    <xsl:text> </xsl:text>
+  </xsl:if>
+
+  <xsl:apply-templates select="$node//firstname[1]"/>
+
+  <xsl:text> [FAMILY Given]</xsl:text>
+</xsl:template>
+
+<xsl:template name="person.name.last-first">
+  <xsl:param name="node" select="."/>
+
+  <xsl:apply-templates select="$node//surname[1]"/>
+
+  <xsl:if test="$node//surname and $node//firstname">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+
+  <xsl:apply-templates select="$node//firstname[1]"/>
+</xsl:template>
+
+<xsl:template name="person.name.first-last">
+  <xsl:param name="node" select="."/>
+
+  <xsl:if test="$node//honorific">
+    <xsl:apply-templates select="$node//honorific[1]"/>
+    <xsl:value-of select="$punct.honorific"/>
+  </xsl:if>
+
+  <xsl:if test="$node//firstname">
+    <xsl:if test="$node//honorific">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates select="$node//firstname[1]"/>
+  </xsl:if>
+
+  <xsl:if test="$node//othername and $author.othername.in.middle != 0">
+    <xsl:if test="$node//honorific or $node//firstname">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates select="$node//othername[1]"/>
+  </xsl:if>
+
+  <xsl:if test="$node//surname">
+    <xsl:if test="$node//honorific or $node//firstname
+                  or ($node//othername and $author.othername.in.middle != 0)">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates select="$node//surname[1]"/>
+  </xsl:if>
+
+  <xsl:if test="$node//lineage">
+    <xsl:text>, </xsl:text>
+    <xsl:apply-templates select="$node//lineage[1]"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="person.name.list">
+  <!-- Return a formatted string representation of the contents of
+       the current element. The current element must contain one or
+       more AUTHORs, CORPAUTHORs, OTHERCREDITs, and/or EDITORs.
+
+       John Doe
+     or
+       John Doe and Jane Doe
+     or
+       John Doe, Jane Doe, and A. Nonymous
+  -->
+  <xsl:param name="person.list"
+             select="author|corpauthor|othercredit|editor"/>
+  <xsl:param name="person.count" select="count($person.list)"/>
+  <xsl:param name="count" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="$count &gt; $person.count"></xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="person.name">
+        <xsl:with-param name="node" select="$person.list[position()=$count]"/>
+      </xsl:call-template>
+
+      <xsl:choose>
+        <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">
+          <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">
+          <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:choose>
+
+      <xsl:call-template name="person.name.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:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template><!-- person.name.list -->
+
+<!-- === synopsis ======================================================= -->
+<!-- The following definitions match those given in the reference
+     documentation for DocBook V3.0
+-->
+
+<xsl:variable name="arg.choice.opt.open.str">[</xsl:variable>
+<xsl:variable name="arg.choice.opt.close.str">]</xsl:variable>
+<xsl:variable name="arg.choice.req.open.str">{</xsl:variable>
+<xsl:variable name="arg.choice.req.close.str">}</xsl:variable>
+<xsl:variable name="arg.choice.plain.open.str"><xsl:text> </xsl:text></xsl:variable>
+<xsl:variable name="arg.choice.plain.close.str"><xsl:text> </xsl:text></xsl:variable>
+<xsl:variable name="arg.choice.def.open.str">[</xsl:variable>
+<xsl:variable name="arg.choice.def.close.str">]</xsl:variable>
+<xsl:variable name="arg.rep.repeat.str">...</xsl:variable>
+<xsl:variable name="arg.rep.norepeat.str"></xsl:variable>
+<xsl:variable name="arg.rep.def.str"></xsl:variable>
+<xsl:variable name="arg.or.sep"> | </xsl:variable>
+<xsl:variable name="cmdsynopsis.hanging.indent">4pi</xsl:variable>
+
+<!-- ====================================================================== -->
+
+<!--
+<xsl:template name="xref.g.subst">
+  <xsl:param name="string"></xsl:param>
+  <xsl:param name="target" select="."/>
+  <xsl:variable name="subst">%g</xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="contains($string, $subst)">
+      <xsl:value-of select="substring-before($string, $subst)"/>
+      <xsl:call-template name="gentext.element.name">
+        <xsl:with-param name="element.name" select="local-name($target)"/>
+      </xsl:call-template>
+      <xsl:call-template name="xref.g.subst">
+        <xsl:with-param name="string"
+                        select="substring-after($string, $subst)"/>
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$string"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="xref.t.subst">
+  <xsl:param name="string"></xsl:param>
+  <xsl:param name="target" select="."/>
+  <xsl:variable name="subst">%t</xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="contains($string, $subst)">
+      <xsl:call-template name="xref.g.subst">
+        <xsl:with-param name="string"
+                        select="substring-before($string, $subst)"/>
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+      <xsl:call-template name="title.xref">
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+      <xsl:call-template name="xref.t.subst">
+        <xsl:with-param name="string"
+                        select="substring-after($string, $subst)"/>
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="xref.g.subst">
+        <xsl:with-param name="string" select="$string"/>
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="xref.n.subst">
+  <xsl:param name="string"></xsl:param>
+  <xsl:param name="target" select="."/>
+  <xsl:variable name="subst">%n</xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="contains($string, $subst)">
+      <xsl:call-template name="xref.t.subst">
+        <xsl:with-param name="string"
+                        select="substring-before($string, $subst)"/>
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+      <xsl:call-template name="number.xref">
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+      <xsl:call-template name="xref.t.subst">
+        <xsl:with-param name="string"
+                        select="substring-after($string, $subst)"/>
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="xref.t.subst">
+        <xsl:with-param name="string" select="$string"/>
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="subst.xref.text">
+  <xsl:param name="xref.text"></xsl:param>
+  <xsl:param name="target" select="."/>
+
+  <xsl:call-template name="xref.n.subst">
+    <xsl:with-param name="string" select="$xref.text"/>
+    <xsl:with-param name="target" select="$target"/>
+  </xsl:call-template>
+</xsl:template>
+-->
+
+<!-- ====================================================================== -->
+
+<xsl:template name="filename-basename">
+  <!-- We assume all filenames are really URIs and use "/" -->
+  <xsl:param name="filename"></xsl:param>
+  <xsl:param name="recurse" select="false()"/>
+
+  <xsl:choose>
+    <xsl:when test="substring-after($filename, '/') != ''">
+      <xsl:call-template name="filename-basename">
+        <xsl:with-param name="filename"
+                        select="substring-after($filename, '/')"/>
+        <xsl:with-param name="recurse" select="true()"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$filename"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="filename-extension">
+  <xsl:param name="filename"></xsl:param>
+  <xsl:param name="recurse" select="false()"/>
+
+  <!-- Make sure we only look at the base name... -->
+  <xsl:variable name="basefn">
+    <xsl:choose>
+      <xsl:when test="$recurse">
+        <xsl:value-of select="$filename"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="filename-basename">
+          <xsl:with-param name="filename" select="$filename"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="substring-after($basefn, '.') != ''">
+      <xsl:call-template name="filename-extension">
+        <xsl:with-param name="filename"
+                        select="substring-after($basefn, '.')"/>
+        <xsl:with-param name="recurse" select="true()"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$recurse">
+      <xsl:value-of select="$basefn"/>
+    </xsl:when>
+    <xsl:otherwise></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<doc:template name="select.mediaobject" xmlns="">
+<refpurpose>Selects and processes an appropriate media object from a list</refpurpose>
+
+<refdescription id="select.mediaobject-desc">
+<para>This template takes a list of media objects (usually the
+children of a mediaobject or inlinemediaobject) and processes
+the "right" object.</para>
+
+<para>This template relies on a template named 
+"select.mediaobject.index" to determine which object
+in the list is appropriate.</para>
+
+<para>If no acceptable object is located, nothing happens.</para>
+</refdescription>
+
+<refparameter id="select.mediaobject-params">
+<variablelist>
+<varlistentry><term>olist</term>
+<listitem>
+<para>The node list of potential objects to examine.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn id="select.mediaobject-returns">
+<para>Calls &lt;xsl:apply-templates&gt; on the selected object.</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="select.mediaobject">
+  <xsl:param name="olist"
+             select="imageobject|imageobjectco
+                     |videoobject|audioobject|textobject"/>
+  
+  <xsl:variable name="mediaobject.index">
+    <xsl:call-template name="select.mediaobject.index">
+      <xsl:with-param name="olist" select="$olist"/>
+      <xsl:with-param name="count" select="1"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:if test="$mediaobject.index != ''">
+    <xsl:apply-templates select="$olist[position() = $mediaobject.index]"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<doc:template name="select.mediaobject.index" xmlns="">
+<refpurpose>Selects the position of the appropriate media object from a list</refpurpose>
+
+<refdescription id="select.mediaobject.index-desc">
+<para>This template takes a list of media objects (usually the
+children of a mediaobject or inlinemediaobject) and determines
+the "right" object. It returns the position of that object
+to be used by the calling template.</para>
+
+<para>If the parameter <parameter>use.role.for.mediaobject</parameter>
+is nonzero, then it first checks for an object with
+a role attribute of the appropriate value.  It takes the first
+of those.  Otherwise, it takes the first acceptable object
+through a recursive pass through the list.</para>
+
+<para>This template relies on a template named "is.acceptable.mediaobject"
+to determine if a given object is an acceptable graphic. The semantics
+of media objects is that the first acceptable graphic should be used.
+</para>
+
+<para>If no acceptable object is located, no index is returned.</para>
+</refdescription>
+
+<refparameter id="select.mediaobject.index-params">
+<variablelist>
+<varlistentry><term>olist</term>
+<listitem>
+<para>The node list of potential objects to examine.</para>
+</listitem>
+</varlistentry>
+<varlistentry><term>count</term>
+<listitem>
+<para>The position in the list currently being considered by the 
+recursive process.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn id="select.mediaobject.index-returns">
+<para>Returns the position in the original list of the selected object.</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="select.mediaobject.index">
+  <xsl:param name="olist"
+             select="imageobject|imageobjectco
+                     |videoobject|audioobject|textobject"/>
+  <xsl:param name="count">1</xsl:param>
+
+  <xsl:choose>
+    <!-- Test for objects preferred by role -->
+    <xsl:when test="$use.role.for.mediaobject != 0 
+               and $preferred.mediaobject.role != ''
+               and $olist[@role = $preferred.mediaobject.role]"> 
+      
+      <!-- Get the first hit's position index -->
+      <xsl:for-each select="$olist">
+        <xsl:if test="@role = $preferred.mediaobject.role and
+             not(preceding-sibling::*[@role = $preferred.mediaobject.role])"> 
+          <xsl:value-of select="position()"/> 
+        </xsl:if>
+      </xsl:for-each>
+    </xsl:when>
+
+    <xsl:when test="$use.role.for.mediaobject != 0 
+               and $olist[@role = $stylesheet.result.type]">
+      <!-- Get the first hit's position index -->
+      <xsl:for-each select="$olist">
+        <xsl:if test="@role = $stylesheet.result.type and 
+              not(preceding-sibling::*[@role = $stylesheet.result.type])"> 
+          <xsl:value-of select="position()"/> 
+        </xsl:if>
+      </xsl:for-each>
+    </xsl:when>
+    <!-- Accept 'html' for $stylesheet.result.type = 'xhtml' -->
+    <xsl:when test="$use.role.for.mediaobject != 0 
+               and $stylesheet.result.type = 'xhtml'
+               and $olist[@role = 'html']">
+      <!-- Get the first hit's position index -->
+      <xsl:for-each select="$olist">
+        <xsl:if test="@role = 'html' and 
+              not(preceding-sibling::*[@role = 'html'])"> 
+          <xsl:value-of select="position()"/> 
+        </xsl:if>
+      </xsl:for-each>
+    </xsl:when>
+
+    <!-- If no selection by role, and there is only one object, use it -->
+    <xsl:when test="count($olist) = 1 and $count = 1">
+      <xsl:value-of select="$count"/> 
+    </xsl:when>
+
+    <xsl:otherwise>
+      <!-- Otherwise select first acceptable object -->
+      <xsl:if test="$count &lt;= count($olist)">
+        <xsl:variable name="object" select="$olist[position()=$count]"/>
+    
+        <xsl:variable name="useobject">
+          <xsl:choose>
+            <!-- The phrase is used only when contains TeX Math and output is FO -->
+            <xsl:when test="local-name($object)='textobject' and $object/phrase
+                            and $object/@role='tex' and $stylesheet.result.type = 'fo'
+                            and $tex.math.in.alt != ''">
+              <xsl:text>1</xsl:text> 
+            </xsl:when>
+            <!-- The phrase is never used -->
+            <xsl:when test="local-name($object)='textobject' and $object/phrase">
+              <xsl:text>0</xsl:text>
+            </xsl:when>
+            <xsl:when test="local-name($object)='textobject'
+                            and $object/ancestor::equation ">
+            <!-- The first textobject is not a reasonable fallback
+                 for equation image -->
+              <xsl:text>0</xsl:text>
+            </xsl:when>
+            <!-- The first textobject is a reasonable fallback -->
+            <xsl:when test="local-name($object)='textobject'
+                            and $object[not(@role) or @role!='tex']">
+              <xsl:text>1</xsl:text>
+            </xsl:when>
+            <!-- don't use graphic when output is FO, TeX Math is used 
+                 and there is math in alt element -->
+            <xsl:when test="$object/ancestor::equation and 
+                            $object/ancestor::equation/alt[@role='tex']
+                            and $stylesheet.result.type = 'fo'
+                            and $tex.math.in.alt != ''">
+              <xsl:text>0</xsl:text>
+            </xsl:when>
+            <!-- If there's only one object, use it -->
+            <xsl:when test="$count = 1 and count($olist) = 1">
+               <xsl:text>1</xsl:text>
+            </xsl:when>
+            <!-- Otherwise, see if this one is a useable graphic -->
+            <xsl:otherwise>
+              <xsl:choose>
+                <!-- peek inside imageobjectco to simplify the test -->
+                <xsl:when test="local-name($object) = 'imageobjectco'">
+                  <xsl:call-template name="is.acceptable.mediaobject">
+                    <xsl:with-param name="object" select="$object/imageobject"/>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:call-template name="is.acceptable.mediaobject">
+                    <xsl:with-param name="object" select="$object"/>
+                  </xsl:call-template>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+    
+        <xsl:choose>
+          <xsl:when test="$useobject='1'">
+            <xsl:value-of select="$count"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="select.mediaobject.index">
+              <xsl:with-param name="olist" select="$olist"/>
+              <xsl:with-param name="count" select="$count + 1"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<doc:template name="is.acceptable.mediaobject" xmlns="">
+<refpurpose>Returns '1' if the specified media object is recognized</refpurpose>
+
+<refdescription id="is.acceptable.mediaobject-desc">
+<para>This template examines a media object and returns '1' if the
+object is recognized as a graphic.</para>
+</refdescription>
+
+<refparameter id="is.acceptable.mediaobject-params">
+<variablelist>
+<varlistentry><term>object</term>
+<listitem>
+<para>The media object to consider.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn id="is.acceptable.mediaobject-returns">
+<para>0 or 1</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="is.acceptable.mediaobject">
+  <xsl:param name="object"></xsl:param>
+
+  <xsl:variable name="filename">
+    <xsl:call-template name="mediaobject.filename">
+      <xsl:with-param name="object" select="$object"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="ext">
+    <xsl:call-template name="filename-extension">
+      <xsl:with-param name="filename" select="$filename"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <!-- there will only be one -->
+  <xsl:variable name="data" select="$object/videodata
+                                    |$object/imagedata
+                                    |$object/audiodata"/>
+
+  <xsl:variable name="format" select="$data/@format"/>
+
+  <xsl:variable name="graphic.format">
+    <xsl:if test="$format">
+      <xsl:call-template name="is.graphic.format">
+        <xsl:with-param name="format" select="$format"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="graphic.ext">
+    <xsl:if test="$ext">
+      <xsl:call-template name="is.graphic.extension">
+        <xsl:with-param name="ext" select="$ext"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$use.svg = 0 and $format = 'SVG'">0</xsl:when>
+    <xsl:when xmlns:svg="http://www.w3.org/2000/svg"
+              test="$use.svg != 0 and $object/svg:*">1</xsl:when>
+    <xsl:when test="$graphic.format = '1'">1</xsl:when>
+    <xsl:when test="$graphic.ext = '1'">1</xsl:when>
+    <xsl:otherwise>0</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="mediaobject.filename">
+  <xsl:param name="object"></xsl:param>
+
+  <xsl:variable name="data" select="$object/videodata
+                                    |$object/imagedata
+                                    |$object/audiodata
+                                    |$object"/>
+
+  <xsl:variable name="filename">
+    <xsl:choose>
+      <xsl:when test="$data[@fileref]">
+        <xsl:apply-templates select="$data/@fileref"/>
+      </xsl:when>
+      <xsl:when test="$data[@entityref]">
+        <xsl:value-of select="unparsed-entity-uri($data/@entityref)"/>
+      </xsl:when>
+      <xsl:otherwise></xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="real.ext">
+    <xsl:call-template name="filename-extension">
+      <xsl:with-param name="filename" select="$filename"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="ext">
+    <xsl:choose>
+      <xsl:when test="$real.ext != ''">
+        <xsl:value-of select="$real.ext"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$graphic.default.extension"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="graphic.ext">
+    <xsl:call-template name="is.graphic.extension">
+      <xsl:with-param name="ext" select="$ext"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$real.ext = ''">
+      <xsl:choose>
+        <xsl:when test="$ext != ''">
+          <xsl:value-of select="$filename"/>
+          <xsl:text>.</xsl:text>
+          <xsl:value-of select="$ext"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$filename"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="not($graphic.ext)">
+      <xsl:choose>
+        <xsl:when test="$graphic.default.extension != ''">
+          <xsl:value-of select="$filename"/>
+          <xsl:text>.</xsl:text>
+          <xsl:value-of select="$graphic.default.extension"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$filename"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$filename"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<doc:template name="check.id.unique" xmlns="">
+<refpurpose>Warn users about references to non-unique IDs</refpurpose>
+<refdescription id="check.id.unique-desc">
+<para>If passed an ID in <varname>linkend</varname>,
+<function>check.id.unique</function> prints
+a warning message to the user if either the ID does not exist or
+the ID is not unique.</para>
+</refdescription>
+</doc:template>
+
+<xsl:template name="check.id.unique">
+  <xsl:param name="linkend"></xsl:param>
+  <xsl:if test="$linkend != ''">
+    <xsl:variable name="targets" select="key('id',$linkend)"/>
+    <xsl:variable name="target" select="$targets[1]"/>
+
+    <xsl:if test="count($targets)=0">
+      <xsl:message>
+        <xsl:text>Error: no ID for constraint linkend: </xsl:text>
+        <xsl:value-of select="$linkend"/>
+        <xsl:text>.</xsl:text>
+      </xsl:message>
+      <!--
+      <xsl:message>
+        <xsl:text>If the ID exists in your document, did your </xsl:text>
+        <xsl:text>XSLT Processor load the DTD?</xsl:text>
+      </xsl:message>
+      -->
+    </xsl:if>
+
+    <xsl:if test="count($targets)>1">
+      <xsl:message>
+        <xsl:text>Warning: multiple "IDs" for constraint linkend: </xsl:text>
+        <xsl:value-of select="$linkend"/>
+        <xsl:text>.</xsl:text>
+      </xsl:message>
+    </xsl:if>
+  </xsl:if>
+</xsl:template>
+
+<doc:template name="check.idref.targets" xmlns="">
+<refpurpose>Warn users about incorrectly typed references</refpurpose>
+<refdescription id="check.idref.targets-desc">
+<para>If passed an ID in <varname>linkend</varname>,
+<function>check.idref.targets</function> makes sure that the element
+pointed to by the link is one of the elements listed in
+<varname>element-list</varname> and warns the user otherwise.</para>
+</refdescription>
+</doc:template>
+
+<xsl:template name="check.idref.targets">
+  <xsl:param name="linkend"></xsl:param>
+  <xsl:param name="element-list"></xsl:param>
+  <xsl:if test="$linkend != ''">
+    <xsl:variable name="targets" select="key('id',$linkend)"/>
+    <xsl:variable name="target" select="$targets[1]"/>
+
+    <xsl:if test="count($target) &gt; 0">
+      <xsl:if test="not(contains(concat(' ', $element-list, ' '), local-name($target)))">
+        <xsl:message>
+          <xsl:text>Error: linkend (</xsl:text>
+          <xsl:value-of select="$linkend"/>
+          <xsl:text>) points to "</xsl:text>
+          <xsl:value-of select="local-name($target)"/>
+          <xsl:text>" not (one of): </xsl:text>
+          <xsl:value-of select="$element-list"/>
+        </xsl:message>
+      </xsl:if>
+    </xsl:if>
+  </xsl:if>
+</xsl:template>
+
+<!-- ====================================================================== -->
+<!-- Procedure Step Numeration -->
+
+<xsl:param name="procedure.step.numeration.formats" select="'1aiAI'"/>
+
+<xsl:template name="procedure.step.numeration">
+  <xsl:param name="context" select="."/>
+  <xsl:variable name="format.length"
+                select="string-length($procedure.step.numeration.formats)"/>
+  <xsl:choose>
+    <xsl:when test="local-name($context) = 'substeps'">
+      <xsl:variable name="ssdepth"
+                    select="count($context/ancestor::substeps)"/>
+      <xsl:variable name="sstype" select="($ssdepth mod $format.length)+2"/>
+      <xsl:choose>
+        <xsl:when test="$sstype &gt; $format.length">
+          <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="substring($procedure.step.numeration.formats,$sstype,1)"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="local-name($context) = 'step'">
+      <xsl:variable name="sdepth"
+                    select="count($context/ancestor::substeps)"/>
+      <xsl:variable name="stype" select="($sdepth mod $format.length)+1"/>
+      <xsl:value-of select="substring($procedure.step.numeration.formats,$stype,1)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>Unexpected context in procedure.step.numeration: </xsl:text>
+        <xsl:value-of select="local-name($context)"/>
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="step" mode="number">
+  <xsl:param name="rest" select="''"/>
+  <xsl:param name="recursive" select="1"/>
+  <xsl:variable name="format">
+    <xsl:call-template name="procedure.step.numeration"/>
+  </xsl:variable>
+  <xsl:variable name="num">
+    <xsl:number count="step" format="{$format}"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$recursive != 0 and ancestor::step">
+      <xsl:apply-templates select="ancestor::step[1]" mode="number">
+        <xsl:with-param name="rest" select="concat('.', $num, $rest)"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="concat($num, $rest)"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+<!-- OrderedList Numeration -->
+
+<xsl:template name="orderedlist-starting-number">
+  <xsl:param name="list" select="."/>
+
+  <!-- Need a neutral dbxxx -->
+  <xsl:variable name="pi-html-start">
+    <xsl:call-template name="pi-attribute">
+      <xsl:with-param name="pis"
+                      select="$list/processing-instruction('dbhtml')"/>
+      <xsl:with-param name="attribute" select="'start'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="pi-fo-start">
+    <xsl:call-template name="pi-attribute">
+      <xsl:with-param name="pis"
+                      select="$list/processing-instruction('dbfo')"/>
+      <xsl:with-param name="attribute" select="'start'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="not($list/@continuation = 'continues')">
+      <xsl:choose>
+        <xsl:when test="@startingnumber">
+          <xsl:value-of select="@startingnumber"/>
+        </xsl:when>
+        <xsl:when test="$pi-html-start != ''">
+          <xsl:value-of select="$pi-html-start"/>
+        </xsl:when>
+        <xsl:when test="$pi-fo-start != ''">
+          <xsl:value-of select="$pi-fo-start"/>
+        </xsl:when>
+        <xsl:otherwise>1</xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="prevlist"
+                    select="$list/preceding::orderedlist[1]"/>
+      <xsl:choose>
+        <xsl:when test="count($prevlist) = 0">2</xsl:when>
+        <xsl:otherwise>
+          <xsl:variable name="prevlength" select="count($prevlist/listitem)"/>
+          <xsl:variable name="prevstart">
+            <xsl:call-template name="orderedlist-starting-number">
+              <xsl:with-param name="list" select="$prevlist"/>
+            </xsl:call-template>
+          </xsl:variable>
+          <xsl:value-of select="$prevstart + $prevlength"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="orderedlist-item-number">
+  <!-- context node must be a listitem in an orderedlist -->
+  <xsl:param name="node" select="."/>
+
+  <xsl:choose>
+    <xsl:when test="$node/@override">
+      <xsl:value-of select="$node/@override"/>
+    </xsl:when>
+    <xsl:when test="$node/preceding-sibling::listitem">
+      <xsl:variable name="pnum">
+        <xsl:call-template name="orderedlist-item-number">
+          <xsl:with-param name="node" select="$node/preceding-sibling::listitem[1]"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:value-of select="$pnum + 1"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="orderedlist-starting-number">
+        <xsl:with-param name="list" select="parent::*"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="next.numeration">
+  <xsl:param name="numeration" select="'default'"/>
+  <xsl:choose>
+    <!-- Change this list if you want to change the order of numerations -->
+    <xsl:when test="$numeration = 'arabic'">loweralpha</xsl:when>
+    <xsl:when test="$numeration = 'loweralpha'">lowerroman</xsl:when>
+    <xsl:when test="$numeration = 'lowerroman'">upperalpha</xsl:when>
+    <xsl:when test="$numeration = 'upperalpha'">upperroman</xsl:when>
+    <xsl:when test="$numeration = 'upperroman'">arabic</xsl:when>
+    <xsl:otherwise>arabic</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="list.numeration">
+  <xsl:param name="node" select="."/>
+
+  <xsl:choose>
+    <xsl:when test="$node/@numeration">
+      <xsl:value-of select="$node/@numeration"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$node/ancestor::orderedlist">
+          <xsl:call-template name="next.numeration">
+            <xsl:with-param name="numeration">
+              <xsl:call-template name="list.numeration">
+                <xsl:with-param name="node" select="$node/ancestor::orderedlist[1]"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="next.numeration"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+<!-- ItemizedList "Numeration" -->
+
+<xsl:template name="next.itemsymbol">
+  <xsl:param name="itemsymbol" select="'default'"/>
+  <xsl:choose>
+    <!-- Change this list if you want to change the order of symbols -->
+    <xsl:when test="$itemsymbol = 'disc'">circle</xsl:when>
+    <xsl:when test="$itemsymbol = 'circle'">square</xsl:when>
+    <xsl:otherwise>disc</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="list.itemsymbol">
+  <xsl:param name="node" select="."/>
+
+  <xsl:choose>
+    <xsl:when test="@override">
+      <xsl:value-of select="@override"/>
+    </xsl:when>
+    <xsl:when test="$node/@mark">
+      <xsl:value-of select="$node/@mark"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$node/ancestor::itemizedlist">
+          <xsl:call-template name="next.itemsymbol">
+            <xsl:with-param name="itemsymbol">
+              <xsl:call-template name="list.itemsymbol">
+                <xsl:with-param name="node" select="$node/ancestor::itemizedlist[1]"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="next.itemsymbol"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<doc:template name="copyright.years" xmlns="">
+<refpurpose>Print a set of years with collapsed ranges</refpurpose>
+
+<refdescription id="copyright.years-desc">
+<para>This template prints a list of year elements with consecutive
+years printed as a range. In other words:</para>
+
+<screen><![CDATA[<year>1992</year>
+<year>1993</year>
+<year>1994</year>]]></screen>
+
+<para>is printed <quote>1992-1994</quote>, whereas:</para>
+
+<screen><![CDATA[<year>1992</year>
+<year>1994</year>]]></screen>
+
+<para>is printed <quote>1992, 1994</quote>.</para>
+
+<para>This template assumes that all the year elements contain only
+decimal year numbers, that the elements are sorted in increasing
+numerical order, that there are no duplicates, and that all the years
+are expressed in full <quote>century+year</quote>
+(<quote>1999</quote> not <quote>99</quote>) notation.</para>
+</refdescription>
+
+<refparameter id="copyright.years-params">
+<variablelist>
+<varlistentry><term>years</term>
+<listitem>
+<para>The initial set of year elements.</para>
+</listitem>
+</varlistentry>
+<varlistentry><term>print.ranges</term>
+<listitem>
+<para>If non-zero, multi-year ranges are collapsed. If zero, all years
+are printed discretely.</para>
+</listitem>
+</varlistentry>
+<varlistentry><term>single.year.ranges</term>
+<listitem>
+<para>If non-zero, two consecutive years will be printed as a range,
+otherwise, they will be printed discretely. In other words, a single
+year range is <quote>1991-1992</quote> but discretely it's
+<quote>1991, 1992</quote>.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn id="copyright.years-returns">
+<para>This template returns the formatted list of years.</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="copyright.years">
+  <xsl:param name="years"/>
+  <xsl:param name="print.ranges" select="1"/>
+  <xsl:param name="single.year.ranges" select="0"/>
+  <xsl:param name="firstyear" select="0"/>
+  <xsl:param name="nextyear" select="0"/>
+
+  <!--
+  <xsl:message terminate="no">
+    <xsl:text>CY: </xsl:text>
+    <xsl:value-of select="count($years)"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$firstyear"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$nextyear"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$print.ranges"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$single.year.ranges"/>
+    <xsl:text> (</xsl:text>
+    <xsl:value-of select="$years[1]"/>
+    <xsl:text>)</xsl:text>
+  </xsl:message>
+  -->
+
+  <xsl:choose>
+    <xsl:when test="$print.ranges = 0 and count($years) &gt; 0">
+      <xsl:choose>
+        <xsl:when test="count($years) = 1">
+          <xsl:apply-templates select="$years[1]" mode="titlepage.mode"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="$years[1]" mode="titlepage.mode"/>
+          <xsl:text>, </xsl:text>
+          <xsl:call-template name="copyright.years">
+            <xsl:with-param name="years"
+                            select="$years[position() &gt; 1]"/>
+            <xsl:with-param name="print.ranges" select="$print.ranges"/>
+            <xsl:with-param name="single.year.ranges"
+                            select="$single.year.ranges"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="count($years) = 0">
+      <xsl:variable name="lastyear" select="$nextyear - 1"/>
+      <xsl:choose>
+        <xsl:when test="$firstyear = 0">
+          <!-- there weren't any years at all -->
+        </xsl:when>
+        <xsl:when test="$firstyear = $lastyear">
+          <xsl:value-of select="$firstyear"/>
+        </xsl:when>
+        <xsl:when test="$single.year.ranges = 0
+                        and $lastyear = $firstyear + 1">
+          <xsl:value-of select="$firstyear"/>
+          <xsl:text>, </xsl:text>
+          <xsl:value-of select="$lastyear"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$firstyear"/>
+          <xsl:text>-</xsl:text>
+          <xsl:value-of select="$lastyear"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="$firstyear = 0">
+      <xsl:call-template name="copyright.years">
+        <xsl:with-param name="years"
+                        select="$years[position() &gt; 1]"/>
+        <xsl:with-param name="firstyear" select="$years[1]"/>
+        <xsl:with-param name="nextyear" select="$years[1] + 1"/>
+        <xsl:with-param name="print.ranges" select="$print.ranges"/>
+        <xsl:with-param name="single.year.ranges"
+                        select="$single.year.ranges"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$nextyear = $years[1]">
+      <xsl:call-template name="copyright.years">
+        <xsl:with-param name="years"
+                        select="$years[position() &gt; 1]"/>
+        <xsl:with-param name="firstyear" select="$firstyear"/>
+        <xsl:with-param name="nextyear" select="$nextyear + 1"/>
+        <xsl:with-param name="print.ranges" select="$print.ranges"/>
+        <xsl:with-param name="single.year.ranges"
+                        select="$single.year.ranges"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- we have years left, but they aren't in the current range -->
+      <xsl:choose>
+        <xsl:when test="$nextyear = $firstyear + 1">
+          <xsl:value-of select="$firstyear"/>
+          <xsl:text>, </xsl:text>
+        </xsl:when>
+        <xsl:when test="$single.year.ranges = 0
+                        and $nextyear = $firstyear + 2">
+          <xsl:value-of select="$firstyear"/>
+          <xsl:text>, </xsl:text>
+          <xsl:value-of select="$nextyear - 1"/>
+          <xsl:text>, </xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$firstyear"/>
+          <xsl:text>-</xsl:text>
+          <xsl:value-of select="$nextyear - 1"/>
+          <xsl:text>, </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:call-template name="copyright.years">
+        <xsl:with-param name="years"
+                        select="$years[position() &gt; 1]"/>
+        <xsl:with-param name="firstyear" select="$years[1]"/>
+        <xsl:with-param name="nextyear" select="$years[1] + 1"/>
+        <xsl:with-param name="print.ranges" select="$print.ranges"/>
+        <xsl:with-param name="single.year.ranges"
+                        select="$single.year.ranges"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<doc:template name="find.path.params" xmlns="">
+<refpurpose>Search in a table for the "best" match for the node</refpurpose>
+
+<refdescription id="find.path.params-desc">
+<para>This template searches in a table for the value that most-closely
+(in the typical best-match sense of XSLT) matches the current (element)
+node location.</para>
+</refdescription>
+</doc:template>
+
+<xsl:template name="find.path.params">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="table" select="''"/>
+  <xsl:param name="location">
+    <xsl:call-template name="xpath.location">
+      <xsl:with-param name="node" select="$node"/>
+    </xsl:call-template>
+  </xsl:param>
+
+  <xsl:variable name="value">
+    <xsl:call-template name="lookup.key">
+      <xsl:with-param name="key" select="$location"/>
+      <xsl:with-param name="table" select="$table"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$value != ''">
+      <xsl:value-of select="$value"/>
+    </xsl:when>
+    <xsl:when test="contains($location, '/')">
+      <xsl:call-template name="find.path.params">
+        <xsl:with-param name="node" select="$node"/>
+        <xsl:with-param name="table" select="$table"/>
+        <xsl:with-param name="location" select="substring-after($location, '/')"/>
+      </xsl:call-template>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="relative-uri">
+  <xsl:param name="filename" select="."/>
+  <xsl:param name="destdir" select="''"/>
+  
+  <xsl:variable name="srcurl">
+    <xsl:call-template name="strippath">
+      <xsl:with-param name="filename">
+        <xsl:call-template name="xml.base.dirs">
+          <xsl:with-param name="base.elem" 
+                          select="$filename/ancestor-or-self::*
+                                   [@xml:base != ''][1]"/>
+        </xsl:call-template>
+        <xsl:value-of select="$filename"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="srcurl.trimmed">
+    <xsl:call-template name="trim.common.uri.paths">
+      <xsl:with-param name="uriA" select="$srcurl"/>
+      <xsl:with-param name="uriB" select="$destdir"/>
+      <xsl:with-param name="return" select="'A'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="destdir.trimmed">
+    <xsl:call-template name="trim.common.uri.paths">
+      <xsl:with-param name="uriA" select="$srcurl"/>
+      <xsl:with-param name="uriB" select="$destdir"/>
+      <xsl:with-param name="return" select="'B'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="depth">
+    <xsl:call-template name="count.uri.path.depth">
+      <xsl:with-param name="filename" select="$destdir.trimmed"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:call-template name="copy-string">
+    <xsl:with-param name="string" select="'../'"/>
+    <xsl:with-param name="count" select="$depth"/>
+  </xsl:call-template>
+  <xsl:value-of select="$srcurl.trimmed"/>
+
+</xsl:template>
+
+<!-- ===================================== -->
+
+<xsl:template name="xml.base.dirs">
+  <xsl:param name="base.elem" select="NONODE"/>
+
+  <!-- Recursively resolve xml:base attributes, up to a 
+       full path with : in uri -->
+  <xsl:if test="$base.elem/ancestor::*[@xml:base != ''] and
+                not(contains($base.elem/@xml:base, ':'))">
+    <xsl:call-template name="xml.base.dirs">
+      <xsl:with-param name="base.elem" 
+                      select="$base.elem/ancestor::*[@xml:base != ''][1]"/>
+    </xsl:call-template>
+  </xsl:if>
+  <xsl:call-template name="getdir">
+    <xsl:with-param name="filename" select="$base.elem/@xml:base"/>
+  </xsl:call-template>
+
+</xsl:template>
+
+<!-- ===================================== -->
+
+<xsl:template name="strippath">
+  <xsl:param name="filename" select="''"/>
+  <xsl:choose>
+    <!-- Leading .. are not eliminated -->
+    <xsl:when test="starts-with($filename, '../')">
+      <xsl:value-of select="'../'"/>
+      <xsl:call-template name="strippath">
+        <xsl:with-param name="filename" select="substring-after($filename, '../')"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="contains($filename, '/../')">
+      <xsl:call-template name="strippath">
+        <xsl:with-param name="filename">
+          <xsl:call-template name="getdir">
+            <xsl:with-param name="filename" select="substring-before($filename, '/../')"/>
+          </xsl:call-template>
+          <xsl:value-of select="substring-after($filename, '/../')"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$filename"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ===================================== -->
+
+<xsl:template name="getdir">
+  <xsl:param name="filename" select="''"/>
+  <xsl:if test="contains($filename, '/')">
+    <xsl:value-of select="substring-before($filename, '/')"/>
+    <xsl:text>/</xsl:text>
+    <xsl:call-template name="getdir">
+      <xsl:with-param name="filename" select="substring-after($filename, '/')"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<!-- ===================================== -->
+
+<doc:template name="string.upper" xmlns="">
+<refpurpose>Converts a string to all uppercase letters</refpurpose>
+
+<refdescription id="string.upper-desc">
+<para>Given a string, this template does a language-aware conversion
+of that string to all uppercase letters, based on the values of the
+<literal>lowercase.alpha</literal> and
+<literal>uppercase.alpha</literal> gentext keys for the current
+locale. It affects only those characters found in the values of
+<literal>lowercase.alpha</literal> and
+<literal>uppercase.alpha</literal>. All other characters are left
+unchanged.</para>
+</refdescription>
+
+<refparameter id="string.upper-params">
+<variablelist>
+<varlistentry><term>string</term>
+<listitem>
+<para>The string to convert to uppercase.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+</doc:template>
+<xsl:template name="string.upper">
+  <xsl:param name="string" select="''"/>
+  <xsl:variable name="lowercase.alpha">
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'lowercase.alpha'"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="uppercase.alpha">
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'uppercase.alpha'"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:value-of select="translate($string,$lowercase.alpha,$uppercase.alpha)"/>
+</xsl:template>
+
+<!-- ===================================== -->
+
+<doc:template name="string.lower" xmlns="">
+<refpurpose>Converts a string to all lowercase letters</refpurpose>
+
+<refdescription id="string.lower-desc">
+<para>Given a string, this template does a language-aware conversion
+of that string to all lowercase letters, based on the values of the
+<literal>uppercase.alpha</literal> and
+<literal>lowercase.alpha</literal> gentext keys for the current
+locale. It affects only those characters found in the values of
+<literal>uppercase.alpha</literal> and
+<literal>lowercase.alpha</literal>. All other characters are left
+unchanged.</para>
+</refdescription>
+
+<refparameter id="string.lower-params">
+<variablelist>
+<varlistentry><term>string</term>
+<listitem>
+<para>The string to convert to lowercase.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+</doc:template>
+<xsl:template name="string.lower">
+  <xsl:param name="string" select="''"/>
+  <xsl:variable name="uppercase.alpha">
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'uppercase.alpha'"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="lowercase.alpha">
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'lowercase.alpha'"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:value-of select="translate($string,$uppercase.alpha,$lowercase.alpha)"/>
+</xsl:template>
+
+<!-- ===================================== -->
+
+<doc:template name="select.choice.separator" xmlns="">
+  <refpurpose>Returns localized choice separator</refpurpose>
+  <refdescription id="select.choice.separator-desc">
+    <para>This template enables auto-generation of an appropriate
+    localized "choice" separator (for example, "and" or "or") before
+    the final item in an inline list (though it could also be useful
+    for generating choice separators for non-inline lists).</para>
+
+    <para>It currently works by evaluating a processing instruction
+    (PI) of the form &lt;?dbchoice&#xa0;choice="foo"?> :
+
+    <itemizedlist>
+      <listitem>
+        <simpara>if the value of the <sgmltag>choice</sgmltag>
+        pseudo-attribute is "and" or "or", returns a localized "and"
+        or "or"</simpara>
+      </listitem>
+      <listitem>
+        <simpara>otherwise returns the literal value of the
+        <sgmltag>choice</sgmltag> pseudo-attribute</simpara>
+      </listitem>
+    </itemizedlist>
+
+    The latter is provided only as a temporary workaround because the
+    locale files do not currently have translations for the word
+    <wordasword>or</wordasword>. So if you want to generate a a
+    logical "or" separator in French (for example), you currently need
+    to do this:
+
+    <literallayout>&lt;?dbchoice choice="ou"?></literallayout>
+    </para>
+
+    <warning>
+      <para>The <sgmltag>dbchoice</sgmltag> processing instruction is
+      an unfortunate hack; support for it may disappear in the future
+      (particularly if and when a more appropriate means for marking
+      up "choice" lists becomes available in DocBook).</para>
+    </warning>
+  </refdescription>
+</doc:template>
+<xsl:template name="select.choice.separator">
+  
+  <xsl:variable name="choice">
+    <xsl:call-template name="pi-attribute">
+      <xsl:with-param name="pis" select="processing-instruction('dbchoice')"/>
+      <xsl:with-param name="attribute">choice</xsl:with-param>
+    </xsl:call-template>
+  </xsl:variable>
+  
+  <xsl:choose>
+    <!-- if value of $choice is "and" or "or", translate to equivalent in -->
+    <!-- current locale -->
+    <xsl:when test="$choice = 'and' or $choice = 'or'">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="$choice"/>
+      </xsl:call-template>
+    </xsl:when>
+    <!--  otherwise, just output value of $choice, whatever it is -->
+    <xsl:otherwise>
+      <xsl:value-of select="$choice"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ===================================== -->
+
+<doc:template name="evaluate.info.profile" xmlns="">
+  <refpurpose>Evaluates an info profile</refpurpose>
+  <refdescription id="evaluate.info.profile-desc">
+    <para>This template evaluates an "info profile" matching the XPath
+    expression given by the <parameter>profile</parameter>
+    parameter. It relies on the XSLT <function>evaluate()</function>
+    extension function.</para>
+
+    <para>The value of the <parameter>profile</parameter> parameter
+    can include the literal string <literal>$info</literal>. If found
+    in the value of the <parameter>profile</parameter> parameter, the
+    literal string <literal>$info</literal> string is replaced with
+    the value of the <parameter>info</parameter> parameter, which
+    should be a set of <replaceable>*info</replaceable> nodes; the
+    expression is then evaluated using the XSLT
+    <function>evaluate()</function> extension function.</para>
+  </refdescription>
+  <refparameter id="evaluate.info.profile-params">
+    <variablelist>
+       <varlistentry>
+        <term>profile</term>
+        <listitem>
+          <para>A string representing an XPath expression </para>
+        </listitem>
+      </varlistentry>
+       <varlistentry>
+        <term>info</term>
+        <listitem>
+          <para>A set of *info nodes</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+
+  <refreturn id="evaluate.info.profile-returns">
+    <para>Returns a node (the result of evaluating the
+    <parameter>profile</parameter> parameter)</para>
+  </refreturn>
+</doc:template>
+  <xsl:template name="evaluate.info.profile">
+    <xsl:param name="profile"/>
+    <xsl:param name="info"/>
+    <xsl:choose>
+      <!-- * xsltproc and Xalan both support dyn:evaluate() -->
+      <xsl:when test="function-available('dyn:evaluate')">
+        <xsl:apply-templates
+            select="dyn:evaluate($profile)" mode="get.refentry.metadata"/>
+      </xsl:when>
+      <!-- * Saxon has its own evaluate() & doesn't support dyn:evaluate() -->
+      <xsl:when test="function-available('saxon:evaluate')">
+        <xsl:apply-templates
+            select="saxon:evaluate($profile)" mode="get.refentry.metadata"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message terminate="yes">
+Error: The "info profiling" mechanism currently requires an XSLT
+engine that supports the evaluate() XSLT extension function. Your XSLT
+engine does not support it.
+</xsl:message>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>

+ 653 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/de.xml

@@ -0,0 +1,653 @@
+<?xml version="1.0" encoding="utf-8"?>
+<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="de" english-language-name="German">
+
+<!-- * This file is generated automatically. -->
+<!-- * To submit changes to this file upstream (to the DocBook Project) -->
+<!-- * do not submit an edited version of this file. Instead, submit an -->
+<!-- * edited version of the source file at the following location: -->
+<!-- * -->
+<!-- *  https://svn.sourceforge.net/svnroot/docbook/trunk/gentext/locale/de.xml -->
+<!-- * -->
+<!-- * E-mail the edited de.xml source file to: -->
+<!-- * -->
+<!-- *  docbook-developers@lists.sourceforge.net -->
+
+<!-- ******************************************************************** -->
+
+<!-- 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. -->
+
+<!-- ******************************************************************** -->
+
+<l:gentext key="Abstract" text="Zusammenfassung"/>
+<l:gentext key="abstract" text="Zusammenfassung"/>
+<l:gentext key="Answer" text="A:"/>
+<l:gentext key="answer" text="A:"/>
+<l:gentext key="Appendix" text="Anhang"/>
+<l:gentext key="appendix" text="Anhang"/>
+<l:gentext key="Article" text="Artikel"/>
+<l:gentext key="article" text="Artikel"/>
+<l:gentext key="Author" text="Autor"/>
+<l:gentext key="Bibliography" text="Literaturverzeichnis"/>
+<l:gentext key="bibliography" text="Literaturverzeichnis"/>
+<l:gentext key="Book" text="Buch"/>
+<l:gentext key="book" text="Buch"/>
+<l:gentext key="CAUTION" text="ACHTUNG"/>
+<l:gentext key="Caution" text="Achtung"/>
+<l:gentext key="caution" text="Achtung"/>
+<l:gentext key="Chapter" text="Kapitel"/>
+<l:gentext key="chapter" text="Kapitel"/>
+<l:gentext key="Colophon" text="Kolophon"/>
+<l:gentext key="colophon" text="Kolophon"/>
+<l:gentext key="Copyright" text="Copyright"/>
+<l:gentext key="copyright" text="Copyright"/>
+<l:gentext key="Dedication" text="Widmung"/>
+<l:gentext key="dedication" text="Widmung"/>
+<l:gentext key="Edition" text="Ausgabe"/>
+<l:gentext key="edition" text="Ausgabe"/>
+<l:gentext key="Editor" text="Editor" lang="en"/>
+<l:gentext key="Equation" text="Gleichung"/>
+<l:gentext key="equation" text="Gleichung"/>
+<l:gentext key="Example" text="Beispiel"/>
+<l:gentext key="example" text="Beispiel"/>
+<l:gentext key="Figure" text="Abbildung"/>
+<l:gentext key="figure" text="Abbildung"/>
+<l:gentext key="Glossary" text="Glossar"/>
+<l:gentext key="glossary" text="Glossar"/>
+<l:gentext key="GlossSee" text="Siehe"/>
+<l:gentext key="glosssee" text="Siehe"/>
+<l:gentext key="GlossSeeAlso" text="Siehe auch"/>
+<l:gentext key="glossseealso" text="Siehe auch"/>
+<l:gentext key="IMPORTANT" text="WICHTIG"/>
+<l:gentext key="important" text="Wichtig"/>
+<l:gentext key="Important" text="Wichtig"/>
+<l:gentext key="Index" text="Stichwortverzeichnis"/>
+<l:gentext key="index" text="Stichwortverzeichnis"/>
+<l:gentext key="ISBN" text="ISBN"/>
+<l:gentext key="isbn" text="ISBN"/>
+<l:gentext key="LegalNotice" text="Rechtlicher Hinweis"/>
+<l:gentext key="legalnotice" text="Rechtlicher Hinweis"/>
+<l:gentext key="MsgAud" text="Zielgruppe"/>
+<l:gentext key="msgaud" text="Zielgruppe"/>
+<l:gentext key="MsgLevel" text="Dringlichkeit"/>
+<l:gentext key="msglevel" text="Dringlichkeit"/>
+<l:gentext key="MsgOrig" text="Ursprung"/>
+<l:gentext key="msgorig" text="Ursprung"/>
+<l:gentext key="NOTE" text="ANMERKUNG"/>
+<l:gentext key="Note" text="Anmerkung"/>
+<l:gentext key="note" text="Anmerkung"/>
+<l:gentext key="Part" text="Teil"/>
+<l:gentext key="part" text="Teil"/>
+<l:gentext key="Preface" text="Vorwort"/>
+<l:gentext key="preface" text="Vorwort"/>
+<l:gentext key="Procedure" text="Prozedur"/>
+<l:gentext key="procedure" text="Prozedur"/>
+<l:gentext key="ProductionSet" text="Produktion"/>
+<l:gentext key="PubDate" text="Veröffentlicht"/>
+<l:gentext key="pubdate" text="Veröffentlicht"/>
+<l:gentext key="Published" text="Veröffentlicht"/>
+<l:gentext key="published" text="Veröffentlicht"/>
+<l:gentext key="Publisher" text="Publisher" lang="en"/>
+<l:gentext key="Qandadiv" text="F &amp; A"/>
+<l:gentext key="qandadiv" text="F &amp; A"/>
+<l:gentext key="QandASet" text="Frequently Asked Questions" lang="en"/>
+<l:gentext key="Question" text="F:"/>
+<l:gentext key="question" text="F:"/>
+<l:gentext key="RefEntry" text=""/>
+<l:gentext key="refentry" text=""/>
+<l:gentext key="Reference" text="Verweis"/>
+<l:gentext key="reference" text="Verweis"/>
+<l:gentext key="References" text="References" lang="en"/>
+<l:gentext key="RefName" text="Name"/>
+<l:gentext key="refname" text="Name"/>
+<l:gentext key="RefSection" text="Abschnitt"/>
+<l:gentext key="refsection" text="Abschnitt"/>
+<l:gentext key="RefSynopsisDiv" text="Synopsis"/>
+<l:gentext key="refsynopsisdiv" text="Synopsis"/>
+<l:gentext key="RevHistory" text="Versionsgeschichte"/>
+<l:gentext key="revhistory" text="Versionsgeschichte"/>
+<l:gentext key="revision" text="Version"/>
+<l:gentext key="Revision" text="Version"/>
+<l:gentext key="sect1" text="Abschnitt"/>
+<l:gentext key="sect2" text="Abschnitt"/>
+<l:gentext key="sect3" text="Abschnitt"/>
+<l:gentext key="sect4" text="Abschnitt"/>
+<l:gentext key="sect5" text="Abschnitt"/>
+<l:gentext key="section" text="Abschnitt"/>
+<l:gentext key="Section" text="Abschnitt"/>
+<l:gentext key="see" text="Siehe"/>
+<l:gentext key="See" text="Siehe"/>
+<l:gentext key="seealso" text="Siehe auch"/>
+<l:gentext key="Seealso" text="Siehe auch"/>
+<l:gentext key="SeeAlso" text="Siehe auch"/>
+<l:gentext key="set" text="Satz"/>
+<l:gentext key="Set" text="Satz"/>
+<l:gentext key="setindex" text="Stichwortverzeichnis"/>
+<l:gentext key="SetIndex" text="Stichwortverzeichnis"/>
+<l:gentext key="Sidebar" text="Randnotiz"/>
+<l:gentext key="sidebar" text="randnotiz"/>
+<l:gentext key="step" text="Schritt"/>
+<l:gentext key="Step" text="Schritt"/>
+<l:gentext key="table" text="Tabelle"/>
+<l:gentext key="Table" text="Tabelle"/>
+<l:gentext key="task" text="Task" lang="en"/>
+<l:gentext key="Task" text="Task" lang="en"/>
+<l:gentext key="tip" text="Tipp"/>
+<l:gentext key="TIP" text="TIPP"/>
+<l:gentext key="Tip" text="Tipp"/>
+<l:gentext key="Warning" text="Warnung"/>
+<l:gentext key="warning" text="Warnung"/>
+<l:gentext key="WARNING" text="WARNUNG"/>
+<l:gentext key="and" text="und"/>
+<l:gentext key="by" text="von"/>
+<l:gentext key="Edited" text="Herausgegeben"/>
+<l:gentext key="edited" text="Herausgegeben"/>
+<l:gentext key="Editedby" text="Herausgegeben von"/>
+<l:gentext key="editedby" text="Herausgegeben von"/>
+<l:gentext key="in" text="in"/>
+<l:gentext key="lastlistcomma" text=""/>
+<l:gentext key="listcomma" text=","/>
+<l:gentext key="nonexistantelement" text="nicht existierendes Element"/>
+<l:gentext key="notes" text="Fußnoten"/>
+<l:gentext key="Notes" text="Fußnoten"/>
+<l:gentext key="Pgs" text="Seiten"/>
+<l:gentext key="pgs" text="Seiten"/>
+<l:gentext key="Revisedby" text="Geändert durch: "/>
+<l:gentext key="revisedby" text="Geändert durch: "/>
+<l:gentext key="TableNotes" text="Bemerkungen"/>
+<l:gentext key="tablenotes" text="Bemerkungen"/>
+<l:gentext key="TableofContents" text="Inhaltsverzeichnis"/>
+<l:gentext key="tableofcontents" text="Inhaltsverzeichnis"/>
+<l:gentext key="unexpectedelementname" text="Unerwarteter Elementname"/>
+<l:gentext key="unsupported" text="wird nicht unterstützt"/>
+<l:gentext key="xrefto" text="xref auf"/>
+<l:gentext key="Authors" text="Authors" lang="en"/>
+<l:gentext key="copyeditor" text="Copy Editor" lang="en"/>
+<l:gentext key="graphicdesigner" text="Graphic Designer" lang="en"/>
+<l:gentext key="productioneditor" text="Production Editor" lang="en"/>
+<l:gentext key="technicaleditor" text="Technical Editor" lang="en"/>
+<l:gentext key="translator" text="Translator" lang="en"/>
+<l:gentext key="listofequations" text="Gleichungen"/>
+<l:gentext key="ListofEquations" text="Gleichungen"/>
+<l:gentext key="ListofExamples" text="Beispiele"/>
+<l:gentext key="listofexamples" text="Beispiele"/>
+<l:gentext key="ListofFigures" text="Abbildungsverzeichnis"/>
+<l:gentext key="listoffigures" text="Abbildungsverzeichnis"/>
+<l:gentext key="ListofProcedures" text="List of Procedures" lang="en"/>
+<l:gentext key="listofprocedures" text="List of Procedures" lang="en"/>
+<l:gentext key="listoftables" text="Tabellenverzeichnis"/>
+<l:gentext key="ListofTables" text="Tabellenverzeichnis"/>
+<l:gentext key="ListofUnknown" text="???-Verzeichnis"/>
+<l:gentext key="listofunknown" text="???-Verzeichnis"/>
+<l:gentext key="nav-home" text="Zum Anfang"/>
+<l:gentext key="nav-next" text="Weiter"/>
+<l:gentext key="nav-next-sibling" text="Schnell weiter"/>
+<l:gentext key="nav-prev" text="Zurück"/>
+<l:gentext key="nav-prev-sibling" text="Schnell zurück"/>
+<l:gentext key="nav-up" text="Nach oben"/>
+<l:gentext key="nav-toc" text="InhV"/>
+<l:gentext key="Draft" text="Entwurf"/>
+<l:gentext key="above" text="oben"/>
+<l:gentext key="below" text="unten"/>
+<l:gentext key="sectioncalled" text="der Abschnitt namens"/>
+<l:gentext key="index symbols" text="Symbole"/>
+<l:gentext key="lowercase.alpha" text="abcdefghijklmnopqrstuvwxyzäöüß"/>
+<l:gentext key="uppercase.alpha" text="ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜß"/>
+<l:gentext key="normalize.sort.input" text="AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ" lang="en"/>
+<l:gentext key="normalize.sort.output" text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ" lang="en"/>
+<l:dingbat key="startquote" text="„"/>
+<l:dingbat key="endquote" text="“"/>
+<l:dingbat key="nestedstartquote" text="‚"/>
+<l:dingbat key="nestedendquote" text="‘"/>
+<l:dingbat key="singlestartquote" text="‚"/>
+<l:dingbat key="singleendquote" text="‘"/>
+<l:dingbat key="bullet" text="•"/>
+<l:gentext key="hyphenation-character" text="-"/>
+<l:gentext key="hyphenation-push-character-count" text="2"/>
+<l:gentext key="hyphenation-remain-character-count" text="3"/>
+<l:context name="styles"><l:template name="person-name" text="first-last"/>
+</l:context>
+<l:context name="title"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="%t"/>
+<l:template name="appendix" text="Anhang %n. %t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="biblioentry" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliolist" text="%t" lang="en"/>
+<l:template name="bibliomixed" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="Kapitel %n. %t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="Gleichung %n. %t"/>
+<l:template name="example" text="Beispiel %n. %t"/>
+<l:template name="figure" text="Abbildung %n. %t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="glosslist" text="%t" lang="en"/>
+<l:template name="glossentry" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text=""/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="Teil %n. %t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="procedure.formal" text="Prozedur %n. %t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="productionset.formal" text="Produktion %n"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="%t"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="F: %n"/>
+<l:template name="refentry" text="%t"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsection" text="%t"/>
+<l:template name="refsect1" text="%t"/>
+<l:template name="refsect2" text="%t"/>
+<l:template name="refsect3" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="refsynopsisdivinfo" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="step" text="%t"/>
+<l:template name="table" text="Tabelle %n. %t"/>
+<l:template name="task" text="%t"/>
+<l:template name="tasksummary" text="%t" lang="en"/>
+<l:template name="taskprerequisites" text="%t" lang="en"/>
+<l:template name="taskrelated" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="" lang="en"/>
+<l:template name="warning" text="%t"/>
+</l:context>
+<l:context name="title-unnumbered"><l:template name="appendix" text="%t"/>
+<l:template name="article/appendix" text="%t"/>
+<l:template name="bridgehead" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="sect1" text="%t"/>
+<l:template name="sect2" text="%t"/>
+<l:template name="sect3" text="%t"/>
+<l:template name="sect4" text="%t"/>
+<l:template name="sect5" text="%t"/>
+<l:template name="section" text="%t"/>
+<l:template name="simplesect" text="%t"/>
+<l:template name="part" text="%t" lang="en"/>
+</l:context>
+<l:context name="title-numbered"><l:template name="appendix" text="Anhang %n. %t"/>
+<l:template name="article/appendix" text="%n. %t"/>
+<l:template name="bridgehead" text="%n. %t"/>
+<l:template name="chapter" text="Kapitel %n. %t"/>
+<l:template name="part" text="Teil %n. %t"/>
+<l:template name="sect1" text="%n. %t"/>
+<l:template name="sect2" text="%n. %t"/>
+<l:template name="sect3" text="%n. %t"/>
+<l:template name="sect4" text="%n. %t"/>
+<l:template name="sect5" text="%n. %t"/>
+<l:template name="section" text="%n. %t"/>
+<l:template name="simplesect" text="%n. %t"/>
+</l:context>
+<l:context name="subtitle"><l:template name="appendix" text="%s"/>
+<l:template name="article" text="%s"/>
+<l:template name="bibliodiv" text="%s"/>
+<l:template name="biblioentry" text="%s"/>
+<l:template name="bibliography" text="%s"/>
+<l:template name="bibliomixed" text="%s"/>
+<l:template name="bibliomset" text="%s"/>
+<l:template name="biblioset" text="%s"/>
+<l:template name="book" text="%s"/>
+<l:template name="chapter" text="%s"/>
+<l:template name="colophon" text="%s"/>
+<l:template name="dedication" text="%s"/>
+<l:template name="glossary" text="%s"/>
+<l:template name="glossdiv" text="%s"/>
+<l:template name="index" text="%s"/>
+<l:template name="indexdiv" text="%s"/>
+<l:template name="lot" text="%s"/>
+<l:template name="part" text="%s"/>
+<l:template name="partintro" text="%s"/>
+<l:template name="preface" text="%s"/>
+<l:template name="refentry" text="%s"/>
+<l:template name="reference" text="%s"/>
+<l:template name="refsection" text="%s"/>
+<l:template name="refsect1" text="%s"/>
+<l:template name="refsect2" text="%s"/>
+<l:template name="refsect3" text="%s"/>
+<l:template name="refsynopsisdiv" text="%s"/>
+<l:template name="sect1" text="%s"/>
+<l:template name="sect2" text="%s"/>
+<l:template name="sect3" text="%s"/>
+<l:template name="sect4" text="%s"/>
+<l:template name="sect5" text="%s"/>
+<l:template name="section" text="%s"/>
+<l:template name="set" text="%s"/>
+<l:template name="setindex" text="%s"/>
+<l:template name="sidebar" text="%s"/>
+<l:template name="simplesect" text="%s"/>
+<l:template name="toc" text="%s"/>
+</l:context>
+<l:context name="xref"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="A: %n"/>
+<l:template name="appendix" text="%t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="constraintdef" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="%t"/>
+<l:template name="example" text="%t"/>
+<l:template name="figure" text="%t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text="%n"/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="%t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="F: %n"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="F: %n"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="table" text="%t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="%n"/>
+<l:template name="warning" text="%t"/>
+<l:template name="olink.document.citation" text=" in %o" lang="en"/>
+<l:template name="olink.page.citation" text=" (page %p)" lang="en"/>
+<l:template name="page.citation" text=" [%p]"/>
+<l:template name="page" text="(Seite %p)"/>
+<l:template name="docname" text=" in %o" lang="en"/>
+<l:template name="docnamelong" text=" in the document titled %o" lang="en"/>
+<l:template name="pageabbrev" text="(S. %p)"/>
+<l:template name="Page" text="Seite %p"/>
+<l:template name="bridgehead" text="„%t“"/>
+<l:template name="refsection" text="„%t“"/>
+<l:template name="refsect1" text="„%t“"/>
+<l:template name="refsect2" text="„%t“"/>
+<l:template name="refsect3" text="„%t“"/>
+<l:template name="sect1" text="„%t“"/>
+<l:template name="sect2" text="„%t“"/>
+<l:template name="sect3" text="„%t“"/>
+<l:template name="sect4" text="„%t“"/>
+<l:template name="sect5" text="„%t“"/>
+<l:template name="section" text="„%t“"/>
+<l:template name="simplesect" text="„%t“"/>
+</l:context>
+<l:context name="xref-number"><l:template name="answer" text="A: %n"/>
+<l:template name="appendix" text="Anhang %n"/>
+<l:template name="bridgehead" text="Abschnitt %n"/>
+<l:template name="chapter" text="Kapitel %n"/>
+<l:template name="equation" text="Gleichung %n"/>
+<l:template name="example" text="Beispiel %n"/>
+<l:template name="figure" text="Abbildung %n"/>
+<l:template name="part" text="Teil %n"/>
+<l:template name="procedure" text="Prozedur %n"/>
+<l:template name="productionset" text="Produktion %n"/>
+<l:template name="qandadiv" text="F &amp; A %n"/>
+<l:template name="qandaentry" text="F: %n"/>
+<l:template name="question" text="F: %n"/>
+<l:template name="sect1" text="Abschnitt %n"/>
+<l:template name="sect2" text="Abschnitt %n"/>
+<l:template name="sect3" text="Abschnitt %n"/>
+<l:template name="sect4" text="Abschnitt %n"/>
+<l:template name="sect5" text="Abschnitt %n"/>
+<l:template name="section" text="Abschnitt %n"/>
+<l:template name="table" text="Tabelle %n"/>
+</l:context>
+<l:context name="xref-number-and-title"><l:template name="appendix" text="Anhang %n, %t"/>
+<l:template name="bridgehead" text="Abschnitt %n, „%t“"/>
+<l:template name="chapter" text="Kapitel %n, %t"/>
+<l:template name="equation" text="Gleichung %n, „%t“"/>
+<l:template name="example" text="Beispiel %n, „%t“"/>
+<l:template name="figure" text="Abbildung %n, „%t“"/>
+<l:template name="part" text="Teil %n, „%t“"/>
+<l:template name="procedure" text="Prozedur %n, „%t“"/>
+<l:template name="productionset" text="Produktion %n, „%t“"/>
+<l:template name="qandadiv" text="F &amp; A %n, „%t“"/>
+<l:template name="refsect1" text="der Abschnitt namens „%t“"/>
+<l:template name="refsect2" text="der Abschnitt namens „%t“"/>
+<l:template name="refsect3" text="der Abschnitt namens „%t“"/>
+<l:template name="refsection" text="der Abschnitt namens „%t“"/>
+<l:template name="sect1" text="Abschnitt %n, „%t“"/>
+<l:template name="sect2" text="Abschnitt %n, „%t“"/>
+<l:template name="sect3" text="Abschnitt %n, „%t“"/>
+<l:template name="sect4" text="Abschnitt %n, „%t“"/>
+<l:template name="sect5" text="Abschnitt %n, „%t“"/>
+<l:template name="section" text="Abschnitt %n, „%t“"/>
+<l:template name="simplesect" text="der Abschnitt namens „%t“"/>
+<l:template name="table" text="Tabelle %n, „%t“"/>
+</l:context>
+<l:context name="authorgroup"><l:template name="sep" text=", "/>
+<l:template name="sep2" text=" und "/>
+<l:template name="seplast" text=" und "/>
+</l:context>
+<l:context name="glossary"><l:template name="see" text="Siehe %t"/>
+<l:template name="seealso" text="Siehe auch %t"/>
+</l:context>
+<l:context name="msgset"><l:template name="MsgAud" text="Zielgruppe: "/>
+<l:template name="MsgLevel" text="Dringlichkeit: "/>
+<l:template name="MsgOrig" text="Ursprung: "/>
+</l:context>
+<l:context name="datetime"><l:template name="format" text="d.m.Y"/>
+</l:context>
+<l:context name="termdef"><l:template name="prefix" text="[Definition: " lang="en"/>
+<l:template name="suffix" text="]" lang="en"/>
+</l:context>
+<l:context name="datetime-full"><l:template name="January" text="Januar"/>
+<l:template name="February" text="Februar"/>
+<l:template name="March" text="März"/>
+<l:template name="April" text="April"/>
+<l:template name="May" text="Mai"/>
+<l:template name="June" text="Juni"/>
+<l:template name="July" text="Juli"/>
+<l:template name="August" text="August"/>
+<l:template name="September" text="September"/>
+<l:template name="October" text="Oktober"/>
+<l:template name="November" text="November"/>
+<l:template name="December" text="Dezember"/>
+<l:template name="Monday" text="Montag"/>
+<l:template name="Tuesday" text="Dienstag"/>
+<l:template name="Wednesday" text="Mittwoch"/>
+<l:template name="Thursday" text="Donnerstag"/>
+<l:template name="Friday" text="Freitag"/>
+<l:template name="Saturday" text="Samstag"/>
+<l:template name="Sunday" text="Sonntag"/>
+</l:context>
+<l:context name="datetime-abbrev"><l:template name="Jan" text="Jan"/>
+<l:template name="Feb" text="Feb"/>
+<l:template name="Mar" text="Mar"/>
+<l:template name="Apr" text="Apr"/>
+<l:template name="May" text="Mai"/>
+<l:template name="Jun" text="Jun"/>
+<l:template name="Jul" text="Jul"/>
+<l:template name="Aug" text="Aug"/>
+<l:template name="Sep" text="Sep"/>
+<l:template name="Oct" text="Okt"/>
+<l:template name="Nov" text="Nov"/>
+<l:template name="Dec" text="Dez"/>
+<l:template name="Mon" text="Mo"/>
+<l:template name="Tue" text="Di"/>
+<l:template name="Wed" text="Mi"/>
+<l:template name="Thu" text="Do"/>
+<l:template name="Fri" text="Fr"/>
+<l:template name="Sat" text="Sa"/>
+<l:template name="Sun" text="So"/>
+</l:context>
+<l:context name="htmlhelp"><l:template name="langcode" text="0x0407 German (GERMANY)"/>
+</l:context>
+<l:context name="index"><l:template name="term-separator" text=", " lang="en"/>
+<l:template name="number-separator" text=", " lang="en"/>
+<l:template name="range-separator" text="-" lang="en"/>
+</l:context>
+<l:context name="iso690"><l:template name="lastfirst.sep" text=", " lang="en"/>
+<l:template name="alt.person.two.sep" text=" – " lang="en"/>
+<l:template name="alt.person.last.sep" text=" – " lang="en"/>
+<l:template name="alt.person.more.sep" text=" – " lang="en"/>
+<l:template name="primary.editor" text=" (ed.)" lang="en"/>
+<l:template name="primary.many" text=", et al." lang="en"/>
+<l:template name="primary.sep" text=". " lang="en"/>
+<l:template name="submaintitle.sep" text=": " lang="en"/>
+<l:template name="title.sep" text=". " lang="en"/>
+<l:template name="othertitle.sep" text=", " lang="en"/>
+<l:template name="medium1" text=" [" lang="en"/>
+<l:template name="medium2" text="]" lang="en"/>
+<l:template name="secondary.person.sep" text="; " lang="en"/>
+<l:template name="secondary.sep" text=". " lang="en"/>
+<l:template name="respons.sep" text=". " lang="en"/>
+<l:template name="edition.sep" text=". " lang="en"/>
+<l:template name="edition.serial.sep" text=", " lang="en"/>
+<l:template name="issuing.range" text="-" lang="en"/>
+<l:template name="issuing.div" text=", " lang="en"/>
+<l:template name="issuing.sep" text=". " lang="en"/>
+<l:template name="partnr.sep" text=". " lang="en"/>
+<l:template name="placepubl.sep" text=": " lang="en"/>
+<l:template name="publyear.sep" text=", " lang="en"/>
+<l:template name="pubinfo.sep" text=". " lang="en"/>
+<l:template name="spec.pubinfo.sep" text=", " lang="en"/>
+<l:template name="upd.sep" text=", " lang="en"/>
+<l:template name="datecit1" text=" [cited " lang="en"/>
+<l:template name="datecit2" text="]" lang="en"/>
+<l:template name="extent.sep" text=". " lang="en"/>
+<l:template name="locs.sep" text=", " lang="en"/>
+<l:template name="location.sep" text=". " lang="en"/>
+<l:template name="serie.sep" text=". " lang="en"/>
+<l:template name="notice.sep" text=". " lang="en"/>
+<l:template name="access" text="Available " lang="en"/>
+<l:template name="acctoo" text="Also available " lang="en"/>
+<l:template name="onwww" text="from World Wide Web" lang="en"/>
+<l:template name="oninet" text="from Internet" lang="en"/>
+<l:template name="access.end" text=": " lang="en"/>
+<l:template name="link1" text="&lt;" lang="en"/>
+<l:template name="link2" text="&gt;" lang="en"/>
+<l:template name="access.sep" text=". " lang="en"/>
+<l:template name="isbn" text="ISBN " lang="en"/>
+<l:template name="issn" text="ISSN " lang="en"/>
+<l:template name="stdnum.sep" text=". " lang="en"/>
+<l:template name="patcountry.sep" text=". " lang="en"/>
+<l:template name="pattype.sep" text=", " lang="en"/>
+<l:template name="patnum.sep" text=". " lang="en"/>
+<l:template name="patdate.sep" text=". " lang="en"/>
+</l:context><l:letters><l:l i="-1"/>
+<l:l i="0">Symbole</l:l>
+<l:l i="1">A</l:l>
+<l:l i="1">a</l:l>
+<l:l i="1">Ä</l:l>
+<l:l i="1">ä</l:l>
+<l:l i="2">B</l:l>
+<l:l i="2">b</l:l>
+<l:l i="3">C</l:l>
+<l:l i="3">c</l:l>
+<l:l i="4">D</l:l>
+<l:l i="4">d</l:l>
+<l:l i="5">E</l:l>
+<l:l i="5">e</l:l>
+<l:l i="6">F</l:l>
+<l:l i="6">f</l:l>
+<l:l i="7">G</l:l>
+<l:l i="7">g</l:l>
+<l:l i="8">H</l:l>
+<l:l i="8">h</l:l>
+<l:l i="9">I</l:l>
+<l:l i="9">i</l:l>
+<l:l i="10">J</l:l>
+<l:l i="10">j</l:l>
+<l:l i="11">K</l:l>
+<l:l i="11">k</l:l>
+<l:l i="12">L</l:l>
+<l:l i="12">l</l:l>
+<l:l i="13">M</l:l>
+<l:l i="13">m</l:l>
+<l:l i="14">N</l:l>
+<l:l i="14">n</l:l>
+<l:l i="15">O</l:l>
+<l:l i="15">o</l:l>
+<l:l i="15">Ö</l:l>
+<l:l i="15">ö</l:l>
+<l:l i="16">P</l:l>
+<l:l i="16">p</l:l>
+<l:l i="17">Q</l:l>
+<l:l i="17">q</l:l>
+<l:l i="18">R</l:l>
+<l:l i="18">r</l:l>
+<l:l i="19">S</l:l>
+<l:l i="19">s</l:l>
+<l:l i="20">T</l:l>
+<l:l i="20">t</l:l>
+<l:l i="21">U</l:l>
+<l:l i="21">u</l:l>
+<l:l i="21">Ü</l:l>
+<l:l i="21">ü</l:l>
+<l:l i="22">V</l:l>
+<l:l i="22">v</l:l>
+<l:l i="23">W</l:l>
+<l:l i="23">w</l:l>
+<l:l i="24">X</l:l>
+<l:l i="24">x</l:l>
+<l:l i="25">Y</l:l>
+<l:l i="25">y</l:l>
+<l:l i="26">Z</l:l>
+<l:l i="26">z</l:l>
+</l:letters>
+</l:l10n>

+ 1216 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/en.xml

@@ -0,0 +1,1216 @@
+<?xml version="1.0" encoding="utf-8"?>
+<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en" english-language-name="English">
+
+<!-- * This file is generated automatically. -->
+<!-- * To submit changes to this file upstream (to the DocBook Project) -->
+<!-- * do not submit an edited version of this file. Instead, submit an -->
+<!-- * edited version of the source file at the following location: -->
+<!-- * -->
+<!-- *  https://svn.sourceforge.net/svnroot/docbook/trunk/gentext/locale/en.xml -->
+<!-- * -->
+<!-- * E-mail the edited en.xml source file to: -->
+<!-- * -->
+<!-- *  docbook-developers@lists.sourceforge.net -->
+
+<!-- ******************************************************************** -->
+
+<!-- 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. -->
+
+<!-- ******************************************************************** -->
+
+<l:gentext key="Abstract" text="Abstract"/>
+<l:gentext key="abstract" text="Abstract"/>
+<l:gentext key="Answer" text="A:"/>
+<l:gentext key="answer" text="A:"/>
+<l:gentext key="Appendix" text="Appendix"/>
+<l:gentext key="appendix" text="Appendix"/>
+<l:gentext key="Article" text="Article"/>
+<l:gentext key="article" text="Article"/>
+<l:gentext key="Author" text="Author"/>
+<l:gentext key="Bibliography" text="Bibliography"/>
+<l:gentext key="bibliography" text="Bibliography"/>
+<l:gentext key="Book" text="Book"/>
+<l:gentext key="book" text="Book"/>
+<l:gentext key="CAUTION" text="CAUTION"/>
+<l:gentext key="Caution" text="Caution"/>
+<l:gentext key="caution" text="Caution"/>
+<l:gentext key="Chapter" text="Chapter"/>
+<l:gentext key="chapter" text="Chapter"/>
+<l:gentext key="Colophon" text="Colophon"/>
+<l:gentext key="colophon" text="Colophon"/>
+<l:gentext key="Copyright" text="Copyright"/>
+<l:gentext key="copyright" text="Copyright"/>
+<l:gentext key="Dedication" text="Dedication"/>
+<l:gentext key="dedication" text="Dedication"/>
+<l:gentext key="Edition" text="Edition"/>
+<l:gentext key="edition" text="Edition"/>
+<l:gentext key="Editor" text="Editor"/>
+<l:gentext key="Equation" text="Equation"/>
+<l:gentext key="equation" text="Equation"/>
+<l:gentext key="Example" text="Example"/>
+<l:gentext key="example" text="Example"/>
+<l:gentext key="Figure" text="Figure"/>
+<l:gentext key="figure" text="Figure"/>
+<l:gentext key="Glossary" text="Glossary"/>
+<l:gentext key="glossary" text="Glossary"/>
+<l:gentext key="GlossSee" text="See"/>
+<l:gentext key="glosssee" text="See"/>
+<l:gentext key="GlossSeeAlso" text="See Also"/>
+<l:gentext key="glossseealso" text="See Also"/>
+<l:gentext key="IMPORTANT" text="IMPORTANT"/>
+<l:gentext key="important" text="Important"/>
+<l:gentext key="Important" text="Important"/>
+<l:gentext key="Index" text="Index"/>
+<l:gentext key="index" text="Index"/>
+<l:gentext key="ISBN" text="ISBN"/>
+<l:gentext key="isbn" text="ISBN"/>
+<l:gentext key="LegalNotice" text="Legal Notice"/>
+<l:gentext key="legalnotice" text="Legal Notice"/>
+<l:gentext key="MsgAud" text="Audience"/>
+<l:gentext key="msgaud" text="Audience"/>
+<l:gentext key="MsgLevel" text="Level"/>
+<l:gentext key="msglevel" text="Level"/>
+<l:gentext key="MsgOrig" text="Origin"/>
+<l:gentext key="msgorig" text="Origin"/>
+<l:gentext key="NOTE" text="NOTE"/>
+<l:gentext key="Note" text="Note"/>
+<l:gentext key="note" text="Note"/>
+<l:gentext key="Part" text="Part"/>
+<l:gentext key="part" text="Part"/>
+<l:gentext key="Preface" text="Preface"/>
+<l:gentext key="preface" text="Preface"/>
+<l:gentext key="Procedure" text="Procedure"/>
+<l:gentext key="procedure" text="Procedure"/>
+<l:gentext key="ProductionSet" text="Production"/>
+<l:gentext key="PubDate" text="Publication Date"/>
+<l:gentext key="pubdate" text="Publication date"/>
+<l:gentext key="Published" text="Published"/>
+<l:gentext key="published" text="Published"/>
+<l:gentext key="Publisher" text="Publisher"/>
+<l:gentext key="Qandadiv" text="Q &amp; A"/>
+<l:gentext key="qandadiv" text="Q &amp; A"/>
+<l:gentext key="QandASet" text="Frequently Asked Questions"/>
+<l:gentext key="Question" text="Q:"/>
+<l:gentext key="question" text="Q:"/>
+<l:gentext key="RefEntry" text=""/>
+<l:gentext key="refentry" text=""/>
+<l:gentext key="Reference" text="Reference"/>
+<l:gentext key="reference" text="Reference"/>
+<l:gentext key="References" text="References"/>
+<l:gentext key="RefName" text="Name"/>
+<l:gentext key="refname" text="Name"/>
+<l:gentext key="RefSection" text=""/>
+<l:gentext key="refsection" text=""/>
+<l:gentext key="RefSynopsisDiv" text="Synopsis"/>
+<l:gentext key="refsynopsisdiv" text="Synopsis"/>
+<l:gentext key="RevHistory" text="Revision History"/>
+<l:gentext key="revhistory" text="Revision History"/>
+<l:gentext key="revision" text="Revision"/>
+<l:gentext key="Revision" text="Revision"/>
+<l:gentext key="sect1" text="Section"/>
+<l:gentext key="sect2" text="Section"/>
+<l:gentext key="sect3" text="Section"/>
+<l:gentext key="sect4" text="Section"/>
+<l:gentext key="sect5" text="Section"/>
+<l:gentext key="section" text="Section"/>
+<l:gentext key="Section" text="Section"/>
+<l:gentext key="see" text="see"/>
+<l:gentext key="See" text="See"/>
+<l:gentext key="seealso" text="see also"/>
+<l:gentext key="Seealso" text="See also"/>
+<l:gentext key="SeeAlso" text="See Also"/>
+<l:gentext key="set" text="Set"/>
+<l:gentext key="Set" text="Set"/>
+<l:gentext key="setindex" text="Set Index"/>
+<l:gentext key="SetIndex" text="Set Index"/>
+<l:gentext key="Sidebar" text=""/>
+<l:gentext key="sidebar" text="sidebar"/>
+<l:gentext key="step" text="step"/>
+<l:gentext key="Step" text="Step"/>
+<l:gentext key="table" text="Table"/>
+<l:gentext key="Table" text="Table"/>
+<l:gentext key="task" text="Task"/>
+<l:gentext key="Task" text="Task"/>
+<l:gentext key="tip" text="Tip"/>
+<l:gentext key="TIP" text="TIP"/>
+<l:gentext key="Tip" text="Tip"/>
+<l:gentext key="Warning" text="Warning"/>
+<l:gentext key="warning" text="Warning"/>
+<l:gentext key="WARNING" text="WARNING"/>
+<l:gentext key="and" text="and"/>
+<l:gentext key="by" text="by"/>
+<l:gentext key="Edited" text="Edited"/>
+<l:gentext key="edited" text="Edited"/>
+<l:gentext key="Editedby" text="Edited by"/>
+<l:gentext key="editedby" text="Edited by"/>
+<l:gentext key="in" text="in"/>
+<l:gentext key="lastlistcomma" text=","/>
+<l:gentext key="listcomma" text=","/>
+<l:gentext key="nonexistantelement" text="non-existant element"/>
+<l:gentext key="notes" text="Notes"/>
+<l:gentext key="Notes" text="Notes"/>
+<l:gentext key="Pgs" text="Pgs."/>
+<l:gentext key="pgs" text="Pgs."/>
+<l:gentext key="Revisedby" text="Revised by: "/>
+<l:gentext key="revisedby" text="Revised by: "/>
+<l:gentext key="TableNotes" text="Notes"/>
+<l:gentext key="tablenotes" text="Notes"/>
+<l:gentext key="TableofContents" text="Table of Contents"/>
+<l:gentext key="tableofcontents" text="Table of Contents"/>
+<l:gentext key="unexpectedelementname" text="Unexpected element name"/>
+<l:gentext key="unsupported" text="unsupported"/>
+<l:gentext key="xrefto" text="xref to"/>
+<l:gentext key="Authors" text="Authors"/>
+<l:gentext key="copyeditor" text="Copy Editor"/>
+<l:gentext key="graphicdesigner" text="Graphic Designer"/>
+<l:gentext key="productioneditor" text="Production Editor"/>
+<l:gentext key="technicaleditor" text="Technical Editor"/>
+<l:gentext key="translator" text="Translator"/>
+<l:gentext key="listofequations" text="List of Equations"/>
+<l:gentext key="ListofEquations" text="List of Equations"/>
+<l:gentext key="ListofExamples" text="List of Examples"/>
+<l:gentext key="listofexamples" text="List of Examples"/>
+<l:gentext key="ListofFigures" text="List of Figures"/>
+<l:gentext key="listoffigures" text="List of Figures"/>
+<l:gentext key="ListofProcedures" text="List of Procedures"/>
+<l:gentext key="listofprocedures" text="List of Procedures"/>
+<l:gentext key="listoftables" text="List of Tables"/>
+<l:gentext key="ListofTables" text="List of Tables"/>
+<l:gentext key="ListofUnknown" text="List of Unknown"/>
+<l:gentext key="listofunknown" text="List of Unknown"/>
+<l:gentext key="nav-home" text="Home"/>
+<l:gentext key="nav-next" text="Next"/>
+<l:gentext key="nav-next-sibling" text="Fast Forward"/>
+<l:gentext key="nav-prev" text="Prev"/>
+<l:gentext key="nav-prev-sibling" text="Fast Backward"/>
+<l:gentext key="nav-up" text="Up"/>
+<l:gentext key="nav-toc" text="ToC"/>
+<l:gentext key="Draft" text="Draft"/>
+<l:gentext key="above" text="above"/>
+<l:gentext key="below" text="below"/>
+<l:gentext key="sectioncalled" text="the section called"/>
+<l:gentext key="index symbols" text="Symbols"/>
+<l:gentext key="lowercase.alpha" text="abcdefghijklmnopqrstuvwxyz"/>
+<l:gentext key="uppercase.alpha" text="ABCDEFGHIJKLMNOPQRSTUVWXYZ"/>
+<l:gentext key="normalize.sort.input" text="AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ"/>
+<l:gentext key="normalize.sort.output" text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ"/>
+<l:dingbat key="startquote" text="“"/>
+<l:dingbat key="endquote" text="”"/>
+<l:dingbat key="nestedstartquote" text="‘"/>
+<l:dingbat key="nestedendquote" text="’"/>
+<l:dingbat key="singlestartquote" text="‘"/>
+<l:dingbat key="singleendquote" text="’"/>
+<l:dingbat key="bullet" text="•"/>
+<l:gentext key="hyphenation-character" text="-"/>
+<l:gentext key="hyphenation-push-character-count" text="2"/>
+<l:gentext key="hyphenation-remain-character-count" text="2"/>
+<l:context name="styles"><l:template name="person-name" text="first-last"/>
+</l:context>
+<l:context name="title"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="%t"/>
+<l:template name="appendix" text="Appendix %n. %t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="biblioentry" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliolist" text="%t"/>
+<l:template name="bibliomixed" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="Chapter %n. %t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="Equation %n. %t"/>
+<l:template name="example" text="Example %n. %t"/>
+<l:template name="figure" text="Figure %n. %t"/>
+<l:template name="foil" text="%t"/>
+<l:template name="foilgroup" text="%t"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="glosslist" text="%t"/>
+<l:template name="glossentry" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text=""/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="Part %n. %t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="procedure.formal" text="Procedure %n. %t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="productionset.formal" text="Production %n"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="%t"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="%t"/>
+<l:template name="refentry" text="%t"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsection" text="%t"/>
+<l:template name="refsect1" text="%t"/>
+<l:template name="refsect2" text="%t"/>
+<l:template name="refsect3" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="refsynopsisdivinfo" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="step" text="%t"/>
+<l:template name="table" text="Table %n. %t"/>
+<l:template name="task" text="%t"/>
+<l:template name="tasksummary" text="%t"/>
+<l:template name="taskprerequisites" text="%t"/>
+<l:template name="taskrelated" text="%t"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text=""/>
+<l:template name="warning" text="%t"/>
+</l:context>
+<l:context name="title-unnumbered"><l:template name="appendix" text="%t"/>
+<l:template name="article/appendix" text="%t"/>
+<l:template name="bridgehead" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="sect1" text="%t"/>
+<l:template name="sect2" text="%t"/>
+<l:template name="sect3" text="%t"/>
+<l:template name="sect4" text="%t"/>
+<l:template name="sect5" text="%t"/>
+<l:template name="section" text="%t"/>
+<l:template name="simplesect" text="%t"/>
+<l:template name="part" text="%t"/>
+</l:context>
+<l:context name="title-numbered"><l:template name="appendix" text="Appendix %n. %t"/>
+<l:template name="article/appendix" text="%n. %t"/>
+<l:template name="bridgehead" text="%n. %t"/>
+<l:template name="chapter" text="Chapter %n. %t"/>
+<l:template name="part" text="Part %n. %t"/>
+<l:template name="sect1" text="%n. %t"/>
+<l:template name="sect2" text="%n. %t"/>
+<l:template name="sect3" text="%n. %t"/>
+<l:template name="sect4" text="%n. %t"/>
+<l:template name="sect5" text="%n. %t"/>
+<l:template name="section" text="%n. %t"/>
+<l:template name="simplesect" text="%t"/>
+</l:context>
+<l:context name="subtitle"><l:template name="appendix" text="%s"/>
+<l:template name="article" text="%s"/>
+<l:template name="bibliodiv" text="%s"/>
+<l:template name="biblioentry" text="%s"/>
+<l:template name="bibliography" text="%s"/>
+<l:template name="bibliomixed" text="%s"/>
+<l:template name="bibliomset" text="%s"/>
+<l:template name="biblioset" text="%s"/>
+<l:template name="book" text="%s"/>
+<l:template name="chapter" text="%s"/>
+<l:template name="colophon" text="%s"/>
+<l:template name="dedication" text="%s"/>
+<l:template name="glossary" text="%s"/>
+<l:template name="glossdiv" text="%s"/>
+<l:template name="index" text="%s"/>
+<l:template name="indexdiv" text="%s"/>
+<l:template name="lot" text="%s"/>
+<l:template name="part" text="%s"/>
+<l:template name="partintro" text="%s"/>
+<l:template name="preface" text="%s"/>
+<l:template name="refentry" text="%s"/>
+<l:template name="reference" text="%s"/>
+<l:template name="refsection" text="%s"/>
+<l:template name="refsect1" text="%s"/>
+<l:template name="refsect2" text="%s"/>
+<l:template name="refsect3" text="%s"/>
+<l:template name="refsynopsisdiv" text="%s"/>
+<l:template name="sect1" text="%s"/>
+<l:template name="sect2" text="%s"/>
+<l:template name="sect3" text="%s"/>
+<l:template name="sect4" text="%s"/>
+<l:template name="sect5" text="%s"/>
+<l:template name="section" text="%s"/>
+<l:template name="set" text="%s"/>
+<l:template name="setindex" text="%s"/>
+<l:template name="sidebar" text="%s"/>
+<l:template name="simplesect" text="%s"/>
+<l:template name="toc" text="%s"/>
+</l:context>
+<l:context name="xref"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="A: %n"/>
+<l:template name="appendix" text="%t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="constraintdef" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="%t"/>
+<l:template name="example" text="%t"/>
+<l:template name="figure" text="%t"/>
+<l:template name="foil" text="%t"/>
+<l:template name="foilgroup" text="%t"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text="%n"/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="%t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="Q: %n"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="Q: %n"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="table" text="%t"/>
+<l:template name="task" text="%t"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="%n"/>
+<l:template name="warning" text="%t"/>
+<l:template name="olink.document.citation" text=" in %o"/>
+<l:template name="olink.page.citation" text=" (page %p)"/>
+<l:template name="page.citation" text=" [%p]"/>
+<l:template name="page" text="(page %p)"/>
+<l:template name="docname" text=" in %o"/>
+<l:template name="docnamelong" text=" in the document titled %o"/>
+<l:template name="pageabbrev" text="(p. %p)"/>
+<l:template name="Page" text="Page %p"/>
+<l:template name="bridgehead" text="the section called “%t”"/>
+<l:template name="refsection" text="the section called “%t”"/>
+<l:template name="refsect1" text="the section called “%t”"/>
+<l:template name="refsect2" text="the section called “%t”"/>
+<l:template name="refsect3" text="the section called “%t”"/>
+<l:template name="sect1" text="the section called “%t”"/>
+<l:template name="sect2" text="the section called “%t”"/>
+<l:template name="sect3" text="the section called “%t”"/>
+<l:template name="sect4" text="the section called “%t”"/>
+<l:template name="sect5" text="the section called “%t”"/>
+<l:template name="section" text="the section called “%t”"/>
+<l:template name="simplesect" text="the section called “%t”"/>
+</l:context>
+<l:context name="xref-number"><l:template name="answer" text="A: %n"/>
+<l:template name="appendix" text="Appendix %n"/>
+<l:template name="bridgehead" text="Section %n"/>
+<l:template name="chapter" text="Chapter %n"/>
+<l:template name="equation" text="Equation %n"/>
+<l:template name="example" text="Example %n"/>
+<l:template name="figure" text="Figure %n"/>
+<l:template name="part" text="Part %n"/>
+<l:template name="procedure" text="Procedure %n"/>
+<l:template name="productionset" text="Production %n"/>
+<l:template name="qandadiv" text="Q &amp; A %n"/>
+<l:template name="qandaentry" text="Q: %n"/>
+<l:template name="question" text="Q: %n"/>
+<l:template name="sect1" text="Section %n"/>
+<l:template name="sect2" text="Section %n"/>
+<l:template name="sect3" text="Section %n"/>
+<l:template name="sect4" text="Section %n"/>
+<l:template name="sect5" text="Section %n"/>
+<l:template name="section" text="Section %n"/>
+<l:template name="table" text="Table %n"/>
+</l:context>
+<l:context name="xref-number-and-title"><l:template name="appendix" text="Appendix %n, %t"/>
+<l:template name="bridgehead" text="Section %n, “%t”"/>
+<l:template name="chapter" text="Chapter %n, %t"/>
+<l:template name="equation" text="Equation %n, “%t”"/>
+<l:template name="example" text="Example %n, “%t”"/>
+<l:template name="figure" text="Figure %n, “%t”"/>
+<l:template name="part" text="Part %n, “%t”"/>
+<l:template name="procedure" text="Procedure %n, “%t”"/>
+<l:template name="productionset" text="Production %n, “%t”"/>
+<l:template name="qandadiv" text="Q &amp; A %n, “%t”"/>
+<l:template name="refsect1" text="the section called “%t”"/>
+<l:template name="refsect2" text="the section called “%t”"/>
+<l:template name="refsect3" text="the section called “%t”"/>
+<l:template name="refsection" text="the section called “%t”"/>
+<l:template name="sect1" text="Section %n, “%t”"/>
+<l:template name="sect2" text="Section %n, “%t”"/>
+<l:template name="sect3" text="Section %n, “%t”"/>
+<l:template name="sect4" text="Section %n, “%t”"/>
+<l:template name="sect5" text="Section %n, “%t”"/>
+<l:template name="section" text="Section %n, “%t”"/>
+<l:template name="simplesect" text="the section called “%t”"/>
+<l:template name="table" text="Table %n, “%t”"/>
+</l:context>
+<l:context name="authorgroup"><l:template name="sep" text=", "/>
+<l:template name="sep2" text=" and "/>
+<l:template name="seplast" text=", and "/>
+</l:context>
+<l:context name="glossary"><l:template name="see" text="See %t"/>
+<l:template name="seealso" text="See Also %t"/>
+</l:context>
+<l:context name="msgset"><l:template name="MsgAud" text="Audience: "/>
+<l:template name="MsgLevel" text="Level: "/>
+<l:template name="MsgOrig" text="Origin: "/>
+</l:context>
+<l:context name="datetime"><l:template name="format" text="m/d/Y"/>
+</l:context>
+<l:context name="termdef"><l:template name="prefix" text="[Definition: "/>
+<l:template name="suffix" text="]"/>
+</l:context>
+<l:context name="datetime-full"><l:template name="January" text="January"/>
+<l:template name="February" text="February"/>
+<l:template name="March" text="March"/>
+<l:template name="April" text="April"/>
+<l:template name="May" text="May"/>
+<l:template name="June" text="June"/>
+<l:template name="July" text="July"/>
+<l:template name="August" text="August"/>
+<l:template name="September" text="September"/>
+<l:template name="October" text="October"/>
+<l:template name="November" text="November"/>
+<l:template name="December" text="December"/>
+<l:template name="Monday" text="Monday"/>
+<l:template name="Tuesday" text="Tuesday"/>
+<l:template name="Wednesday" text="Wednesday"/>
+<l:template name="Thursday" text="Thursday"/>
+<l:template name="Friday" text="Friday"/>
+<l:template name="Saturday" text="Saturday"/>
+<l:template name="Sunday" text="Sunday"/>
+</l:context>
+<l:context name="datetime-abbrev"><l:template name="Jan" text="Jan"/>
+<l:template name="Feb" text="Feb"/>
+<l:template name="Mar" text="Mar"/>
+<l:template name="Apr" text="Apr"/>
+<l:template name="May" text="May"/>
+<l:template name="Jun" text="Jun"/>
+<l:template name="Jul" text="Jul"/>
+<l:template name="Aug" text="Aug"/>
+<l:template name="Sep" text="Sep"/>
+<l:template name="Oct" text="Oct"/>
+<l:template name="Nov" text="Nov"/>
+<l:template name="Dec" text="Dec"/>
+<l:template name="Mon" text="Mon"/>
+<l:template name="Tue" text="Tue"/>
+<l:template name="Wed" text="Wed"/>
+<l:template name="Thu" text="Thu"/>
+<l:template name="Fri" text="Fri"/>
+<l:template name="Sat" text="Sat"/>
+<l:template name="Sun" text="Sun"/>
+</l:context>
+<l:context name="htmlhelp"><l:template name="langcode" text="0x0409 English (UNITED STATES)"/>
+</l:context>
+<l:context name="index"><l:template name="term-separator" text=", "/>
+<l:template name="number-separator" text=", "/>
+<l:template name="range-separator" text="-"/>
+</l:context>
+<l:context name="iso690"><l:template name="lastfirst.sep" text=", "/>
+<l:template name="alt.person.two.sep" text=" – "/>
+<l:template name="alt.person.last.sep" text=" – "/>
+<l:template name="alt.person.more.sep" text=" – "/>
+<l:template name="primary.editor" text=" (ed.)"/>
+<l:template name="primary.many" text=", et al."/>
+<l:template name="primary.sep" text=". "/>
+<l:template name="submaintitle.sep" text=": "/>
+<l:template name="title.sep" text=". "/>
+<l:template name="othertitle.sep" text=", "/>
+<l:template name="medium1" text=" ["/>
+<l:template name="medium2" text="]"/>
+<l:template name="secondary.person.sep" text="; "/>
+<l:template name="secondary.sep" text=". "/>
+<l:template name="respons.sep" text=". "/>
+<l:template name="edition.sep" text=". "/>
+<l:template name="edition.serial.sep" text=", "/>
+<l:template name="issuing.range" text="-"/>
+<l:template name="issuing.div" text=", "/>
+<l:template name="issuing.sep" text=". "/>
+<l:template name="partnr.sep" text=". "/>
+<l:template name="placepubl.sep" text=": "/>
+<l:template name="publyear.sep" text=", "/>
+<l:template name="pubinfo.sep" text=". "/>
+<l:template name="spec.pubinfo.sep" text=", "/>
+<l:template name="upd.sep" text=", "/>
+<l:template name="datecit1" text=" [cited "/>
+<l:template name="datecit2" text="]"/>
+<l:template name="extent.sep" text=". "/>
+<l:template name="locs.sep" text=", "/>
+<l:template name="location.sep" text=". "/>
+<l:template name="serie.sep" text=". "/>
+<l:template name="notice.sep" text=". "/>
+<l:template name="access" text="Available "/>
+<l:template name="acctoo" text="Also available "/>
+<l:template name="onwww" text="from World Wide Web"/>
+<l:template name="oninet" text="from Internet"/>
+<l:template name="access.end" text=": "/>
+<l:template name="link1" text="&lt;"/>
+<l:template name="link2" text="&gt;"/>
+<l:template name="access.sep" text=". "/>
+<l:template name="isbn" text="ISBN "/>
+<l:template name="issn" text="ISSN "/>
+<l:template name="stdnum.sep" text=". "/>
+<l:template name="patcountry.sep" text=". "/>
+<l:template name="pattype.sep" text=", "/>
+<l:template name="patnum.sep" text=". "/>
+<l:template name="patdate.sep" text=". "/>
+</l:context><l:letters><l:l i="-1"/>
+<l:l i="0">Symbols</l:l>
+<l:l i="10">A</l:l>
+<l:l i="10">a</l:l>
+<l:l i="10">À</l:l>
+<l:l i="10">à</l:l>
+<l:l i="10">Á</l:l>
+<l:l i="10">á</l:l>
+<l:l i="10">Â</l:l>
+<l:l i="10">â</l:l>
+<l:l i="10">Ã</l:l>
+<l:l i="10">ã</l:l>
+<l:l i="10">Ä</l:l>
+<l:l i="10">ä</l:l>
+<l:l i="10">Å</l:l>
+<l:l i="10">å</l:l>
+<l:l i="10">Ā</l:l>
+<l:l i="10">ā</l:l>
+<l:l i="10">Ă</l:l>
+<l:l i="10">ă</l:l>
+<l:l i="10">Ą</l:l>
+<l:l i="10">ą</l:l>
+<l:l i="10">Ǎ</l:l>
+<l:l i="10">ǎ</l:l>
+<l:l i="10">Ǟ</l:l>
+<l:l i="10">ǟ</l:l>
+<l:l i="10">Ǡ</l:l>
+<l:l i="10">ǡ</l:l>
+<l:l i="10">Ǻ</l:l>
+<l:l i="10">ǻ</l:l>
+<l:l i="10">Ȁ</l:l>
+<l:l i="10">ȁ</l:l>
+<l:l i="10">Ȃ</l:l>
+<l:l i="10">ȃ</l:l>
+<l:l i="10">Ȧ</l:l>
+<l:l i="10">ȧ</l:l>
+<l:l i="10">Ḁ</l:l>
+<l:l i="10">ḁ</l:l>
+<l:l i="10">ẚ</l:l>
+<l:l i="10">Ạ</l:l>
+<l:l i="10">ạ</l:l>
+<l:l i="10">Ả</l:l>
+<l:l i="10">ả</l:l>
+<l:l i="10">Ấ</l:l>
+<l:l i="10">ấ</l:l>
+<l:l i="10">Ầ</l:l>
+<l:l i="10">ầ</l:l>
+<l:l i="10">Ẩ</l:l>
+<l:l i="10">ẩ</l:l>
+<l:l i="10">Ẫ</l:l>
+<l:l i="10">ẫ</l:l>
+<l:l i="10">Ậ</l:l>
+<l:l i="10">ậ</l:l>
+<l:l i="10">Ắ</l:l>
+<l:l i="10">ắ</l:l>
+<l:l i="10">Ằ</l:l>
+<l:l i="10">ằ</l:l>
+<l:l i="10">Ẳ</l:l>
+<l:l i="10">ẳ</l:l>
+<l:l i="10">Ẵ</l:l>
+<l:l i="10">ẵ</l:l>
+<l:l i="10">Ặ</l:l>
+<l:l i="10">ặ</l:l>
+<l:l i="20">B</l:l>
+<l:l i="20">b</l:l>
+<l:l i="20">ƀ</l:l>
+<l:l i="20">Ɓ</l:l>
+<l:l i="20">ɓ</l:l>
+<l:l i="20">Ƃ</l:l>
+<l:l i="20">ƃ</l:l>
+<l:l i="20">Ḃ</l:l>
+<l:l i="20">ḃ</l:l>
+<l:l i="20">Ḅ</l:l>
+<l:l i="20">ḅ</l:l>
+<l:l i="20">Ḇ</l:l>
+<l:l i="20">ḇ</l:l>
+<l:l i="30">C</l:l>
+<l:l i="30">c</l:l>
+<l:l i="30">Ç</l:l>
+<l:l i="30">ç</l:l>
+<l:l i="30">Ć</l:l>
+<l:l i="30">ć</l:l>
+<l:l i="30">Ĉ</l:l>
+<l:l i="30">ĉ</l:l>
+<l:l i="30">Ċ</l:l>
+<l:l i="30">ċ</l:l>
+<l:l i="30">Č</l:l>
+<l:l i="30">č</l:l>
+<l:l i="30">Ƈ</l:l>
+<l:l i="30">ƈ</l:l>
+<l:l i="30">ɕ</l:l>
+<l:l i="30">Ḉ</l:l>
+<l:l i="30">ḉ</l:l>
+<l:l i="40">D</l:l>
+<l:l i="40">d</l:l>
+<l:l i="40">Ď</l:l>
+<l:l i="40">ď</l:l>
+<l:l i="40">Đ</l:l>
+<l:l i="40">đ</l:l>
+<l:l i="40">Ɗ</l:l>
+<l:l i="40">ɗ</l:l>
+<l:l i="40">Ƌ</l:l>
+<l:l i="40">ƌ</l:l>
+<l:l i="40">Dž</l:l>
+<l:l i="40">Dz</l:l>
+<l:l i="40">ȡ</l:l>
+<l:l i="40">ɖ</l:l>
+<l:l i="40">Ḋ</l:l>
+<l:l i="40">ḋ</l:l>
+<l:l i="40">Ḍ</l:l>
+<l:l i="40">ḍ</l:l>
+<l:l i="40">Ḏ</l:l>
+<l:l i="40">ḏ</l:l>
+<l:l i="40">Ḑ</l:l>
+<l:l i="40">ḑ</l:l>
+<l:l i="40">Ḓ</l:l>
+<l:l i="40">ḓ</l:l>
+<l:l i="50">E</l:l>
+<l:l i="50">e</l:l>
+<l:l i="50">È</l:l>
+<l:l i="50">è</l:l>
+<l:l i="50">É</l:l>
+<l:l i="50">é</l:l>
+<l:l i="50">Ê</l:l>
+<l:l i="50">ê</l:l>
+<l:l i="50">Ë</l:l>
+<l:l i="50">ë</l:l>
+<l:l i="50">Ē</l:l>
+<l:l i="50">ē</l:l>
+<l:l i="50">Ĕ</l:l>
+<l:l i="50">ĕ</l:l>
+<l:l i="50">Ė</l:l>
+<l:l i="50">ė</l:l>
+<l:l i="50">Ę</l:l>
+<l:l i="50">ę</l:l>
+<l:l i="50">Ě</l:l>
+<l:l i="50">ě</l:l>
+<l:l i="50">Ȅ</l:l>
+<l:l i="50">ȅ</l:l>
+<l:l i="50">Ȇ</l:l>
+<l:l i="50">ȇ</l:l>
+<l:l i="50">Ȩ</l:l>
+<l:l i="50">ȩ</l:l>
+<l:l i="50">Ḕ</l:l>
+<l:l i="50">ḕ</l:l>
+<l:l i="50">Ḗ</l:l>
+<l:l i="50">ḗ</l:l>
+<l:l i="50">Ḙ</l:l>
+<l:l i="50">ḙ</l:l>
+<l:l i="50">Ḛ</l:l>
+<l:l i="50">ḛ</l:l>
+<l:l i="50">Ḝ</l:l>
+<l:l i="50">ḝ</l:l>
+<l:l i="50">Ẹ</l:l>
+<l:l i="50">ẹ</l:l>
+<l:l i="50">Ẻ</l:l>
+<l:l i="50">ẻ</l:l>
+<l:l i="50">Ẽ</l:l>
+<l:l i="50">ẽ</l:l>
+<l:l i="50">Ế</l:l>
+<l:l i="50">ế</l:l>
+<l:l i="50">Ề</l:l>
+<l:l i="50">ề</l:l>
+<l:l i="50">Ể</l:l>
+<l:l i="50">ể</l:l>
+<l:l i="50">Ễ</l:l>
+<l:l i="50">ễ</l:l>
+<l:l i="50">Ệ</l:l>
+<l:l i="50">ệ</l:l>
+<l:l i="60">F</l:l>
+<l:l i="60">f</l:l>
+<l:l i="60">Ƒ</l:l>
+<l:l i="60">ƒ</l:l>
+<l:l i="60">Ḟ</l:l>
+<l:l i="60">ḟ</l:l>
+<l:l i="70">G</l:l>
+<l:l i="70">g</l:l>
+<l:l i="70">Ĝ</l:l>
+<l:l i="70">ĝ</l:l>
+<l:l i="70">Ğ</l:l>
+<l:l i="70">ğ</l:l>
+<l:l i="70">Ġ</l:l>
+<l:l i="70">ġ</l:l>
+<l:l i="70">Ģ</l:l>
+<l:l i="70">ģ</l:l>
+<l:l i="70">Ɠ</l:l>
+<l:l i="70">ɠ</l:l>
+<l:l i="70">Ǥ</l:l>
+<l:l i="70">ǥ</l:l>
+<l:l i="70">Ǧ</l:l>
+<l:l i="70">ǧ</l:l>
+<l:l i="70">Ǵ</l:l>
+<l:l i="70">ǵ</l:l>
+<l:l i="70">Ḡ</l:l>
+<l:l i="70">ḡ</l:l>
+<l:l i="80">H</l:l>
+<l:l i="80">h</l:l>
+<l:l i="80">Ĥ</l:l>
+<l:l i="80">ĥ</l:l>
+<l:l i="80">Ħ</l:l>
+<l:l i="80">ħ</l:l>
+<l:l i="80">Ȟ</l:l>
+<l:l i="80">ȟ</l:l>
+<l:l i="80">ɦ</l:l>
+<l:l i="80">Ḣ</l:l>
+<l:l i="80">ḣ</l:l>
+<l:l i="80">Ḥ</l:l>
+<l:l i="80">ḥ</l:l>
+<l:l i="80">Ḧ</l:l>
+<l:l i="80">ḧ</l:l>
+<l:l i="80">Ḩ</l:l>
+<l:l i="80">ḩ</l:l>
+<l:l i="80">Ḫ</l:l>
+<l:l i="80">ḫ</l:l>
+<l:l i="80">ẖ</l:l>
+<l:l i="90">I</l:l>
+<l:l i="90">i</l:l>
+<l:l i="90">Ì</l:l>
+<l:l i="90">ì</l:l>
+<l:l i="90">Í</l:l>
+<l:l i="90">í</l:l>
+<l:l i="90">Î</l:l>
+<l:l i="90">î</l:l>
+<l:l i="90">Ï</l:l>
+<l:l i="90">ï</l:l>
+<l:l i="90">Ĩ</l:l>
+<l:l i="90">ĩ</l:l>
+<l:l i="90">Ī</l:l>
+<l:l i="90">ī</l:l>
+<l:l i="90">Ĭ</l:l>
+<l:l i="90">ĭ</l:l>
+<l:l i="90">Į</l:l>
+<l:l i="90">į</l:l>
+<l:l i="90">İ</l:l>
+<l:l i="90">Ɨ</l:l>
+<l:l i="90">ɨ</l:l>
+<l:l i="90">Ǐ</l:l>
+<l:l i="90">ǐ</l:l>
+<l:l i="90">Ȉ</l:l>
+<l:l i="90">ȉ</l:l>
+<l:l i="90">Ȋ</l:l>
+<l:l i="90">ȋ</l:l>
+<l:l i="90">Ḭ</l:l>
+<l:l i="90">ḭ</l:l>
+<l:l i="90">Ḯ</l:l>
+<l:l i="90">ḯ</l:l>
+<l:l i="90">Ỉ</l:l>
+<l:l i="90">ỉ</l:l>
+<l:l i="90">Ị</l:l>
+<l:l i="90">ị</l:l>
+<l:l i="100">J</l:l>
+<l:l i="100">j</l:l>
+<l:l i="100">Ĵ</l:l>
+<l:l i="100">ĵ</l:l>
+<l:l i="100">ǰ</l:l>
+<l:l i="100">ʝ</l:l>
+<l:l i="110">K</l:l>
+<l:l i="110">k</l:l>
+<l:l i="110">Ķ</l:l>
+<l:l i="110">ķ</l:l>
+<l:l i="110">Ƙ</l:l>
+<l:l i="110">ƙ</l:l>
+<l:l i="110">Ǩ</l:l>
+<l:l i="110">ǩ</l:l>
+<l:l i="110">Ḱ</l:l>
+<l:l i="110">ḱ</l:l>
+<l:l i="110">Ḳ</l:l>
+<l:l i="110">ḳ</l:l>
+<l:l i="110">Ḵ</l:l>
+<l:l i="110">ḵ</l:l>
+<l:l i="120">L</l:l>
+<l:l i="120">l</l:l>
+<l:l i="120">Ĺ</l:l>
+<l:l i="120">ĺ</l:l>
+<l:l i="120">Ļ</l:l>
+<l:l i="120">ļ</l:l>
+<l:l i="120">Ľ</l:l>
+<l:l i="120">ľ</l:l>
+<l:l i="120">Ŀ</l:l>
+<l:l i="120">ŀ</l:l>
+<l:l i="120">Ł</l:l>
+<l:l i="120">ł</l:l>
+<l:l i="120">ƚ</l:l>
+<l:l i="120">Lj</l:l>
+<l:l i="120">ȴ</l:l>
+<l:l i="120">ɫ</l:l>
+<l:l i="120">ɬ</l:l>
+<l:l i="120">ɭ</l:l>
+<l:l i="120">Ḷ</l:l>
+<l:l i="120">ḷ</l:l>
+<l:l i="120">Ḹ</l:l>
+<l:l i="120">ḹ</l:l>
+<l:l i="120">Ḻ</l:l>
+<l:l i="120">ḻ</l:l>
+<l:l i="120">Ḽ</l:l>
+<l:l i="120">ḽ</l:l>
+<l:l i="130">M</l:l>
+<l:l i="130">m</l:l>
+<l:l i="130">ɱ</l:l>
+<l:l i="130">Ḿ</l:l>
+<l:l i="130">ḿ</l:l>
+<l:l i="130">Ṁ</l:l>
+<l:l i="130">ṁ</l:l>
+<l:l i="130">Ṃ</l:l>
+<l:l i="130">ṃ</l:l>
+<l:l i="140">N</l:l>
+<l:l i="140">n</l:l>
+<l:l i="140">Ñ</l:l>
+<l:l i="140">ñ</l:l>
+<l:l i="140">Ń</l:l>
+<l:l i="140">ń</l:l>
+<l:l i="140">Ņ</l:l>
+<l:l i="140">ņ</l:l>
+<l:l i="140">Ň</l:l>
+<l:l i="140">ň</l:l>
+<l:l i="140">Ɲ</l:l>
+<l:l i="140">ɲ</l:l>
+<l:l i="140">ƞ</l:l>
+<l:l i="140">Ƞ</l:l>
+<l:l i="140">Nj</l:l>
+<l:l i="140">Ǹ</l:l>
+<l:l i="140">ǹ</l:l>
+<l:l i="140">ȵ</l:l>
+<l:l i="140">ɳ</l:l>
+<l:l i="140">Ṅ</l:l>
+<l:l i="140">ṅ</l:l>
+<l:l i="140">Ṇ</l:l>
+<l:l i="140">ṇ</l:l>
+<l:l i="140">Ṉ</l:l>
+<l:l i="140">ṉ</l:l>
+<l:l i="140">Ṋ</l:l>
+<l:l i="140">ṋ</l:l>
+<l:l i="150">O</l:l>
+<l:l i="150">o</l:l>
+<l:l i="150">Ò</l:l>
+<l:l i="150">ò</l:l>
+<l:l i="150">Ó</l:l>
+<l:l i="150">ó</l:l>
+<l:l i="150">Ô</l:l>
+<l:l i="150">ô</l:l>
+<l:l i="150">Õ</l:l>
+<l:l i="150">õ</l:l>
+<l:l i="150">Ö</l:l>
+<l:l i="150">ö</l:l>
+<l:l i="150">Ø</l:l>
+<l:l i="150">ø</l:l>
+<l:l i="150">Ō</l:l>
+<l:l i="150">ō</l:l>
+<l:l i="150">Ŏ</l:l>
+<l:l i="150">ŏ</l:l>
+<l:l i="150">Ő</l:l>
+<l:l i="150">ő</l:l>
+<l:l i="150">Ɵ</l:l>
+<l:l i="150">Ơ</l:l>
+<l:l i="150">ơ</l:l>
+<l:l i="150">Ǒ</l:l>
+<l:l i="150">ǒ</l:l>
+<l:l i="150">Ǫ</l:l>
+<l:l i="150">ǫ</l:l>
+<l:l i="150">Ǭ</l:l>
+<l:l i="150">ǭ</l:l>
+<l:l i="150">Ǿ</l:l>
+<l:l i="150">ǿ</l:l>
+<l:l i="150">Ȍ</l:l>
+<l:l i="150">ȍ</l:l>
+<l:l i="150">Ȏ</l:l>
+<l:l i="150">ȏ</l:l>
+<l:l i="150">Ȫ</l:l>
+<l:l i="150">ȫ</l:l>
+<l:l i="150">Ȭ</l:l>
+<l:l i="150">ȭ</l:l>
+<l:l i="150">Ȯ</l:l>
+<l:l i="150">ȯ</l:l>
+<l:l i="150">Ȱ</l:l>
+<l:l i="150">ȱ</l:l>
+<l:l i="150">Ṍ</l:l>
+<l:l i="150">ṍ</l:l>
+<l:l i="150">Ṏ</l:l>
+<l:l i="150">ṏ</l:l>
+<l:l i="150">Ṑ</l:l>
+<l:l i="150">ṑ</l:l>
+<l:l i="150">Ṓ</l:l>
+<l:l i="150">ṓ</l:l>
+<l:l i="150">Ọ</l:l>
+<l:l i="150">ọ</l:l>
+<l:l i="150">Ỏ</l:l>
+<l:l i="150">ỏ</l:l>
+<l:l i="150">Ố</l:l>
+<l:l i="150">ố</l:l>
+<l:l i="150">Ồ</l:l>
+<l:l i="150">ồ</l:l>
+<l:l i="150">Ổ</l:l>
+<l:l i="150">ổ</l:l>
+<l:l i="150">Ỗ</l:l>
+<l:l i="150">ỗ</l:l>
+<l:l i="150">Ộ</l:l>
+<l:l i="150">ộ</l:l>
+<l:l i="150">Ớ</l:l>
+<l:l i="150">ớ</l:l>
+<l:l i="150">Ờ</l:l>
+<l:l i="150">ờ</l:l>
+<l:l i="150">Ở</l:l>
+<l:l i="150">ở</l:l>
+<l:l i="150">Ỡ</l:l>
+<l:l i="150">ỡ</l:l>
+<l:l i="150">Ợ</l:l>
+<l:l i="150">ợ</l:l>
+<l:l i="160">P</l:l>
+<l:l i="160">p</l:l>
+<l:l i="160">Ƥ</l:l>
+<l:l i="160">ƥ</l:l>
+<l:l i="160">Ṕ</l:l>
+<l:l i="160">ṕ</l:l>
+<l:l i="160">Ṗ</l:l>
+<l:l i="160">ṗ</l:l>
+<l:l i="170">Q</l:l>
+<l:l i="170">q</l:l>
+<l:l i="170">ʠ</l:l>
+<l:l i="180">R</l:l>
+<l:l i="180">r</l:l>
+<l:l i="180">Ŕ</l:l>
+<l:l i="180">ŕ</l:l>
+<l:l i="180">Ŗ</l:l>
+<l:l i="180">ŗ</l:l>
+<l:l i="180">Ř</l:l>
+<l:l i="180">ř</l:l>
+<l:l i="180">Ȑ</l:l>
+<l:l i="180">ȑ</l:l>
+<l:l i="180">Ȓ</l:l>
+<l:l i="180">ȓ</l:l>
+<l:l i="180">ɼ</l:l>
+<l:l i="180">ɽ</l:l>
+<l:l i="180">ɾ</l:l>
+<l:l i="180">Ṙ</l:l>
+<l:l i="180">ṙ</l:l>
+<l:l i="180">Ṛ</l:l>
+<l:l i="180">ṛ</l:l>
+<l:l i="180">Ṝ</l:l>
+<l:l i="180">ṝ</l:l>
+<l:l i="180">Ṟ</l:l>
+<l:l i="180">ṟ</l:l>
+<l:l i="190">S</l:l>
+<l:l i="190">s</l:l>
+<l:l i="190">Ś</l:l>
+<l:l i="190">ś</l:l>
+<l:l i="190">Ŝ</l:l>
+<l:l i="190">ŝ</l:l>
+<l:l i="190">Ş</l:l>
+<l:l i="190">ş</l:l>
+<l:l i="190">Š</l:l>
+<l:l i="190">š</l:l>
+<l:l i="190">Ș</l:l>
+<l:l i="190">ș</l:l>
+<l:l i="190">ʂ</l:l>
+<l:l i="190">Ṡ</l:l>
+<l:l i="190">ṡ</l:l>
+<l:l i="190">Ṣ</l:l>
+<l:l i="190">ṣ</l:l>
+<l:l i="190">Ṥ</l:l>
+<l:l i="190">ṥ</l:l>
+<l:l i="190">Ṧ</l:l>
+<l:l i="190">ṧ</l:l>
+<l:l i="190">Ṩ</l:l>
+<l:l i="190">ṩ</l:l>
+<l:l i="200">T</l:l>
+<l:l i="200">t</l:l>
+<l:l i="200">Ţ</l:l>
+<l:l i="200">ţ</l:l>
+<l:l i="200">Ť</l:l>
+<l:l i="200">ť</l:l>
+<l:l i="200">Ŧ</l:l>
+<l:l i="200">ŧ</l:l>
+<l:l i="200">ƫ</l:l>
+<l:l i="200">Ƭ</l:l>
+<l:l i="200">ƭ</l:l>
+<l:l i="200">Ʈ</l:l>
+<l:l i="200">ʈ</l:l>
+<l:l i="200">Ț</l:l>
+<l:l i="200">ț</l:l>
+<l:l i="200">ȶ</l:l>
+<l:l i="200">Ṫ</l:l>
+<l:l i="200">ṫ</l:l>
+<l:l i="200">Ṭ</l:l>
+<l:l i="200">ṭ</l:l>
+<l:l i="200">Ṯ</l:l>
+<l:l i="200">ṯ</l:l>
+<l:l i="200">Ṱ</l:l>
+<l:l i="200">ṱ</l:l>
+<l:l i="200">ẗ</l:l>
+<l:l i="210">U</l:l>
+<l:l i="210">u</l:l>
+<l:l i="210">Ù</l:l>
+<l:l i="210">ù</l:l>
+<l:l i="210">Ú</l:l>
+<l:l i="210">ú</l:l>
+<l:l i="210">Û</l:l>
+<l:l i="210">û</l:l>
+<l:l i="210">Ü</l:l>
+<l:l i="210">ü</l:l>
+<l:l i="210">Ũ</l:l>
+<l:l i="210">ũ</l:l>
+<l:l i="210">Ū</l:l>
+<l:l i="210">ū</l:l>
+<l:l i="210">Ŭ</l:l>
+<l:l i="210">ŭ</l:l>
+<l:l i="210">Ů</l:l>
+<l:l i="210">ů</l:l>
+<l:l i="210">Ű</l:l>
+<l:l i="210">ű</l:l>
+<l:l i="210">Ų</l:l>
+<l:l i="210">ų</l:l>
+<l:l i="210">Ư</l:l>
+<l:l i="210">ư</l:l>
+<l:l i="210">Ǔ</l:l>
+<l:l i="210">ǔ</l:l>
+<l:l i="210">Ǖ</l:l>
+<l:l i="210">ǖ</l:l>
+<l:l i="210">Ǘ</l:l>
+<l:l i="210">ǘ</l:l>
+<l:l i="210">Ǚ</l:l>
+<l:l i="210">ǚ</l:l>
+<l:l i="210">Ǜ</l:l>
+<l:l i="210">ǜ</l:l>
+<l:l i="210">Ȕ</l:l>
+<l:l i="210">ȕ</l:l>
+<l:l i="210">Ȗ</l:l>
+<l:l i="210">ȗ</l:l>
+<l:l i="210">Ṳ</l:l>
+<l:l i="210">ṳ</l:l>
+<l:l i="210">Ṵ</l:l>
+<l:l i="210">ṵ</l:l>
+<l:l i="210">Ṷ</l:l>
+<l:l i="210">ṷ</l:l>
+<l:l i="210">Ṹ</l:l>
+<l:l i="210">ṹ</l:l>
+<l:l i="210">Ṻ</l:l>
+<l:l i="210">ṻ</l:l>
+<l:l i="210">Ụ</l:l>
+<l:l i="210">ụ</l:l>
+<l:l i="210">Ủ</l:l>
+<l:l i="210">ủ</l:l>
+<l:l i="210">Ứ</l:l>
+<l:l i="210">ứ</l:l>
+<l:l i="210">Ừ</l:l>
+<l:l i="210">ừ</l:l>
+<l:l i="210">Ử</l:l>
+<l:l i="210">ử</l:l>
+<l:l i="210">Ữ</l:l>
+<l:l i="210">ữ</l:l>
+<l:l i="210">Ự</l:l>
+<l:l i="210">ự</l:l>
+<l:l i="220">V</l:l>
+<l:l i="220">v</l:l>
+<l:l i="220">Ʋ</l:l>
+<l:l i="220">ʋ</l:l>
+<l:l i="220">Ṽ</l:l>
+<l:l i="220">ṽ</l:l>
+<l:l i="220">Ṿ</l:l>
+<l:l i="220">ṿ</l:l>
+<l:l i="230">W</l:l>
+<l:l i="230">w</l:l>
+<l:l i="230">Ŵ</l:l>
+<l:l i="230">ŵ</l:l>
+<l:l i="230">Ẁ</l:l>
+<l:l i="230">ẁ</l:l>
+<l:l i="230">Ẃ</l:l>
+<l:l i="230">ẃ</l:l>
+<l:l i="230">Ẅ</l:l>
+<l:l i="230">ẅ</l:l>
+<l:l i="230">Ẇ</l:l>
+<l:l i="230">ẇ</l:l>
+<l:l i="230">Ẉ</l:l>
+<l:l i="230">ẉ</l:l>
+<l:l i="230">ẘ</l:l>
+<l:l i="240">X</l:l>
+<l:l i="240">x</l:l>
+<l:l i="240">Ẋ</l:l>
+<l:l i="240">ẋ</l:l>
+<l:l i="240">Ẍ</l:l>
+<l:l i="240">ẍ</l:l>
+<l:l i="250">Y</l:l>
+<l:l i="250">y</l:l>
+<l:l i="250">Ý</l:l>
+<l:l i="250">ý</l:l>
+<l:l i="250">ÿ</l:l>
+<l:l i="250">Ÿ</l:l>
+<l:l i="250">Ŷ</l:l>
+<l:l i="250">ŷ</l:l>
+<l:l i="250">Ƴ</l:l>
+<l:l i="250">ƴ</l:l>
+<l:l i="250">Ȳ</l:l>
+<l:l i="250">ȳ</l:l>
+<l:l i="250">Ẏ</l:l>
+<l:l i="250">ẏ</l:l>
+<l:l i="250">ẙ</l:l>
+<l:l i="250">Ỳ</l:l>
+<l:l i="250">ỳ</l:l>
+<l:l i="250">Ỵ</l:l>
+<l:l i="250">ỵ</l:l>
+<l:l i="250">Ỷ</l:l>
+<l:l i="250">ỷ</l:l>
+<l:l i="250">Ỹ</l:l>
+<l:l i="250">ỹ</l:l>
+<l:l i="260">Z</l:l>
+<l:l i="260">z</l:l>
+<l:l i="260">Ź</l:l>
+<l:l i="260">ź</l:l>
+<l:l i="260">Ż</l:l>
+<l:l i="260">ż</l:l>
+<l:l i="260">Ž</l:l>
+<l:l i="260">ž</l:l>
+<l:l i="260">Ƶ</l:l>
+<l:l i="260">ƶ</l:l>
+<l:l i="260">Ȥ</l:l>
+<l:l i="260">ȥ</l:l>
+<l:l i="260">ʐ</l:l>
+<l:l i="260">ʑ</l:l>
+<l:l i="260">Ẑ</l:l>
+<l:l i="260">ẑ</l:l>
+<l:l i="260">Ẓ</l:l>
+<l:l i="260">ẓ</l:l>
+<l:l i="260">Ẕ</l:l>
+<l:l i="260">ẕ</l:l>
+</l:letters>
+</l:l10n>

File diff suppressed because it is too large
+ 15 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/entities.ent


+ 663 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/es.xml

@@ -0,0 +1,663 @@
+<?xml version="1.0" encoding="utf-8"?>
+<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="es" english-language-name="Spanish">
+
+<!-- * This file is generated automatically. -->
+<!-- * To submit changes to this file upstream (to the DocBook Project) -->
+<!-- * do not submit an edited version of this file. Instead, submit an -->
+<!-- * edited version of the source file at the following location: -->
+<!-- * -->
+<!-- *  https://svn.sourceforge.net/svnroot/docbook/trunk/gentext/locale/es.xml -->
+<!-- * -->
+<!-- * E-mail the edited es.xml source file to: -->
+<!-- * -->
+<!-- *  docbook-developers@lists.sourceforge.net -->
+
+<!-- ******************************************************************** -->
+
+<!-- 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. -->
+
+<!-- ******************************************************************** -->
+
+<l:gentext key="Abstract" text="Resumen"/>
+<l:gentext key="abstract" text="resumen"/>
+<l:gentext key="Answer" text="R:"/>
+<l:gentext key="answer" text="r:"/>
+<l:gentext key="Appendix" text="Apéndice"/>
+<l:gentext key="appendix" text="apéndice"/>
+<l:gentext key="Article" text="Artículo"/>
+<l:gentext key="article" text="artículo"/>
+<l:gentext key="Author" text="Autor"/>
+<l:gentext key="Bibliography" text="Bibliografía"/>
+<l:gentext key="bibliography" text="bibliografía"/>
+<l:gentext key="Book" text="Libro"/>
+<l:gentext key="book" text="libro"/>
+<l:gentext key="CAUTION" text="ATENCIÓN"/>
+<l:gentext key="Caution" text="Atención"/>
+<l:gentext key="caution" text="atención"/>
+<l:gentext key="Chapter" text="Capítulo"/>
+<l:gentext key="chapter" text="capítulo"/>
+<l:gentext key="Colophon" text="Colofón"/>
+<l:gentext key="colophon" text="colofón"/>
+<l:gentext key="Copyright" text="Copyright"/>
+<l:gentext key="copyright" text="copyright"/>
+<l:gentext key="Dedication" text="Dedicatoria"/>
+<l:gentext key="dedication" text="dedicatoria"/>
+<l:gentext key="Edition" text="Edición"/>
+<l:gentext key="edition" text="edición"/>
+<l:gentext key="Editor" text="Editor" lang="en"/>
+<l:gentext key="Equation" text="Ecuación"/>
+<l:gentext key="equation" text="ecuación"/>
+<l:gentext key="Example" text="Ejemplo"/>
+<l:gentext key="example" text="ejemplo"/>
+<l:gentext key="Figure" text="Figura"/>
+<l:gentext key="figure" text="figura"/>
+<l:gentext key="Glossary" text="Glosario"/>
+<l:gentext key="glossary" text="glosario"/>
+<l:gentext key="GlossSee" text="Ver"/>
+<l:gentext key="glosssee" text="ver"/>
+<l:gentext key="GlossSeeAlso" text="Ver también"/>
+<l:gentext key="glossseealso" text="ver también"/>
+<l:gentext key="IMPORTANT" text="IMPORTANTE"/>
+<l:gentext key="important" text="importante"/>
+<l:gentext key="Important" text="Importante"/>
+<l:gentext key="Index" text="Índice"/>
+<l:gentext key="index" text="índice"/>
+<l:gentext key="ISBN" text="ISBN"/>
+<l:gentext key="isbn" text="isbn"/>
+<l:gentext key="LegalNotice" text="Aviso Legal"/>
+<l:gentext key="legalnotice" text="aviso legal"/>
+<l:gentext key="MsgAud" text="Audiencia"/>
+<l:gentext key="msgaud" text="audiencia"/>
+<l:gentext key="MsgLevel" text="Nivel"/>
+<l:gentext key="msglevel" text="nivel"/>
+<l:gentext key="MsgOrig" text="Origen"/>
+<l:gentext key="msgorig" text="origen"/>
+<l:gentext key="NOTE" text="NOTA"/>
+<l:gentext key="Note" text="Nota"/>
+<l:gentext key="note" text="nota"/>
+<l:gentext key="Part" text="Parte"/>
+<l:gentext key="part" text="parte"/>
+<l:gentext key="Preface" text="Prefacio"/>
+<l:gentext key="preface" text="prefacio"/>
+<l:gentext key="Procedure" text="Procedimiento"/>
+<l:gentext key="procedure" text="procedimiento"/>
+<l:gentext key="ProductionSet" text="Producción"/>
+<l:gentext key="PubDate" text="Fecha de publicación"/>
+<l:gentext key="pubdate" text="fecha de publicación"/>
+<l:gentext key="Published" text="Publicado"/>
+<l:gentext key="published" text="publicado"/>
+<l:gentext key="Publisher" text="Publisher" lang="en"/>
+<l:gentext key="Qandadiv" text="P y R"/>
+<l:gentext key="qandadiv" text="P y R"/>
+<l:gentext key="QandASet" text="Frequently Asked Questions" lang="en"/>
+<l:gentext key="Question" text="P:"/>
+<l:gentext key="question" text="p:"/>
+<l:gentext key="RefEntry" text="Entrada de referencia"/>
+<l:gentext key="refentry" text="entrada de referencia"/>
+<l:gentext key="Reference" text="Referencia"/>
+<l:gentext key="reference" text="referencia"/>
+<l:gentext key="References" text="References" lang="en"/>
+<l:gentext key="RefName" text="Nombre de referencia"/>
+<l:gentext key="refname" text="nombre de referencia"/>
+<l:gentext key="RefSection" text="Sección de referencia"/>
+<l:gentext key="refsection" text="sección de referencia"/>
+<l:gentext key="RefSynopsisDiv" text="Sinopsis"/>
+<l:gentext key="refsynopsisdiv" text="sinopsis"/>
+<l:gentext key="RevHistory" text="Historial de revisiones"/>
+<l:gentext key="revhistory" text="Historial de revisiones"/>
+<l:gentext key="revision" text="revisión"/>
+<l:gentext key="Revision" text="Revisión"/>
+<l:gentext key="sect1" text="Sección"/>
+<l:gentext key="sect2" text="Sección"/>
+<l:gentext key="sect3" text="Sección"/>
+<l:gentext key="sect4" text="Sección"/>
+<l:gentext key="sect5" text="Sección"/>
+<l:gentext key="section" text="sección"/>
+<l:gentext key="Section" text="Sección"/>
+<l:gentext key="see" text="ver"/>
+<l:gentext key="See" text="Ver"/>
+<l:gentext key="seealso" text="ver también"/>
+<l:gentext key="Seealso" text="Ver también"/>
+<l:gentext key="SeeAlso" text="Ver También"/>
+<l:gentext key="set" text="conjunto"/>
+<l:gentext key="Set" text="Conjunto"/>
+<l:gentext key="setindex" text="índice del conjunto"/>
+<l:gentext key="SetIndex" text="Índice del Conjunto"/>
+<l:gentext key="Sidebar" text="Barra lateral"/>
+<l:gentext key="sidebar" text="barra lateral"/>
+<l:gentext key="step" text="paso"/>
+<l:gentext key="Step" text="Paso"/>
+<l:gentext key="table" text="tabla"/>
+<l:gentext key="Table" text="Tabla"/>
+<l:gentext key="task" text="Task" lang="en"/>
+<l:gentext key="Task" text="Task" lang="en"/>
+<l:gentext key="tip" text="sugerencia"/>
+<l:gentext key="TIP" text="SUGERENCIA"/>
+<l:gentext key="Tip" text="Sugerencia"/>
+<l:gentext key="Warning" text="Aviso"/>
+<l:gentext key="warning" text="aviso"/>
+<l:gentext key="WARNING" text="AVISO"/>
+<l:gentext key="and" text="y"/>
+<l:gentext key="by" text="por"/>
+<l:gentext key="Edited" text="Editado"/>
+<l:gentext key="edited" text="editado"/>
+<l:gentext key="Editedby" text="Editado por"/>
+<l:gentext key="editedby" text="editado por"/>
+<l:gentext key="in" text="en"/>
+<l:gentext key="lastlistcomma" text=","/>
+<l:gentext key="listcomma" text=","/>
+<l:gentext key="nonexistantelement" text="elemento inexistente"/>
+<l:gentext key="notes" text="notas"/>
+<l:gentext key="Notes" text="Notas"/>
+<l:gentext key="Pgs" text="Págs."/>
+<l:gentext key="pgs" text="págs."/>
+<l:gentext key="Revisedby" text="Revisado por: "/>
+<l:gentext key="revisedby" text="revisado por: "/>
+<l:gentext key="TableNotes" text="Notas de tabla"/>
+<l:gentext key="tablenotes" text="notas de tabla"/>
+<l:gentext key="TableofContents" text="Tabla de contenidos"/>
+<l:gentext key="tableofcontents" text="tabla de contenidos"/>
+<l:gentext key="unexpectedelementname" text="nombre de elemento inesperado"/>
+<l:gentext key="unsupported" text="no soportado"/>
+<l:gentext key="xrefto" text="referencia a"/>
+<l:gentext key="Authors" text="Authors" lang="en"/>
+<l:gentext key="copyeditor" text="Copy Editor" lang="en"/>
+<l:gentext key="graphicdesigner" text="Graphic Designer" lang="en"/>
+<l:gentext key="productioneditor" text="Production Editor" lang="en"/>
+<l:gentext key="technicaleditor" text="Technical Editor" lang="en"/>
+<l:gentext key="translator" text="Translator" lang="en"/>
+<l:gentext key="listofequations" text="lista de ecuaciones"/>
+<l:gentext key="ListofEquations" text="Lista de ecuaciones"/>
+<l:gentext key="ListofExamples" text="Lista de ejemplos"/>
+<l:gentext key="listofexamples" text="lista de ejemplos"/>
+<l:gentext key="ListofFigures" text="Lista de figuras"/>
+<l:gentext key="listoffigures" text="lista de figuras"/>
+<l:gentext key="ListofProcedures" text="List of Procedures" lang="en"/>
+<l:gentext key="listofprocedures" text="List of Procedures" lang="en"/>
+<l:gentext key="listoftables" text="lista de tablas"/>
+<l:gentext key="ListofTables" text="Lista de tablas"/>
+<l:gentext key="ListofUnknown" text="Lista de desconocido"/>
+<l:gentext key="listofunknown" text="lista de desconocido"/>
+<l:gentext key="nav-home" text="Inicio"/>
+<l:gentext key="nav-next" text="Siguiente"/>
+<l:gentext key="nav-next-sibling" text="Avanzar"/>
+<l:gentext key="nav-prev" text="Anterior"/>
+<l:gentext key="nav-prev-sibling" text="Retroceder"/>
+<l:gentext key="nav-up" text="Subir"/>
+<l:gentext key="nav-toc" text="ToC" lang="en"/>
+<l:gentext key="Draft" text="Borrador"/>
+<l:gentext key="above" text="arriba"/>
+<l:gentext key="below" text="abajo"/>
+<l:gentext key="sectioncalled" text="sección llamada"/>
+<l:gentext key="index symbols" text="Símbolos"/>
+<l:gentext key="lowercase.alpha" text="abcdefghijklmnopqrstuvwxyzáéíóúñ"/>
+<l:gentext key="uppercase.alpha" text="ABCDEFGHIJKLMNOPQRSTUVWXYZÁÉÍÓÚÑ"/>
+<l:gentext key="normalize.sort.input" text="AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ" lang="en"/>
+<l:gentext key="normalize.sort.output" text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ" lang="en"/>
+<l:dingbat key="startquote" text="“"/>
+<l:dingbat key="endquote" text="”"/>
+<l:dingbat key="nestedstartquote" text="‘"/>
+<l:dingbat key="nestedendquote" text="’"/>
+<l:dingbat key="singlestartquote" text="‘" lang="en"/>
+<l:dingbat key="singleendquote" text="’" lang="en"/>
+<l:dingbat key="bullet" text="•"/>
+<l:gentext key="hyphenation-character" text="-" lang="en"/>
+<l:gentext key="hyphenation-push-character-count" text="2" lang="en"/>
+<l:gentext key="hyphenation-remain-character-count" text="2" lang="en"/>
+<l:context name="styles"><l:template name="person-name" text="first-last"/>
+</l:context>
+<l:context name="title"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="%t"/>
+<l:template name="appendix" text="Apéndice %n. %t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="biblioentry" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliolist" text="%t" lang="en"/>
+<l:template name="bibliomixed" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="Capítulo %n. %t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="Ecuación %n. %t"/>
+<l:template name="example" text="Ejemplo %n. %t"/>
+<l:template name="figure" text="Figura %n. %t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="glosslist" text="%t" lang="en"/>
+<l:template name="glossentry" text="%t" lang="en"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text=""/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="Parte %n. %t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="procedure.formal" text="Procedimiento %n. %t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="productionset.formal" text="Producción %n"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="%t"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="%t"/>
+<l:template name="refentry" text="%t"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsection" text="%t"/>
+<l:template name="refsect1" text="%t"/>
+<l:template name="refsect2" text="%t"/>
+<l:template name="refsect3" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="refsynopsisdivinfo" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="step" text="%t"/>
+<l:template name="table" text="Tabla %n. %t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tasksummary" text="%t" lang="en"/>
+<l:template name="taskprerequisites" text="%t" lang="en"/>
+<l:template name="taskrelated" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="" lang="en"/>
+<l:template name="warning" text="%t"/>
+</l:context>
+<l:context name="title-unnumbered"><l:template name="appendix" text="%t"/>
+<l:template name="article/appendix" text="%t" lang="en"/>
+<l:template name="bridgehead" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="sect1" text="%t"/>
+<l:template name="sect2" text="%t"/>
+<l:template name="sect3" text="%t"/>
+<l:template name="sect4" text="%t"/>
+<l:template name="sect5" text="%t"/>
+<l:template name="section" text="%t"/>
+<l:template name="simplesect" text="%t"/>
+<l:template name="part" text="%t" lang="en"/>
+</l:context>
+<l:context name="title-numbered"><l:template name="appendix" text="Apéndice %n. %t"/>
+<l:template name="article/appendix" text="%n. %t" lang="en"/>
+<l:template name="bridgehead" text="%n. %t"/>
+<l:template name="chapter" text="Capítulo %n. %t"/>
+<l:template name="part" text="Parte %n. %t"/>
+<l:template name="sect1" text="%n. %t"/>
+<l:template name="sect2" text="%n. %t"/>
+<l:template name="sect3" text="%n. %t"/>
+<l:template name="sect4" text="%n. %t"/>
+<l:template name="sect5" text="%n. %t"/>
+<l:template name="section" text="%n. %t"/>
+<l:template name="simplesect" text="%t"/>
+</l:context>
+<l:context name="subtitle"><l:template name="appendix" text="%s"/>
+<l:template name="article" text="%s"/>
+<l:template name="bibliodiv" text="%s"/>
+<l:template name="biblioentry" text="%s"/>
+<l:template name="bibliography" text="%s"/>
+<l:template name="bibliomixed" text="%s"/>
+<l:template name="bibliomset" text="%s"/>
+<l:template name="biblioset" text="%s"/>
+<l:template name="book" text="%s"/>
+<l:template name="chapter" text="%s"/>
+<l:template name="colophon" text="%s"/>
+<l:template name="dedication" text="%s"/>
+<l:template name="glossary" text="%s"/>
+<l:template name="glossdiv" text="%s"/>
+<l:template name="index" text="%s"/>
+<l:template name="indexdiv" text="%s"/>
+<l:template name="lot" text="%s"/>
+<l:template name="part" text="%s"/>
+<l:template name="partintro" text="%s"/>
+<l:template name="preface" text="%s"/>
+<l:template name="refentry" text="%s"/>
+<l:template name="reference" text="%s"/>
+<l:template name="refsection" text="%s"/>
+<l:template name="refsect1" text="%s"/>
+<l:template name="refsect2" text="%s"/>
+<l:template name="refsect3" text="%s"/>
+<l:template name="refsynopsisdiv" text="%s"/>
+<l:template name="sect1" text="%s"/>
+<l:template name="sect2" text="%s"/>
+<l:template name="sect3" text="%s"/>
+<l:template name="sect4" text="%s"/>
+<l:template name="sect5" text="%s"/>
+<l:template name="section" text="%s"/>
+<l:template name="set" text="%s"/>
+<l:template name="setindex" text="%s"/>
+<l:template name="sidebar" text="%s"/>
+<l:template name="simplesect" text="%s"/>
+<l:template name="toc" text="%s"/>
+</l:context>
+<l:context name="xref"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="R: %n"/>
+<l:template name="appendix" text="%t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="constraintdef" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="%t"/>
+<l:template name="example" text="%t"/>
+<l:template name="figure" text="%t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text="%n"/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="%t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="P: %n"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="P: %n"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="table" text="%t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="%n"/>
+<l:template name="warning" text="%t"/>
+<l:template name="olink.document.citation" text=" in %o" lang="en"/>
+<l:template name="olink.page.citation" text=" (page %p)" lang="en"/>
+<l:template name="page.citation" text=" [%p]"/>
+<l:template name="page" text="(page %p)" lang="en"/>
+<l:template name="docname" text=" in %o" lang="en"/>
+<l:template name="docnamelong" text=" in the document titled %o" lang="en"/>
+<l:template name="pageabbrev" text="(p. %p)" lang="en"/>
+<l:template name="Page" text="Page %p" lang="en"/>
+<l:template name="bridgehead" text="“%t”"/>
+<l:template name="refsection" text="“%t”"/>
+<l:template name="refsect1" text="“%t”"/>
+<l:template name="refsect2" text="“%t”"/>
+<l:template name="refsect3" text="“%t”"/>
+<l:template name="sect1" text="“%t”"/>
+<l:template name="sect2" text="“%t”"/>
+<l:template name="sect3" text="“%t”"/>
+<l:template name="sect4" text="“%t”"/>
+<l:template name="sect5" text="“%t”"/>
+<l:template name="section" text="“%t”"/>
+<l:template name="simplesect" text="“%t”"/>
+</l:context>
+<l:context name="xref-number"><l:template name="answer" text="R: %n"/>
+<l:template name="appendix" text="Apéndice %n"/>
+<l:template name="bridgehead" text="Sección %n"/>
+<l:template name="chapter" text="Capítulo %n"/>
+<l:template name="equation" text="Ecuación %n"/>
+<l:template name="example" text="Ejemplo %n"/>
+<l:template name="figure" text="Figura %n"/>
+<l:template name="part" text="Parte %n"/>
+<l:template name="procedure" text="Procedimiento %n"/>
+<l:template name="productionset" text="Producción %n"/>
+<l:template name="qandadiv" text="P y R %n"/>
+<l:template name="qandaentry" text="P: %n"/>
+<l:template name="question" text="P: %n"/>
+<l:template name="sect1" text="Sección %n"/>
+<l:template name="sect2" text="Sección %n"/>
+<l:template name="sect3" text="Sección %n"/>
+<l:template name="sect4" text="Sección %n"/>
+<l:template name="sect5" text="Sección %n"/>
+<l:template name="section" text="Sección %n"/>
+<l:template name="table" text="Tabla %n"/>
+</l:context>
+<l:context name="xref-number-and-title"><l:template name="appendix" text="Apéndice %n, %t"/>
+<l:template name="bridgehead" text="Sección %n, “%t”"/>
+<l:template name="chapter" text="Capítulo %n, %t"/>
+<l:template name="equation" text="Ecuación %n, “%t”"/>
+<l:template name="example" text="Ejemplo %n, “%t”"/>
+<l:template name="figure" text="Figura %n, “%t”"/>
+<l:template name="part" text="Parte %n, “%t”"/>
+<l:template name="procedure" text="Procedimiento %n, “%t”"/>
+<l:template name="productionset" text="Producción %n, “%t”"/>
+<l:template name="qandadiv" text="P y R %n, “%t”"/>
+<l:template name="refsect1" text="sección llamada “%t”"/>
+<l:template name="refsect2" text="sección llamada “%t”"/>
+<l:template name="refsect3" text="sección llamada “%t”"/>
+<l:template name="refsection" text="sección llamada “%t”"/>
+<l:template name="sect1" text="Sección %n, “%t”"/>
+<l:template name="sect2" text="Sección %n, “%t”"/>
+<l:template name="sect3" text="Sección %n, “%t”"/>
+<l:template name="sect4" text="Sección %n, “%t”"/>
+<l:template name="sect5" text="Sección %n, “%t”"/>
+<l:template name="section" text="Sección %n, “%t”"/>
+<l:template name="simplesect" text="sección llamada “%t”"/>
+<l:template name="table" text="Tabla %n, “%t”"/>
+</l:context>
+<l:context name="authorgroup"><l:template name="sep" text=", "/>
+<l:template name="sep2" text=" y "/>
+<l:template name="seplast" text=", y "/>
+</l:context>
+<l:context name="glossary"><l:template name="see" text="Ver %t"/>
+<l:template name="seealso" text="Ver también %t"/>
+</l:context>
+<l:context name="msgset"><l:template name="MsgAud" text="Audiencia: "/>
+<l:template name="MsgLevel" text="Nivel: "/>
+<l:template name="MsgOrig" text="Origen: "/>
+</l:context>
+<l:context name="datetime"><l:template name="format" text="m/d/Y" lang="en"/>
+</l:context>
+<l:context name="termdef"><l:template name="prefix" text="[Definition: " lang="en"/>
+<l:template name="suffix" text="]" lang="en"/>
+</l:context>
+<l:context name="datetime-full"><l:template name="January" text="January" lang="en"/>
+<l:template name="February" text="February" lang="en"/>
+<l:template name="March" text="March" lang="en"/>
+<l:template name="April" text="April" lang="en"/>
+<l:template name="May" text="May" lang="en"/>
+<l:template name="June" text="June" lang="en"/>
+<l:template name="July" text="July" lang="en"/>
+<l:template name="August" text="August" lang="en"/>
+<l:template name="September" text="September" lang="en"/>
+<l:template name="October" text="October" lang="en"/>
+<l:template name="November" text="November" lang="en"/>
+<l:template name="December" text="December" lang="en"/>
+<l:template name="Monday" text="Monday" lang="en"/>
+<l:template name="Tuesday" text="Tuesday" lang="en"/>
+<l:template name="Wednesday" text="Wednesday" lang="en"/>
+<l:template name="Thursday" text="Thursday" lang="en"/>
+<l:template name="Friday" text="Friday" lang="en"/>
+<l:template name="Saturday" text="Saturday" lang="en"/>
+<l:template name="Sunday" text="Sunday" lang="en"/>
+</l:context>
+<l:context name="datetime-abbrev"><l:template name="Jan" text="Jan" lang="en"/>
+<l:template name="Feb" text="Feb" lang="en"/>
+<l:template name="Mar" text="Mar" lang="en"/>
+<l:template name="Apr" text="Apr" lang="en"/>
+<l:template name="May" text="May" lang="en"/>
+<l:template name="Jun" text="Jun" lang="en"/>
+<l:template name="Jul" text="Jul" lang="en"/>
+<l:template name="Aug" text="Aug" lang="en"/>
+<l:template name="Sep" text="Sep" lang="en"/>
+<l:template name="Oct" text="Oct" lang="en"/>
+<l:template name="Nov" text="Nov" lang="en"/>
+<l:template name="Dec" text="Dec" lang="en"/>
+<l:template name="Mon" text="Mon" lang="en"/>
+<l:template name="Tue" text="Tue" lang="en"/>
+<l:template name="Wed" text="Wed" lang="en"/>
+<l:template name="Thu" text="Thu" lang="en"/>
+<l:template name="Fri" text="Fri" lang="en"/>
+<l:template name="Sat" text="Sat" lang="en"/>
+<l:template name="Sun" text="Sun" lang="en"/>
+</l:context>
+<l:context name="htmlhelp"><l:template name="langcode" text="0x040a Spanish (Traditional Sort)"/>
+</l:context>
+<l:context name="index"><l:template name="term-separator" text=", " lang="en"/>
+<l:template name="number-separator" text=", " lang="en"/>
+<l:template name="range-separator" text="-" lang="en"/>
+</l:context>
+<l:context name="iso690"><l:template name="lastfirst.sep" text=", " lang="en"/>
+<l:template name="alt.person.two.sep" text=" – " lang="en"/>
+<l:template name="alt.person.last.sep" text=" – " lang="en"/>
+<l:template name="alt.person.more.sep" text=" – " lang="en"/>
+<l:template name="primary.editor" text=" (ed.)" lang="en"/>
+<l:template name="primary.many" text=", et al." lang="en"/>
+<l:template name="primary.sep" text=". " lang="en"/>
+<l:template name="submaintitle.sep" text=": " lang="en"/>
+<l:template name="title.sep" text=". " lang="en"/>
+<l:template name="othertitle.sep" text=", " lang="en"/>
+<l:template name="medium1" text=" [" lang="en"/>
+<l:template name="medium2" text="]" lang="en"/>
+<l:template name="secondary.person.sep" text="; " lang="en"/>
+<l:template name="secondary.sep" text=". " lang="en"/>
+<l:template name="respons.sep" text=". " lang="en"/>
+<l:template name="edition.sep" text=". " lang="en"/>
+<l:template name="edition.serial.sep" text=", " lang="en"/>
+<l:template name="issuing.range" text="-" lang="en"/>
+<l:template name="issuing.div" text=", " lang="en"/>
+<l:template name="issuing.sep" text=". " lang="en"/>
+<l:template name="partnr.sep" text=". " lang="en"/>
+<l:template name="placepubl.sep" text=": " lang="en"/>
+<l:template name="publyear.sep" text=", " lang="en"/>
+<l:template name="pubinfo.sep" text=". " lang="en"/>
+<l:template name="spec.pubinfo.sep" text=", " lang="en"/>
+<l:template name="upd.sep" text=", " lang="en"/>
+<l:template name="datecit1" text=" [cited " lang="en"/>
+<l:template name="datecit2" text="]" lang="en"/>
+<l:template name="extent.sep" text=". " lang="en"/>
+<l:template name="locs.sep" text=", " lang="en"/>
+<l:template name="location.sep" text=". " lang="en"/>
+<l:template name="serie.sep" text=". " lang="en"/>
+<l:template name="notice.sep" text=". " lang="en"/>
+<l:template name="access" text="Available " lang="en"/>
+<l:template name="acctoo" text="Also available " lang="en"/>
+<l:template name="onwww" text="from World Wide Web" lang="en"/>
+<l:template name="oninet" text="from Internet" lang="en"/>
+<l:template name="access.end" text=": " lang="en"/>
+<l:template name="link1" text="&lt;" lang="en"/>
+<l:template name="link2" text="&gt;" lang="en"/>
+<l:template name="access.sep" text=". " lang="en"/>
+<l:template name="isbn" text="ISBN " lang="en"/>
+<l:template name="issn" text="ISSN " lang="en"/>
+<l:template name="stdnum.sep" text=". " lang="en"/>
+<l:template name="patcountry.sep" text=". " lang="en"/>
+<l:template name="pattype.sep" text=", " lang="en"/>
+<l:template name="patnum.sep" text=". " lang="en"/>
+<l:template name="patdate.sep" text=". " lang="en"/>
+</l:context><l:letters><l:l i="-1"/>
+<l:l i="0">Símbolos</l:l>
+<l:l i="1">A</l:l>
+<l:l i="1">a</l:l>
+<l:l i="1">á</l:l>
+<l:l i="1">Á</l:l>
+<l:l i="2">B</l:l>
+<l:l i="2">b</l:l>
+<l:l i="3">C</l:l>
+<l:l i="3">c</l:l>
+<l:l i="4">CH</l:l>
+<l:l i="4">ch</l:l>
+<l:l i="5">D</l:l>
+<l:l i="5">d</l:l>
+<l:l i="6">E</l:l>
+<l:l i="6">e</l:l>
+<l:l i="6">É</l:l>
+<l:l i="6">é</l:l>
+<l:l i="7">F</l:l>
+<l:l i="7">f</l:l>
+<l:l i="8">G</l:l>
+<l:l i="8">g</l:l>
+<l:l i="9">H</l:l>
+<l:l i="9">h</l:l>
+<l:l i="10">I</l:l>
+<l:l i="10">i</l:l>
+<l:l i="10">Í</l:l>
+<l:l i="10">í</l:l>
+<l:l i="11">J</l:l>
+<l:l i="11">j</l:l>
+<l:l i="12">K</l:l>
+<l:l i="12">k</l:l>
+<l:l i="13">L</l:l>
+<l:l i="13">l</l:l>
+<l:l i="14">LL</l:l>
+<l:l i="14">ll</l:l>
+<l:l i="15">M</l:l>
+<l:l i="15">m</l:l>
+<l:l i="16">N</l:l>
+<l:l i="16">n</l:l>
+<l:l i="17">Ñ</l:l>
+<l:l i="17">ñ</l:l>
+<l:l i="18">O</l:l>
+<l:l i="18">o</l:l>
+<l:l i="18">Ó</l:l>
+<l:l i="18">ó</l:l>
+<l:l i="19">P</l:l>
+<l:l i="19">p</l:l>
+<l:l i="20">Q</l:l>
+<l:l i="20">q</l:l>
+<l:l i="21">R</l:l>
+<l:l i="21">r</l:l>
+<l:l i="22">S</l:l>
+<l:l i="22">s</l:l>
+<l:l i="23">T</l:l>
+<l:l i="23">t</l:l>
+<l:l i="24">U</l:l>
+<l:l i="24">u</l:l>
+<l:l i="24">Ú</l:l>
+<l:l i="24">ú</l:l>
+<l:l i="25">V</l:l>
+<l:l i="25">v</l:l>
+<l:l i="26">W</l:l>
+<l:l i="26">w</l:l>
+<l:l i="27">X</l:l>
+<l:l i="27">x</l:l>
+<l:l i="28">Y</l:l>
+<l:l i="28">y</l:l>
+<l:l i="29">Z</l:l>
+<l:l i="29">z</l:l>
+</l:letters>
+</l:l10n>

+ 677 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/fr.xml

@@ -0,0 +1,677 @@
+<?xml version="1.0" encoding="utf-8"?>
+<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="fr" english-language-name="French">
+
+<!-- * This file is generated automatically. -->
+<!-- * To submit changes to this file upstream (to the DocBook Project) -->
+<!-- * do not submit an edited version of this file. Instead, submit an -->
+<!-- * edited version of the source file at the following location: -->
+<!-- * -->
+<!-- *  https://svn.sourceforge.net/svnroot/docbook/trunk/gentext/locale/fr.xml -->
+<!-- * -->
+<!-- * E-mail the edited fr.xml source file to: -->
+<!-- * -->
+<!-- *  docbook-developers@lists.sourceforge.net -->
+
+<!-- ******************************************************************** -->
+
+<!-- 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. -->
+
+<!-- ******************************************************************** -->
+
+<l:gentext key="Abstract" text="Résumé"/>
+<l:gentext key="abstract" text="Résumé"/>
+<l:gentext key="Answer" text="R :"/>
+<l:gentext key="answer" text="R :"/>
+<l:gentext key="Appendix" text="Annexe"/>
+<l:gentext key="appendix" text="annexe"/>
+<l:gentext key="Article" text="Article"/>
+<l:gentext key="article" text="Article"/>
+<l:gentext key="Author" text="Auteur"/>
+<l:gentext key="Bibliography" text="Bibliographie"/>
+<l:gentext key="bibliography" text="Bibliographie"/>
+<l:gentext key="Book" text="Livre"/>
+<l:gentext key="book" text="Livre"/>
+<l:gentext key="CAUTION" text="ATTENTION"/>
+<l:gentext key="Caution" text="Attention"/>
+<l:gentext key="caution" text="Attention"/>
+<l:gentext key="Chapter" text="Chapitre"/>
+<l:gentext key="chapter" text="chapitre"/>
+<l:gentext key="Colophon" text="Achevé d'imprimer"/>
+<l:gentext key="colophon" text="Achevé d'imprimer"/>
+<l:gentext key="Copyright" text="Copyright"/>
+<l:gentext key="copyright" text="Copyright"/>
+<l:gentext key="Dedication" text="Dédicace"/>
+<l:gentext key="dedication" text="Dédicace"/>
+<l:gentext key="Edition" text="Édition"/>
+<l:gentext key="edition" text="Édition"/>
+<l:gentext key="Editor" text="Editor" lang="en"/>
+<l:gentext key="Equation" text="Équation"/>
+<l:gentext key="equation" text="Équation"/>
+<l:gentext key="Example" text="Exemple"/>
+<l:gentext key="example" text="Exemple"/>
+<l:gentext key="Figure" text="Figure"/>
+<l:gentext key="figure" text="Figure"/>
+<l:gentext key="Glossary" text="Glossaire"/>
+<l:gentext key="glossary" text="Glossaire"/>
+<l:gentext key="GlossSee" text="Voir"/>
+<l:gentext key="glosssee" text="Voir"/>
+<l:gentext key="GlossSeeAlso" text="Voir aussi"/>
+<l:gentext key="glossseealso" text="Voir aussi"/>
+<l:gentext key="IMPORTANT" text="IMPORTANT"/>
+<l:gentext key="important" text="Important"/>
+<l:gentext key="Important" text="Important"/>
+<l:gentext key="Index" text="Index"/>
+<l:gentext key="index" text="Index"/>
+<l:gentext key="ISBN" text="ISBN"/>
+<l:gentext key="isbn" text="ISBN"/>
+<l:gentext key="LegalNotice" text="Note légale"/>
+<l:gentext key="legalnotice" text="Note légale"/>
+<l:gentext key="MsgAud" text="Public visé"/>
+<l:gentext key="msgaud" text="Public visé"/>
+<l:gentext key="MsgLevel" text="Niveau"/>
+<l:gentext key="msglevel" text="Niveau"/>
+<l:gentext key="MsgOrig" text="Origine"/>
+<l:gentext key="msgorig" text="Origine"/>
+<l:gentext key="NOTE" text="NOTE"/>
+<l:gentext key="Note" text="Note"/>
+<l:gentext key="note" text="Note"/>
+<l:gentext key="Part" text="Partie"/>
+<l:gentext key="part" text="Partie"/>
+<l:gentext key="Preface" text="Préface"/>
+<l:gentext key="preface" text="Préface"/>
+<l:gentext key="Procedure" text="Procédure"/>
+<l:gentext key="procedure" text="Procédure"/>
+<l:gentext key="ProductionSet" text="Production"/>
+<l:gentext key="PubDate" text="Date de publication"/>
+<l:gentext key="pubdate" text="Date de publication"/>
+<l:gentext key="Published" text="Publié le"/>
+<l:gentext key="published" text="Publié le"/>
+<l:gentext key="Publisher" text="Publisher" lang="en"/>
+<l:gentext key="Qandadiv" text="Q &amp; R"/>
+<l:gentext key="qandadiv" text="Q &amp; R"/>
+<l:gentext key="QandASet" text="Frequently Asked Questions" lang="en"/>
+<l:gentext key="Question" text="Q :"/>
+<l:gentext key="question" text="Q :"/>
+<l:gentext key="RefEntry" text=""/>
+<l:gentext key="refentry" text=""/>
+<l:gentext key="Reference" text="Référence"/>
+<l:gentext key="reference" text="Référence"/>
+<l:gentext key="References" text="References" lang="en"/>
+<l:gentext key="RefName" text="Nom"/>
+<l:gentext key="refname" text="Nom"/>
+<l:gentext key="RefSection" text=""/>
+<l:gentext key="refsection" text=""/>
+<l:gentext key="RefSynopsisDiv" text="Synopsis"/>
+<l:gentext key="refsynopsisdiv" text="Synopsis"/>
+<l:gentext key="RevHistory" text="Historique des versions"/>
+<l:gentext key="revhistory" text="Historique des versions"/>
+<l:gentext key="revision" text="Version"/>
+<l:gentext key="Revision" text="Version"/>
+<l:gentext key="sect1" text="Section"/>
+<l:gentext key="sect2" text="Section"/>
+<l:gentext key="sect3" text="Section"/>
+<l:gentext key="sect4" text="Section"/>
+<l:gentext key="sect5" text="Section"/>
+<l:gentext key="section" text="section"/>
+<l:gentext key="Section" text="Section"/>
+<l:gentext key="see" text="voir"/>
+<l:gentext key="See" text="Voir"/>
+<l:gentext key="seealso" text="voir aussi"/>
+<l:gentext key="Seealso" text="Voir aussi"/>
+<l:gentext key="SeeAlso" text="Voir Aussi"/>
+<l:gentext key="set" text="Ensemble"/>
+<l:gentext key="Set" text="Ensemble"/>
+<l:gentext key="setindex" text="Index"/>
+<l:gentext key="SetIndex" text="Index"/>
+<l:gentext key="Sidebar" text="Filet vertical"/>
+<l:gentext key="sidebar" text="Filet vertical"/>
+<l:gentext key="step" text="étape"/>
+<l:gentext key="Step" text="Étape"/>
+<l:gentext key="table" text="Tableau"/>
+<l:gentext key="Table" text="Tableau"/>
+<l:gentext key="task" text="Task" lang="en"/>
+<l:gentext key="Task" text="Task" lang="en"/>
+<l:gentext key="tip" text="ASTUCE"/>
+<l:gentext key="TIP" text="ASTUCE"/>
+<l:gentext key="Tip" text="Astuce"/>
+<l:gentext key="Warning" text="Avertissement"/>
+<l:gentext key="warning" text="AVERTISSEMENT"/>
+<l:gentext key="WARNING" text="AVERTISSEMENT"/>
+<l:gentext key="and" text="et"/>
+<l:gentext key="by" text="par"/>
+<l:gentext key="Edited" text="Publié"/>
+<l:gentext key="edited" text="Publié"/>
+<l:gentext key="Editedby" text="Publié par"/>
+<l:gentext key="editedby" text="Publié par"/>
+<l:gentext key="in" text="dans"/>
+<l:gentext key="lastlistcomma" text=","/>
+<l:gentext key="listcomma" text=","/>
+<l:gentext key="nonexistantelement" text="Cet élément n'existe pas"/>
+<l:gentext key="notes" text="Notes"/>
+<l:gentext key="Notes" text="Notes"/>
+<l:gentext key="Pgs" text="Pages"/>
+<l:gentext key="pgs" text="Pages"/>
+<l:gentext key="Revisedby" text="Revu et corrigé par : "/>
+<l:gentext key="revisedby" text="Revu et corrigé par : "/>
+<l:gentext key="TableNotes" text="Remarques"/>
+<l:gentext key="tablenotes" text="Remarques"/>
+<l:gentext key="TableofContents" text="Table des matières"/>
+<l:gentext key="tableofcontents" text="Table des matières"/>
+<l:gentext key="unexpectedelementname" text="Nom d'élément inattendu"/>
+<l:gentext key="unsupported" text="Non reconnu par le système"/>
+<l:gentext key="xrefto" text="Référence vers"/>
+<l:gentext key="Authors" text="Authors" lang="en"/>
+<l:gentext key="copyeditor" text="Copy Editor" lang="en"/>
+<l:gentext key="graphicdesigner" text="Graphic Designer" lang="en"/>
+<l:gentext key="productioneditor" text="Production Editor" lang="en"/>
+<l:gentext key="technicaleditor" text="Technical Editor" lang="en"/>
+<l:gentext key="translator" text="Translator" lang="en"/>
+<l:gentext key="listofequations" text="Liste des équations"/>
+<l:gentext key="ListofEquations" text="Liste des équations"/>
+<l:gentext key="ListofExamples" text="Liste des exemples"/>
+<l:gentext key="listofexamples" text="Liste des exemples"/>
+<l:gentext key="ListofFigures" text="Liste des illustrations"/>
+<l:gentext key="listoffigures" text="Liste des illustrations"/>
+<l:gentext key="ListofProcedures" text="Liste des procédures"/>
+<l:gentext key="listofprocedures" text="Liste des procédures"/>
+<l:gentext key="listoftables" text="Liste des tableaux"/>
+<l:gentext key="ListofTables" text="Liste des tableaux"/>
+<l:gentext key="ListofUnknown" text="Liste inconnue"/>
+<l:gentext key="listofunknown" text="Liste inconnue"/>
+<l:gentext key="nav-home" text="Sommaire"/>
+<l:gentext key="nav-next" text="Suivant"/>
+<l:gentext key="nav-next-sibling" text="Avance rapide"/>
+<l:gentext key="nav-prev" text="Précédent"/>
+<l:gentext key="nav-prev-sibling" text="Arrière rapide"/>
+<l:gentext key="nav-up" text="Niveau supérieur"/>
+<l:gentext key="nav-toc" text="TdM"/>
+<l:gentext key="Draft" text="Brouillon"/>
+<l:gentext key="above" text="au-dessus"/>
+<l:gentext key="below" text="au-dessous"/>
+<l:gentext key="sectioncalled" text="la section intitulée"/>
+<l:gentext key="index symbols" text="Symboles"/>
+<l:gentext key="lowercase.alpha" text="abcdefghijklmnopqrstuvwxyzâêîôûëïüàèùéçæœ"/>
+<l:gentext key="uppercase.alpha" text="ABCDEFGHIJKLMNOPQRSTUVWXYZÂÊÎÔÛËÏÜÀÈÙÉÇÆŒ"/>
+<l:gentext key="normalize.sort.input" text="AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ" lang="en"/>
+<l:gentext key="normalize.sort.output" text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ" lang="en"/>
+<l:dingbat key="startquote" text="« "/>
+<l:dingbat key="endquote" text=" »"/>
+<l:dingbat key="nestedstartquote" text="“"/>
+<l:dingbat key="nestedendquote" text="”"/>
+<l:dingbat key="singlestartquote" text="‹"/>
+<l:dingbat key="singleendquote" text="›"/>
+<l:dingbat key="bullet" text="•"/>
+<l:gentext key="hyphenation-character" text="-"/>
+<l:gentext key="hyphenation-push-character-count" text="2"/>
+<l:gentext key="hyphenation-remain-character-count" text="2"/>
+<l:context name="styles"><l:template name="person-name" text="first-last"/>
+</l:context>
+<l:context name="title"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="%t"/>
+<l:template name="appendix" text="Annexe %n. %t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="biblioentry" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliolist" text="%t" lang="en"/>
+<l:template name="bibliomixed" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="Chapitre %n. %t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="Équation %n. %t"/>
+<l:template name="example" text="Exemple %n. %t"/>
+<l:template name="figure" text="Figure %n. %t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="glosslist" text="%t" lang="en"/>
+<l:template name="glossentry" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text=""/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="%t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="procedure.formal" text="Procédure %n. %t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="productionset.formal" text="Production %n"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="%t"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="%t"/>
+<l:template name="refentry" text="%t"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsection" text="%t"/>
+<l:template name="refsect1" text="%t"/>
+<l:template name="refsect2" text="%t"/>
+<l:template name="refsect3" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="refsynopsisdivinfo" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="step" text="%t"/>
+<l:template name="table" text="Tableau %n. %t"/>
+<l:template name="task" text="%t"/>
+<l:template name="tasksummary" text="%t" lang="en"/>
+<l:template name="taskprerequisites" text="%t" lang="en"/>
+<l:template name="taskrelated" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text=""/>
+<l:template name="warning" text="%t"/>
+</l:context>
+<l:context name="title-unnumbered"><l:template name="appendix" text="%t"/>
+<l:template name="article/appendix" text="%t"/>
+<l:template name="bridgehead" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="sect1" text="%t"/>
+<l:template name="sect2" text="%t"/>
+<l:template name="sect3" text="%t"/>
+<l:template name="sect4" text="%t"/>
+<l:template name="sect5" text="%t"/>
+<l:template name="section" text="%t"/>
+<l:template name="simplesect" text="%t"/>
+<l:template name="part" text="%t" lang="en"/>
+</l:context>
+<l:context name="title-numbered"><l:template name="appendix" text="Annexe %n. %t"/>
+<l:template name="article/appendix" text="%n. %t"/>
+<l:template name="bridgehead" text="%n. %t"/>
+<l:template name="chapter" text="Chapitre %n. %t"/>
+<l:template name="part" text="Partie %n. %t"/>
+<l:template name="sect1" text="%n. %t"/>
+<l:template name="sect2" text="%n. %t"/>
+<l:template name="sect3" text="%n. %t"/>
+<l:template name="sect4" text="%n. %t"/>
+<l:template name="sect5" text="%n. %t"/>
+<l:template name="section" text="%n. %t"/>
+<l:template name="simplesect" text="%t"/>
+</l:context>
+<l:context name="subtitle"><l:template name="appendix" text="%s"/>
+<l:template name="article" text="%s"/>
+<l:template name="bibliodiv" text="%s"/>
+<l:template name="biblioentry" text="%s"/>
+<l:template name="bibliography" text="%s"/>
+<l:template name="bibliomixed" text="%s"/>
+<l:template name="bibliomset" text="%s"/>
+<l:template name="biblioset" text="%s"/>
+<l:template name="book" text="%s"/>
+<l:template name="chapter" text="%s"/>
+<l:template name="colophon" text="%s"/>
+<l:template name="dedication" text="%s"/>
+<l:template name="glossary" text="%s"/>
+<l:template name="glossdiv" text="%s"/>
+<l:template name="index" text="%s"/>
+<l:template name="indexdiv" text="%s"/>
+<l:template name="lot" text="%s"/>
+<l:template name="part" text="%s"/>
+<l:template name="partintro" text="%s"/>
+<l:template name="preface" text="%s"/>
+<l:template name="refentry" text="%s"/>
+<l:template name="reference" text="%s"/>
+<l:template name="refsection" text="%s"/>
+<l:template name="refsect1" text="%s"/>
+<l:template name="refsect2" text="%s"/>
+<l:template name="refsect3" text="%s"/>
+<l:template name="refsynopsisdiv" text="%s"/>
+<l:template name="sect1" text="%s"/>
+<l:template name="sect2" text="%s"/>
+<l:template name="sect3" text="%s"/>
+<l:template name="sect4" text="%s"/>
+<l:template name="sect5" text="%s"/>
+<l:template name="section" text="%s"/>
+<l:template name="set" text="%s"/>
+<l:template name="setindex" text="%s"/>
+<l:template name="sidebar" text="%s"/>
+<l:template name="simplesect" text="%s"/>
+<l:template name="toc" text="%s"/>
+</l:context>
+<l:context name="xref"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="R : %n"/>
+<l:template name="appendix" text="%t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="constraintdef" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="%t"/>
+<l:template name="example" text="%t"/>
+<l:template name="figure" text="%t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text="%n"/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="%t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="Q : %n"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="Q : %n"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="table" text="%t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="%n"/>
+<l:template name="warning" text="%t"/>
+<l:template name="olink.document.citation" text=" in %o" lang="en"/>
+<l:template name="olink.page.citation" text=" (page %p)" lang="en"/>
+<l:template name="page.citation" text=" [%p]"/>
+<l:template name="page" text="(page %p)"/>
+<l:template name="docname" text=" in %o" lang="en"/>
+<l:template name="docnamelong" text=" in the document titled %o" lang="en"/>
+<l:template name="pageabbrev" text="(p. %p)"/>
+<l:template name="Page" text="Page %p"/>
+<l:template name="bridgehead" text="la section intitulée « %t »"/>
+<l:template name="refsection" text="la section intitulée « %t »"/>
+<l:template name="refsect1" text="la section intitulée « %t »"/>
+<l:template name="refsect2" text="la section intitulée « %t »"/>
+<l:template name="refsect3" text="la section intitulée « %t »"/>
+<l:template name="sect1" text="la section intitulée « %t »"/>
+<l:template name="sect2" text="la section intitulée « %t »"/>
+<l:template name="sect3" text="la section intitulée « %t »"/>
+<l:template name="sect4" text="la section intitulée « %t »"/>
+<l:template name="sect5" text="la section intitulée « %t »"/>
+<l:template name="section" text="la section intitulée « %t »"/>
+<l:template name="simplesect" text="la section intitulée « %t »"/>
+</l:context>
+<l:context name="xref-number"><l:template name="answer" text="R : %n"/>
+<l:template name="appendix" text="Annexe %n"/>
+<l:template name="bridgehead" text="Section %n"/>
+<l:template name="chapter" text="Chapitre %n"/>
+<l:template name="equation" text="Équation %n"/>
+<l:template name="example" text="Exemple %n"/>
+<l:template name="figure" text="Figure %n"/>
+<l:template name="part" text="Partie %n"/>
+<l:template name="procedure" text="Procédure %n"/>
+<l:template name="productionset" text="Production %n"/>
+<l:template name="qandadiv" text="Q &amp; R %n"/>
+<l:template name="qandaentry" text="Q : %n"/>
+<l:template name="question" text="Q : %n"/>
+<l:template name="sect1" text="Section %n"/>
+<l:template name="sect2" text="Section %n"/>
+<l:template name="sect3" text="Section %n"/>
+<l:template name="sect4" text="Section %n"/>
+<l:template name="sect5" text="Section %n"/>
+<l:template name="section" text="Section %n"/>
+<l:template name="table" text="Tableau %n"/>
+</l:context>
+<l:context name="xref-number-and-title"><l:template name="appendix" text="Annexe %n, %t"/>
+<l:template name="bridgehead" text="Section %n, « %t »"/>
+<l:template name="chapter" text="Chapitre %n, %t"/>
+<l:template name="equation" text="Équation %n, « %t »"/>
+<l:template name="example" text="Exemple %n, « %t »"/>
+<l:template name="figure" text="Figure %n, « %t »"/>
+<l:template name="part" text="Partie %n, « %t »"/>
+<l:template name="procedure" text="Procédure %n, « %t »"/>
+<l:template name="productionset" text="Production %n, « %t »"/>
+<l:template name="qandadiv" text="Q &amp; R %n, « %t »"/>
+<l:template name="refsect1" text="la section intitulée « %t »"/>
+<l:template name="refsect2" text="la section intitulée « %t »"/>
+<l:template name="refsect3" text="la section intitulée « %t »"/>
+<l:template name="refsection" text="la section intitulée « %t »"/>
+<l:template name="sect1" text="Section %n, « %t »"/>
+<l:template name="sect2" text="Section %n, « %t »"/>
+<l:template name="sect3" text="Section %n, « %t »"/>
+<l:template name="sect4" text="Section %n, « %t »"/>
+<l:template name="sect5" text="Section %n, « %t »"/>
+<l:template name="section" text="Section %n, « %t »"/>
+<l:template name="simplesect" text="la section intitulée « %t »"/>
+<l:template name="table" text="Tableau %n, « %t »"/>
+</l:context>
+<l:context name="authorgroup"><l:template name="sep" text=", "/>
+<l:template name="sep2" text=" et "/>
+<l:template name="seplast" text=", et "/>
+</l:context>
+<l:context name="glossary"><l:template name="see" text="Voir %t"/>
+<l:template name="seealso" text="Voir aussi %t"/>
+</l:context>
+<l:context name="msgset"><l:template name="MsgAud" text="Public visé: "/>
+<l:template name="MsgLevel" text="Niveau: "/>
+<l:template name="MsgOrig" text="Origine: "/>
+</l:context>
+<l:context name="datetime"><l:template name="format" text="d/m/Y"/>
+</l:context>
+<l:context name="termdef"><l:template name="prefix" text="[Definition: " lang="en"/>
+<l:template name="suffix" text="]" lang="en"/>
+</l:context>
+<l:context name="datetime-full"><l:template name="January" text="janvier"/>
+<l:template name="February" text="février"/>
+<l:template name="March" text="mars"/>
+<l:template name="April" text="avril"/>
+<l:template name="May" text="mai"/>
+<l:template name="June" text="juin"/>
+<l:template name="July" text="juillet"/>
+<l:template name="August" text="août"/>
+<l:template name="September" text="septembre"/>
+<l:template name="October" text="octobre"/>
+<l:template name="November" text="novembre"/>
+<l:template name="December" text="décembre"/>
+<l:template name="Monday" text="lundi"/>
+<l:template name="Tuesday" text="mardi"/>
+<l:template name="Wednesday" text="mercredi"/>
+<l:template name="Thursday" text="jeudi"/>
+<l:template name="Friday" text="vendredi"/>
+<l:template name="Saturday" text="samedi"/>
+<l:template name="Sunday" text="dimanche"/>
+</l:context>
+<l:context name="datetime-abbrev"><l:template name="Jan" text="jan"/>
+<l:template name="Feb" text="fév"/>
+<l:template name="Mar" text="mar"/>
+<l:template name="Apr" text="avr"/>
+<l:template name="May" text="mai"/>
+<l:template name="Jun" text="jun"/>
+<l:template name="Jul" text="jui"/>
+<l:template name="Aug" text="aoû"/>
+<l:template name="Sep" text="sep"/>
+<l:template name="Oct" text="oct"/>
+<l:template name="Nov" text="nov"/>
+<l:template name="Dec" text="déc"/>
+<l:template name="Mon" text="lun"/>
+<l:template name="Tue" text="mar"/>
+<l:template name="Wed" text="mer"/>
+<l:template name="Thu" text="jeu"/>
+<l:template name="Fri" text="ven"/>
+<l:template name="Sat" text="sam"/>
+<l:template name="Sun" text="dim"/>
+</l:context>
+<l:context name="htmlhelp"><l:template name="langcode" text="0x040c French (FRANCE)"/>
+</l:context>
+<l:context name="index"><l:template name="term-separator" text=", " lang="en"/>
+<l:template name="number-separator" text=", " lang="en"/>
+<l:template name="range-separator" text="-" lang="en"/>
+</l:context>
+<l:context name="iso690"><l:template name="lastfirst.sep" text=", " lang="en"/>
+<l:template name="alt.person.two.sep" text=" – " lang="en"/>
+<l:template name="alt.person.last.sep" text=" – " lang="en"/>
+<l:template name="alt.person.more.sep" text=" – " lang="en"/>
+<l:template name="primary.editor" text=" (ed.)" lang="en"/>
+<l:template name="primary.many" text=", et al." lang="en"/>
+<l:template name="primary.sep" text=". " lang="en"/>
+<l:template name="submaintitle.sep" text=": " lang="en"/>
+<l:template name="title.sep" text=". " lang="en"/>
+<l:template name="othertitle.sep" text=", " lang="en"/>
+<l:template name="medium1" text=" [" lang="en"/>
+<l:template name="medium2" text="]" lang="en"/>
+<l:template name="secondary.person.sep" text="; " lang="en"/>
+<l:template name="secondary.sep" text=". " lang="en"/>
+<l:template name="respons.sep" text=". " lang="en"/>
+<l:template name="edition.sep" text=". " lang="en"/>
+<l:template name="edition.serial.sep" text=", " lang="en"/>
+<l:template name="issuing.range" text="-" lang="en"/>
+<l:template name="issuing.div" text=", " lang="en"/>
+<l:template name="issuing.sep" text=". " lang="en"/>
+<l:template name="partnr.sep" text=". " lang="en"/>
+<l:template name="placepubl.sep" text=": " lang="en"/>
+<l:template name="publyear.sep" text=", " lang="en"/>
+<l:template name="pubinfo.sep" text=". " lang="en"/>
+<l:template name="spec.pubinfo.sep" text=", " lang="en"/>
+<l:template name="upd.sep" text=", " lang="en"/>
+<l:template name="datecit1" text=" [cited " lang="en"/>
+<l:template name="datecit2" text="]" lang="en"/>
+<l:template name="extent.sep" text=". " lang="en"/>
+<l:template name="locs.sep" text=", " lang="en"/>
+<l:template name="location.sep" text=". " lang="en"/>
+<l:template name="serie.sep" text=". " lang="en"/>
+<l:template name="notice.sep" text=". " lang="en"/>
+<l:template name="access" text="Available " lang="en"/>
+<l:template name="acctoo" text="Also available " lang="en"/>
+<l:template name="onwww" text="from World Wide Web" lang="en"/>
+<l:template name="oninet" text="from Internet" lang="en"/>
+<l:template name="access.end" text=": " lang="en"/>
+<l:template name="link1" text="&lt;" lang="en"/>
+<l:template name="link2" text="&gt;" lang="en"/>
+<l:template name="access.sep" text=". " lang="en"/>
+<l:template name="isbn" text="ISBN " lang="en"/>
+<l:template name="issn" text="ISSN " lang="en"/>
+<l:template name="stdnum.sep" text=". " lang="en"/>
+<l:template name="patcountry.sep" text=". " lang="en"/>
+<l:template name="pattype.sep" text=", " lang="en"/>
+<l:template name="patnum.sep" text=". " lang="en"/>
+<l:template name="patdate.sep" text=". " lang="en"/>
+</l:context><l:letters><l:l i="-1"/>
+<l:l i="0">Symboles</l:l>
+<l:l i="1">A</l:l>
+<l:l i="1">a</l:l>
+<l:l i="1">à</l:l>
+<l:l i="1">À</l:l>
+<l:l i="1">â</l:l>
+<l:l i="1">Â</l:l>
+<l:l i="1">Æ</l:l>
+<l:l i="1">æ</l:l>
+<l:l i="2">B</l:l>
+<l:l i="2">b</l:l>
+<l:l i="3">C</l:l>
+<l:l i="3">c</l:l>
+<l:l i="3">ç</l:l>
+<l:l i="4">D</l:l>
+<l:l i="4">d</l:l>
+<l:l i="5">E</l:l>
+<l:l i="5">e</l:l>
+<l:l i="5">ê</l:l>
+<l:l i="5">Ê</l:l>
+<l:l i="5">é</l:l>
+<l:l i="5">É</l:l>
+<l:l i="5">è</l:l>
+<l:l i="5">È</l:l>
+<l:l i="5">ë</l:l>
+<l:l i="5">Ë</l:l>
+<l:l i="5">€</l:l>
+<l:l i="6">F</l:l>
+<l:l i="6">f</l:l>
+<l:l i="7">G</l:l>
+<l:l i="7">g</l:l>
+<l:l i="8">H</l:l>
+<l:l i="8">h</l:l>
+<l:l i="9">I</l:l>
+<l:l i="9">i</l:l>
+<l:l i="9">Î</l:l>
+<l:l i="9">î</l:l>
+<l:l i="9">Ï</l:l>
+<l:l i="9">ï</l:l>
+<l:l i="10">J</l:l>
+<l:l i="10">j</l:l>
+<l:l i="11">K</l:l>
+<l:l i="11">k</l:l>
+<l:l i="12">L</l:l>
+<l:l i="12">l</l:l>
+<l:l i="13">M</l:l>
+<l:l i="13">m</l:l>
+<l:l i="14">N</l:l>
+<l:l i="14">n</l:l>
+<l:l i="15">O</l:l>
+<l:l i="15">o</l:l>
+<l:l i="15">Ö</l:l>
+<l:l i="15">ö</l:l>
+<l:l i="15">Œ</l:l>
+<l:l i="15">œ</l:l>
+<l:l i="16">P</l:l>
+<l:l i="16">p</l:l>
+<l:l i="17">Q</l:l>
+<l:l i="17">q</l:l>
+<l:l i="18">R</l:l>
+<l:l i="18">r</l:l>
+<l:l i="19">S</l:l>
+<l:l i="19">s</l:l>
+<l:l i="20">T</l:l>
+<l:l i="20">t</l:l>
+<l:l i="21">U</l:l>
+<l:l i="21">u</l:l>
+<l:l i="21">Ù</l:l>
+<l:l i="21">ù</l:l>
+<l:l i="21">Û</l:l>
+<l:l i="21">û</l:l>
+<l:l i="21">Ü</l:l>
+<l:l i="21">ü</l:l>
+<l:l i="22">V</l:l>
+<l:l i="22">v</l:l>
+<l:l i="23">W</l:l>
+<l:l i="23">w</l:l>
+<l:l i="24">X</l:l>
+<l:l i="24">x</l:l>
+<l:l i="25">Y</l:l>
+<l:l i="25">y</l:l>
+<l:l i="26">Z</l:l>
+<l:l i="26">z</l:l>
+</l:letters>
+</l:l10n>

+ 831 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/gentext.xsl

@@ -0,0 +1,831 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                exclude-result-prefixes="doc"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+
+<xsl:template match="*" mode="object.title.template">
+  <xsl:call-template name="gentext.template">
+    <xsl:with-param name="context" select="'title'"/>
+    <xsl:with-param name="name">
+      <xsl:call-template name="xpath.location"/>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="chapter" mode="object.title.template">
+  <xsl:choose>
+    <xsl:when test="string($chapter.autolabel) != 0">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title-numbered'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title-unnumbered'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="appendix" mode="object.title.template">
+  <xsl:choose>
+    <xsl:when test="string($appendix.autolabel) != 0">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title-numbered'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title-unnumbered'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="part" mode="object.title.template">
+  <xsl:choose>
+    <xsl:when test="string($part.autolabel) != 0">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title-numbered'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title-unnumbered'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="section|sect1|sect2|sect3|sect4|sect5|simplesect
+                     |bridgehead"
+              mode="object.title.template">
+  <xsl:variable name="is.numbered">
+    <xsl:call-template name="label.this.section"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$is.numbered != 0">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title-numbered'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title-unnumbered'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="procedure" mode="object.title.template">
+  <xsl:choose>
+    <xsl:when test="$formal.procedures != 0 and title">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+          <xsl:text>.formal</xsl:text>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'title'"/>
+        <xsl:with-param name="name">
+          <xsl:call-template name="xpath.location"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="object.subtitle.template">
+  <xsl:call-template name="gentext.template">
+    <xsl:with-param name="context" select="'subtitle'"/>
+    <xsl:with-param name="name">
+      <xsl:call-template name="xpath.location"/>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="is.autonumber">
+  <xsl:value-of select="'0'"/>
+</xsl:template>
+
+<xsl:template match="section|sect1|sect2|sect3|sect4|sect5" 
+              mode="is.autonumber">
+  <xsl:call-template name="label.this.section"/>
+</xsl:template>
+
+<xsl:template match="figure|example|table|equation" mode="is.autonumber">
+  <xsl:value-of select="'1'"/>
+</xsl:template>
+
+<xsl:template match="appendix" mode="is.autonumber">
+  <xsl:value-of select="$appendix.autolabel"/>
+</xsl:template>
+
+<xsl:template match="chapter" mode="is.autonumber">
+  <xsl:value-of select="$chapter.autolabel"/>
+</xsl:template>
+
+<xsl:template match="part" mode="is.autonumber">
+  <xsl:value-of select="$part.autolabel"/>
+</xsl:template>
+
+<xsl:template match="preface" mode="is.autonumber">
+  <xsl:value-of select="$preface.autolabel"/>
+</xsl:template>
+
+<xsl:template match="question|answer" mode="is.autonumber">
+  <xsl:choose>
+    <xsl:when test="$qanda.defaultlabel = 'number'
+                    and not(label)">
+      <xsl:value-of select="'1'"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="'0'"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="qandadiv" mode="is.autonumber">
+  <xsl:value-of select="$qandadiv.autolabel"/>
+</xsl:template>
+
+<xsl:template match="bridgehead" mode="is.autonumber">
+  <xsl:value-of select="$section.autolabel"/>
+</xsl:template>
+
+<xsl:template match="*" mode="object.xref.template">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="referrer"/>
+
+  <!-- Is autonumbering on? -->
+  <xsl:variable name="autonumber">
+    <xsl:apply-templates select="." mode="is.autonumber"/>
+  </xsl:variable>
+
+  <xsl:variable name="number-and-title-template">
+    <xsl:call-template name="gentext.template.exists">
+      <xsl:with-param name="context" select="'xref-number-and-title'"/>
+      <xsl:with-param name="name">
+        <xsl:call-template name="xpath.location"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="number-template">
+    <xsl:call-template name="gentext.template.exists">
+      <xsl:with-param name="context" select="'xref-number'"/>
+      <xsl:with-param name="name">
+        <xsl:call-template name="xpath.location"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="context">
+    <xsl:choose>
+      <xsl:when test="string($autonumber) != 0 
+                      and $number-and-title-template != 0
+                      and $xref.with.number.and.title != 0">
+         <xsl:value-of select="'xref-number-and-title'"/>
+      </xsl:when>
+      <xsl:when test="string($autonumber) != 0 
+                      and $number-template != 0">
+         <xsl:value-of select="'xref-number'"/>
+      </xsl:when>
+      <xsl:otherwise>
+         <xsl:value-of select="'xref'"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:call-template name="gentext.template">
+    <xsl:with-param name="context" select="$context"/>
+    <xsl:with-param name="name">
+      <xsl:call-template name="xpath.location"/>
+    </xsl:with-param>
+    <xsl:with-param name="purpose" select="$purpose"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+  </xsl:call-template>
+
+</xsl:template>
+
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="object.title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="template">
+    <xsl:apply-templates select="." mode="object.title.template"/>
+  </xsl:variable>
+
+<!--
+  <xsl:message>
+    <xsl:text>object.title.markup: </xsl:text>
+    <xsl:value-of select="local-name(.)"/>
+    <xsl:text>: </xsl:text>
+    <xsl:value-of select="$template"/>
+  </xsl:message>
+-->
+
+  <xsl:call-template name="substitute-markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="template" select="$template"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="*" mode="object.title.markup.textonly">
+  <xsl:variable name="title">
+    <xsl:apply-templates select="." mode="object.title.markup"/>
+  </xsl:variable>
+  <xsl:value-of select="normalize-space($title)"/>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="object.titleabbrev.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+
+  <!-- Just for consistency in template naming -->
+
+  <xsl:apply-templates select="." mode="titleabbrev.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="object.subtitle.markup">
+  <xsl:variable name="template">
+    <xsl:apply-templates select="." mode="object.subtitle.template"/>
+  </xsl:variable>
+
+  <xsl:call-template name="substitute-markup">
+    <xsl:with-param name="template" select="$template"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="object.xref.markup">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="referrer"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:variable name="template">
+    <xsl:choose>
+      <xsl:when test="starts-with(normalize-space($xrefstyle), 'select:')">
+        <xsl:call-template name="make.gentext.template">
+          <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+          <xsl:with-param name="purpose" select="$purpose"/>
+          <xsl:with-param name="referrer" select="$referrer"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="starts-with(normalize-space($xrefstyle), 'template:')">
+        <xsl:value-of select="substring-after(normalize-space($xrefstyle), 'template:')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="." mode="object.xref.template">
+          <xsl:with-param name="purpose" select="$purpose"/>
+          <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+          <xsl:with-param name="referrer" select="$referrer"/>
+        </xsl:apply-templates>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+<!-- 
+  <xsl:message>
+    <xsl:text>object.xref.markup: </xsl:text>
+    <xsl:value-of select="local-name(.)"/>
+    <xsl:text>(</xsl:text>
+    <xsl:value-of select="$xrefstyle"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$purpose"/>
+    <xsl:text>)</xsl:text>
+    <xsl:text>: [</xsl:text>
+    <xsl:value-of select="$template"/>
+    <xsl:text>]</xsl:text>
+  </xsl:message>
+-->
+
+  <xsl:if test="$template = '' and $verbose != 0">
+    <xsl:message>
+      <xsl:text>object.xref.markup: empty xref template</xsl:text>
+      <xsl:text> for linkend="</xsl:text>
+      <xsl:value-of select="@id|@xml:id"/>
+      <xsl:text>" and @xrefstyle="</xsl:text>
+      <xsl:value-of select="$xrefstyle"/>
+      <xsl:text>"</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:call-template name="substitute-markup">
+    <xsl:with-param name="purpose" select="$purpose"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="template" select="$template"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="listitem" mode="object.xref.markup">
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="parent::orderedlist">
+      <xsl:variable name="template">
+        <xsl:apply-templates select="." mode="object.xref.template"/>
+      </xsl:variable>
+      <xsl:call-template name="substitute-markup">
+        <xsl:with-param name="template" select="$template"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$verbose != 0">
+      <xsl:message>
+        <xsl:text>Xref is only supported to listitems in an</xsl:text>
+        <xsl:text> orderedlist: </xsl:text>
+        <xsl:value-of select="@id|@xml:id"/>
+      </xsl:message>
+      <xsl:text>???</xsl:text>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="question" mode="object.xref.markup">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="referrer"/>
+
+  <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="template">
+    <xsl:choose>
+      <!-- This avoids double Q: Q: in xref when defaultlabel=qanda -->
+      <xsl:when test="$deflabel = 'qanda' and not(label)">%n</xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="." mode="object.xref.template">
+          <xsl:with-param name="purpose" select="$purpose"/>
+          <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+          <xsl:with-param name="referrer" select="$referrer"/>
+        </xsl:apply-templates>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:call-template name="substitute-markup">
+    <xsl:with-param name="purpose" select="$purpose"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="template" select="$template"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template name="substitute-markup">
+  <xsl:param name="template" select="''"/>
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="title" select="''"/>
+  <xsl:param name="subtitle" select="''"/>
+  <xsl:param name="docname" select="''"/>
+  <xsl:param name="label" select="''"/>
+  <xsl:param name="pagenumber" select="''"/>
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="referrer"/>
+  <xsl:param name="verbose"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($template, '%')">
+      <xsl:value-of select="substring-before($template, '%')"/>
+      <xsl:variable name="candidate"
+             select="substring(substring-after($template, '%'), 1, 1)"/>
+      <xsl:choose>
+        <xsl:when test="$candidate = 't'">
+          <xsl:apply-templates select="." mode="insert.title.markup">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="title">
+              <xsl:choose>
+                <xsl:when test="$title != ''">
+                  <xsl:copy-of select="$title"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:apply-templates select="." mode="title.markup">
+                    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+                    <xsl:with-param name="verbose" select="$verbose"/>
+                  </xsl:apply-templates>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:with-param>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:when test="$candidate = 's'">
+          <xsl:apply-templates select="." mode="insert.subtitle.markup">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="subtitle">
+              <xsl:choose>
+                <xsl:when test="$subtitle != ''">
+                  <xsl:copy-of select="$subtitle"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:apply-templates select="." mode="subtitle.markup">
+                    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+                  </xsl:apply-templates>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:with-param>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:when test="$candidate = 'n'">
+          <xsl:apply-templates select="." mode="insert.label.markup">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="label">
+              <xsl:choose>
+                <xsl:when test="$label != ''">
+                  <xsl:copy-of select="$label"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:apply-templates select="." mode="label.markup"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:with-param>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:when test="$candidate = 'p'">
+          <xsl:apply-templates select="." mode="insert.pagenumber.markup">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="pagenumber">
+              <xsl:choose>
+                <xsl:when test="$pagenumber != ''">
+                  <xsl:copy-of select="$pagenumber"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:apply-templates select="." mode="pagenumber.markup"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:with-param>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:when test="$candidate = 'o'">
+          <!-- olink target document title -->
+          <xsl:apply-templates select="." mode="insert.olink.docname.markup">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="docname">
+              <xsl:choose>
+                <xsl:when test="$docname != ''">
+                  <xsl:copy-of select="$docname"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:apply-templates select="." mode="olink.docname.markup"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:with-param>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:when test="$candidate = 'd'">
+          <xsl:apply-templates select="." mode="insert.direction.markup">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="direction">
+              <xsl:choose>
+                <xsl:when test="$referrer">
+                  <xsl:variable name="referent-is-below">
+                    <xsl:for-each select="preceding::xref">
+                      <xsl:if test="generate-id(.) = generate-id($referrer)">1</xsl:if>
+                    </xsl:for-each>
+                  </xsl:variable>
+                  <xsl:choose>
+                    <xsl:when test="$referent-is-below = ''">
+                      <xsl:call-template name="gentext">
+                        <xsl:with-param name="key" select="'above'"/>
+                      </xsl:call-template>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:call-template name="gentext">
+                        <xsl:with-param name="key" select="'below'"/>
+                      </xsl:call-template>
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:message>Attempt to use %d in gentext with no referrer!</xsl:message>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:with-param>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:when test="$candidate = '%' ">
+          <xsl:text>%</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>%</xsl:text><xsl:value-of select="$candidate"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <!-- recurse with the rest of the template string -->
+      <xsl:variable name="rest"
+            select="substring($template,
+            string-length(substring-before($template, '%'))+3)"/>
+      <xsl:call-template name="substitute-markup">
+        <xsl:with-param name="template" select="$rest"/>
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+        <xsl:with-param name="title" select="$title"/>
+        <xsl:with-param name="subtitle" select="$subtitle"/>
+        <xsl:with-param name="docname" select="$docname"/>
+        <xsl:with-param name="label" select="$label"/>
+        <xsl:with-param name="pagenumber" select="$pagenumber"/>
+        <xsl:with-param name="purpose" select="$purpose"/>
+        <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+        <xsl:with-param name="referrer" select="$referrer"/>
+        <xsl:with-param name="verbose" select="$verbose"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$template"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template name="make.gentext.template">
+  <xsl:param name="xrefstyle" select="''"/>
+  <xsl:param name="purpose"/>
+  <xsl:param name="referrer"/>
+  <xsl:param name="lang">
+    <xsl:call-template name="l10n.language"/>
+  </xsl:param>
+  <xsl:param name="target.elem" select="local-name(.)"/>
+
+  <!-- parse xrefstyle to get parts -->
+  <xsl:variable name="parts"
+      select="substring-after(normalize-space($xrefstyle), 'select:')"/>
+
+  <xsl:variable name="labeltype">
+    <xsl:choose>
+      <xsl:when test="contains($parts, 'labelnumber')">
+         <xsl:text>labelnumber</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'labelname')">
+         <xsl:text>labelname</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'label')">
+         <xsl:text>label</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="titletype">
+    <xsl:choose>
+      <xsl:when test="contains($parts, 'quotedtitle')">
+         <xsl:text>quotedtitle</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'title')">
+         <xsl:text>title</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="pagetype">
+    <xsl:choose>
+      <xsl:when test="$insert.olink.page.number = 'no' and
+                      local-name($referrer) = 'olink'">
+        <!-- suppress page numbers -->
+      </xsl:when>
+      <xsl:when test="$insert.xref.page.number = 'no' and
+                      local-name($referrer) != 'olink'">
+        <!-- suppress page numbers -->
+      </xsl:when>
+      <xsl:when test="contains($parts, 'nopage')">
+         <xsl:text>nopage</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'pagenumber')">
+         <xsl:text>pagenumber</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'pageabbrev')">
+         <xsl:text>pageabbrev</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'Page')">
+         <xsl:text>Page</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'page')">
+         <xsl:text>page</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="docnametype">
+    <xsl:choose>
+      <xsl:when test="($olink.doctitle = 0 or
+                       $olink.doctitle = 'no') and
+                      local-name($referrer) = 'olink'">
+        <!-- suppress docname -->
+      </xsl:when>
+      <xsl:when test="contains($parts, 'nodocname')">
+         <xsl:text>nodocname</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'docnamelong')">
+         <xsl:text>docnamelong</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains($parts, 'docname')">
+         <xsl:text>docname</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="$labeltype != ''">
+    <xsl:choose>
+      <xsl:when test="$labeltype = 'labelname'">
+        <xsl:call-template name="gentext">
+          <xsl:with-param name="key">
+            <xsl:choose>
+              <xsl:when test="local-name($referrer) = 'olink'">
+                <xsl:value-of select="$target.elem"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="local-name(.)"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$labeltype = 'labelnumber'">
+        <xsl:text>%n</xsl:text>
+      </xsl:when>
+      <xsl:when test="$labeltype = 'label'">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'xref-number'"/>
+          <xsl:with-param name="name">
+            <xsl:choose>
+              <xsl:when test="local-name($referrer) = 'olink'">
+                <xsl:value-of select="$target.elem"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:call-template name="xpath.location"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+          <xsl:with-param name="purpose" select="$purpose"/>
+          <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+          <xsl:with-param name="referrer" select="$referrer"/>
+        </xsl:call-template>
+      </xsl:when>
+    </xsl:choose>
+
+    <xsl:choose>
+      <xsl:when test="$titletype != ''">
+        <xsl:value-of select="$xref.label-title.separator"/>
+      </xsl:when>
+      <xsl:when test="$pagetype != ''">
+        <xsl:value-of select="$xref.label-page.separator"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:if>
+
+  <xsl:if test="$titletype != ''">
+    <xsl:choose>
+      <xsl:when test="$titletype = 'title'">
+        <xsl:text>%t</xsl:text>
+      </xsl:when>
+      <xsl:when test="$titletype = 'quotedtitle'">
+        <xsl:call-template name="gentext.dingbat">
+          <xsl:with-param name="dingbat" select="'startquote'"/>
+        </xsl:call-template>
+        <xsl:text>%t</xsl:text>
+        <xsl:call-template name="gentext.dingbat">
+          <xsl:with-param name="dingbat" select="'endquote'"/>
+        </xsl:call-template>
+      </xsl:when>
+    </xsl:choose>
+
+    <xsl:choose>
+      <xsl:when test="$pagetype != '' and $pagetype != 'nopage'">
+        <xsl:value-of select="$xref.title-page.separator"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:if>
+  
+  <!-- special case: use regular xref template if just turning off page -->
+  <xsl:if test="($pagetype = 'nopage' or $docnametype = 'nodocname')
+                  and local-name($referrer) != 'olink'
+                  and $labeltype = '' 
+                  and $titletype = ''">
+    <xsl:apply-templates select="." mode="object.xref.template">
+      <xsl:with-param name="purpose" select="$purpose"/>
+      <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+      <xsl:with-param name="referrer" select="$referrer"/>
+    </xsl:apply-templates>
+  </xsl:if>
+
+  <xsl:if test="$pagetype != ''">
+    <xsl:choose>
+      <xsl:when test="$pagetype = 'page'">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'xref'"/>
+          <xsl:with-param name="name" select="'page'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$pagetype = 'Page'">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'xref'"/>
+          <xsl:with-param name="name" select="'Page'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$pagetype = 'pageabbrev'">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'xref'"/>
+          <xsl:with-param name="name" select="'pageabbrev'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$pagetype = 'pagenumber'">
+        <xsl:text>%p</xsl:text>
+      </xsl:when>
+    </xsl:choose>
+
+  </xsl:if>
+
+  <!-- Add reference to other document title -->
+  <xsl:if test="$docnametype != '' and local-name($referrer) = 'olink'">
+    <!-- Any separator should be in the gentext template -->
+    <xsl:choose>
+      <xsl:when test="$docnametype = 'docnamelong'">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'xref'"/>
+          <xsl:with-param name="name" select="'docnamelong'"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="$docnametype = 'docname'">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'xref'"/>
+          <xsl:with-param name="name" select="'docname'"/>
+        </xsl:call-template>
+      </xsl:when>
+    </xsl:choose>
+
+  </xsl:if>
+  
+</xsl:template>
+
+</xsl:stylesheet>

+ 111 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/insertfile.xsl

@@ -0,0 +1,111 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xi="http://www.w3.org/2001/XInclude"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<xsl:param name="textdata.default.encoding"></xsl:param>
+
+<!-- * This stylesheet makes a copy of a source tree, replacing all -->
+<!-- * instances of the following with corresponding Xinclude instances -->
+<!-- * in the result tree. -->
+<!-- * -->
+<!-- *   <textobject><textdata fileref="foo.txt"> -->
+<!-- *   <imagedata format="linespecific" fileref="foo.txt"> -->
+<!-- *   <inlinegraphic format="linespecific" fileref="foo.txt"> -->
+<!-- * -->
+<!-- * Those become: -->
+<!-- * -->
+<!-- *   <xi:include href="foo.txt" parse="text"/> -->
+<!-- * -->
+<!-- * It also works as expected with entityref in place of fileref, -->
+<!-- * and copies over the value of the <textdata>“encoding” atrribute (if -->
+<!-- * found). It is basically intended as an alternative to using the -->
+<!-- * DocBook XSLT Java insertfile() extension. -->
+
+<!-- ==================================================================== -->
+
+<xsl:template name="get.external.filename">
+  <xsl:choose>
+    <xsl:when test="@entityref">
+      <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="@fileref"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="textobject[child::textdata[@entityref|@fileref]]">
+  <xsl:apply-templates select="textdata"/>
+</xsl:template>
+
+<xsl:template match="textdata[@entityref|@fileref]">
+  <xsl:variable name="filename">
+    <xsl:call-template name="get.external.filename"/>
+  </xsl:variable>
+  <xsl:variable name="encoding">
+    <xsl:choose>
+      <xsl:when test="@encoding">
+        <xsl:value-of select="@encoding"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$textdata.default.encoding"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xi:include href="{$filename}" parse="text" encoding="{$encoding}"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template
+    match="inlinemediaobject
+           [child::imageobject
+           [child::imagedata
+           [@format = 'linespecific' and
+           (@entityref|@fileref)]]]">
+  <xsl:apply-templates select="imageobject/imagedata"/>
+</xsl:template>
+
+<xsl:template match="imagedata
+                     [@format = 'linespecific' and
+                     (@entityref|@fileref)]">
+  <xsl:variable name="filename">
+    <xsl:call-template name="get.external.filename"/>
+  </xsl:variable>
+  <xi:include href="{$filename}" parse="text" encoding="{$textdata.default.encoding}"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="inlinegraphic
+                     [@format = 'linespecific' and
+                     (@entityref|@fileref)]">
+  <xsl:variable name="filename">
+    <xsl:call-template name="get.external.filename"/>
+  </xsl:variable>
+  <xi:include href="{$filename}" parse="text" encoding="{$textdata.default.encoding}"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!-- * copy everything else into result tree as-is -->
+<xsl:template match="node() | @*">
+  <xsl:copy>
+    <xsl:apply-templates select="@* | node()"/>
+  </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>

+ 1216 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/it.xml

@@ -0,0 +1,1216 @@
+<?xml version="1.0" encoding="utf-8"?>
+<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="it" english-language-name="Italian">
+
+<!-- * This file is generated automatically. -->
+<!-- * To submit changes to this file upstream (to the DocBook Project) -->
+<!-- * do not submit an edited version of this file. Instead, submit an -->
+<!-- * edited version of the source file at the following location: -->
+<!-- * -->
+<!-- *  https://svn.sourceforge.net/svnroot/docbook/trunk/gentext/locale/it.xml -->
+<!-- * -->
+<!-- * E-mail the edited it.xml source file to: -->
+<!-- * -->
+<!-- *  docbook-developers@lists.sourceforge.net -->
+
+<!-- ******************************************************************** -->
+
+<!-- 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. -->
+
+<!-- ******************************************************************** -->
+
+<l:gentext key="Abstract" text="Estratto"/>
+<l:gentext key="abstract" text="Estratto"/>
+<l:gentext key="Answer" text="R:"/>
+<l:gentext key="answer" text="R:"/>
+<l:gentext key="Appendix" text="Appendice"/>
+<l:gentext key="appendix" text="appendice"/>
+<l:gentext key="Article" text="Articolo"/>
+<l:gentext key="article" text="Articolo"/>
+<l:gentext key="Author" text="Autori"/>
+<l:gentext key="Bibliography" text="Bibliografia"/>
+<l:gentext key="bibliography" text="Bibliografia"/>
+<l:gentext key="Book" text="Libro"/>
+<l:gentext key="book" text="Libro"/>
+<l:gentext key="CAUTION" text="ATTENZIONE"/>
+<l:gentext key="Caution" text="Attenzione"/>
+<l:gentext key="caution" text="Attenzione"/>
+<l:gentext key="Chapter" text="Capitolo"/>
+<l:gentext key="chapter" text="capitolo"/>
+<l:gentext key="Colophon" text="Colophon"/>
+<l:gentext key="colophon" text="Colophon"/>
+<l:gentext key="Copyright" text="Copyright"/>
+<l:gentext key="copyright" text="Copyright"/>
+<l:gentext key="Dedication" text="Dedica"/>
+<l:gentext key="dedication" text="Dedica"/>
+<l:gentext key="Edition" text="Edizione"/>
+<l:gentext key="edition" text="Edizione"/>
+<l:gentext key="Editor" text="Editor" lang="en"/>
+<l:gentext key="Equation" text="Equazione"/>
+<l:gentext key="equation" text="Equazione"/>
+<l:gentext key="Example" text="Esempio"/>
+<l:gentext key="example" text="Esempio"/>
+<l:gentext key="Figure" text="Figura"/>
+<l:gentext key="figure" text="Figura"/>
+<l:gentext key="Glossary" text="Glossario"/>
+<l:gentext key="glossary" text="Glossario"/>
+<l:gentext key="GlossSee" text="Vedi"/>
+<l:gentext key="glosssee" text="Vedi"/>
+<l:gentext key="GlossSeeAlso" text="Vedi Anche"/>
+<l:gentext key="glossseealso" text="Vedi Anche"/>
+<l:gentext key="IMPORTANT" text="IMPORTANTE"/>
+<l:gentext key="important" text="Importante"/>
+<l:gentext key="Important" text="Importante"/>
+<l:gentext key="Index" text="Indice"/>
+<l:gentext key="index" text="Indice"/>
+<l:gentext key="ISBN" text="ISBN"/>
+<l:gentext key="isbn" text="ISBN"/>
+<l:gentext key="LegalNotice" text="Note Legali"/>
+<l:gentext key="legalnotice" text="Note Legali"/>
+<l:gentext key="MsgAud" text="Pubblico"/>
+<l:gentext key="msgaud" text="Pubblico"/>
+<l:gentext key="MsgLevel" text="Livello"/>
+<l:gentext key="msglevel" text="Livello"/>
+<l:gentext key="MsgOrig" text="Origine"/>
+<l:gentext key="msgorig" text="Origine"/>
+<l:gentext key="NOTE" text="NOTA"/>
+<l:gentext key="Note" text="Nota"/>
+<l:gentext key="note" text="Nota"/>
+<l:gentext key="Part" text="Parte"/>
+<l:gentext key="part" text="Parte"/>
+<l:gentext key="Preface" text="Prefazione"/>
+<l:gentext key="preface" text="Prefazione"/>
+<l:gentext key="Procedure" text="Procedura"/>
+<l:gentext key="procedure" text="Procedura"/>
+<l:gentext key="ProductionSet" text="Produzione"/>
+<l:gentext key="PubDate" text="Data di pubblicazione"/>
+<l:gentext key="pubdate" text="Data di pubblicazione"/>
+<l:gentext key="Published" text="Pubblicato"/>
+<l:gentext key="published" text="Pubblicato"/>
+<l:gentext key="Publisher" text="Publisher" lang="en"/>
+<l:gentext key="Qandadiv" text="D e R"/>
+<l:gentext key="qandadiv" text="D e R"/>
+<l:gentext key="QandASet" text="Frequently Asked Questions" lang="en"/>
+<l:gentext key="Question" text="D:"/>
+<l:gentext key="question" text="D:"/>
+<l:gentext key="RefEntry" text=""/>
+<l:gentext key="refentry" text=""/>
+<l:gentext key="Reference" text="Riferimento"/>
+<l:gentext key="reference" text="Riferimento"/>
+<l:gentext key="References" text="Riferimenti"/>
+<l:gentext key="RefName" text="Nome"/>
+<l:gentext key="refname" text="Nome"/>
+<l:gentext key="RefSection" text=""/>
+<l:gentext key="refsection" text=""/>
+<l:gentext key="RefSynopsisDiv" text="Sinossi"/>
+<l:gentext key="refsynopsisdiv" text="Sinossi"/>
+<l:gentext key="RevHistory" text="Diario delle Revisioni"/>
+<l:gentext key="revhistory" text="Diario delle Revisioni"/>
+<l:gentext key="revision" text="Revisione"/>
+<l:gentext key="Revision" text="Revisione"/>
+<l:gentext key="sect1" text="Sezione"/>
+<l:gentext key="sect2" text="Sezione"/>
+<l:gentext key="sect3" text="Sezione"/>
+<l:gentext key="sect4" text="Sezione"/>
+<l:gentext key="sect5" text="Sezione"/>
+<l:gentext key="section" text="Sezione"/>
+<l:gentext key="Section" text="Sezione"/>
+<l:gentext key="see" text="Vd."/>
+<l:gentext key="See" text="Vd."/>
+<l:gentext key="seealso" text="Vd. Anche"/>
+<l:gentext key="Seealso" text="Vd. anche"/>
+<l:gentext key="SeeAlso" text="Vd. Anche"/>
+<l:gentext key="set" text="Raccolta"/>
+<l:gentext key="Set" text="Raccolta"/>
+<l:gentext key="setindex" text="Indice Raccolta"/>
+<l:gentext key="SetIndex" text="Indice Raccolta"/>
+<l:gentext key="Sidebar" text=""/>
+<l:gentext key="sidebar" text="nota a margine"/>
+<l:gentext key="step" text="passo"/>
+<l:gentext key="Step" text="Passo"/>
+<l:gentext key="table" text="Tabella"/>
+<l:gentext key="Table" text="Tabella"/>
+<l:gentext key="task" text="Task" lang="en"/>
+<l:gentext key="Task" text="Task" lang="en"/>
+<l:gentext key="tip" text="Suggerimento"/>
+<l:gentext key="TIP" text="SUGGERIMENTO"/>
+<l:gentext key="Tip" text="Suggerimento"/>
+<l:gentext key="Warning" text="Avvertimento"/>
+<l:gentext key="warning" text="avvertimento"/>
+<l:gentext key="WARNING" text="AVVERTIMENTO"/>
+<l:gentext key="and" text="e"/>
+<l:gentext key="by" text="di"/>
+<l:gentext key="Edited" text="A cura"/>
+<l:gentext key="edited" text="A cura"/>
+<l:gentext key="Editedby" text="A cura di"/>
+<l:gentext key="editedby" text="A cura di"/>
+<l:gentext key="in" text="in"/>
+<l:gentext key="lastlistcomma" text=","/>
+<l:gentext key="listcomma" text=","/>
+<l:gentext key="nonexistantelement" text="elemento non esistente"/>
+<l:gentext key="notes" text="Note"/>
+<l:gentext key="Notes" text="Note"/>
+<l:gentext key="Pgs" text="pp."/>
+<l:gentext key="pgs" text="pp."/>
+<l:gentext key="Revisedby" text="Revisionato da: "/>
+<l:gentext key="revisedby" text="Revisionato da: "/>
+<l:gentext key="TableNotes" text="Note"/>
+<l:gentext key="tablenotes" text="Note"/>
+<l:gentext key="TableofContents" text="Sommario"/>
+<l:gentext key="tableofcontents" text="Sommario"/>
+<l:gentext key="unexpectedelementname" text="Nome elemento inaspettato"/>
+<l:gentext key="unsupported" text="non supportato"/>
+<l:gentext key="xrefto" text="riferimento a"/>
+<l:gentext key="Authors" text="Autori"/>
+<l:gentext key="copyeditor" text="Copy Editor" lang="en"/>
+<l:gentext key="graphicdesigner" text="Designer Grafico"/>
+<l:gentext key="productioneditor" text="Production Editor" lang="en"/>
+<l:gentext key="technicaleditor" text="Technical Editor" lang="en"/>
+<l:gentext key="translator" text="Traduttore"/>
+<l:gentext key="listofequations" text="Lista delle Equazioni"/>
+<l:gentext key="ListofEquations" text="Lista delle Equazioni"/>
+<l:gentext key="ListofExamples" text="Lista degli Esempi"/>
+<l:gentext key="listofexamples" text="Lista degli Esempi"/>
+<l:gentext key="ListofFigures" text="Lista delle Figure"/>
+<l:gentext key="listoffigures" text="Lista delle Figure"/>
+<l:gentext key="ListofProcedures" text="Lista delle procedure"/>
+<l:gentext key="listofprocedures" text="Lista delle procedure"/>
+<l:gentext key="listoftables" text="Lista delle Tabelle"/>
+<l:gentext key="ListofTables" text="Lista delle Tabelle"/>
+<l:gentext key="ListofUnknown" text="Lista degli Sconosciuti"/>
+<l:gentext key="listofunknown" text="Lista degli Sconosciuti"/>
+<l:gentext key="nav-home" text="Partenza"/>
+<l:gentext key="nav-next" text="Avanti"/>
+<l:gentext key="nav-next-sibling" text="Salta Avanti"/>
+<l:gentext key="nav-prev" text="Indietro"/>
+<l:gentext key="nav-prev-sibling" text="Salta Indietro"/>
+<l:gentext key="nav-up" text="Risali"/>
+<l:gentext key="nav-toc" text="ToC" lang="en"/>
+<l:gentext key="Draft" text="Bozza"/>
+<l:gentext key="above" text="sopra"/>
+<l:gentext key="below" text="sotto"/>
+<l:gentext key="sectioncalled" text="la sezione chiamata"/>
+<l:gentext key="index symbols" text="Simboli"/>
+<l:gentext key="lowercase.alpha" text="abcdefghijklmnopqrstuvwxyz"/>
+<l:gentext key="uppercase.alpha" text="ABCDEFGHIJKLMNOPQRSTUVWXYZ"/>
+<l:gentext key="normalize.sort.input" text="AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ" lang="en"/>
+<l:gentext key="normalize.sort.output" text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ" lang="en"/>
+<l:dingbat key="startquote" text="«"/>
+<l:dingbat key="endquote" text="»"/>
+<l:dingbat key="nestedstartquote" text="“"/>
+<l:dingbat key="nestedendquote" text="”"/>
+<l:dingbat key="singlestartquote" text="‘" lang="en"/>
+<l:dingbat key="singleendquote" text="’" lang="en"/>
+<l:dingbat key="bullet" text="•"/>
+<l:gentext key="hyphenation-character" text="-" lang="en"/>
+<l:gentext key="hyphenation-push-character-count" text="2" lang="en"/>
+<l:gentext key="hyphenation-remain-character-count" text="2" lang="en"/>
+<l:context name="styles"><l:template name="person-name" text="first-last"/>
+</l:context>
+<l:context name="title"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="%t"/>
+<l:template name="appendix" text="Appendice %n. %t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="biblioentry" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliolist" text="%t" lang="en"/>
+<l:template name="bibliomixed" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="Capitolo %n. %t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="Equazione %n. %t"/>
+<l:template name="example" text="Esempio %n. %t"/>
+<l:template name="figure" text="Figura %n. %t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="glosslist" text="%t" lang="en"/>
+<l:template name="glossentry" text="%t" lang="en"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text=""/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="Parte %n. %t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="procedure.formal" text="Procedura %n. %t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="productionset.formal" text="Produzione %n"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="%t"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="%t"/>
+<l:template name="refentry" text="%t"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsection" text="%t"/>
+<l:template name="refsect1" text="%t"/>
+<l:template name="refsect2" text="%t"/>
+<l:template name="refsect3" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="refsynopsisdivinfo" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="step" text="%t"/>
+<l:template name="table" text="Tabella %n. %t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tasksummary" text="%t" lang="en"/>
+<l:template name="taskprerequisites" text="%t" lang="en"/>
+<l:template name="taskrelated" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text=""/>
+<l:template name="warning" text="%t"/>
+</l:context>
+<l:context name="title-unnumbered"><l:template name="appendix" text="%t"/>
+<l:template name="article/appendix" text="%t" lang="en"/>
+<l:template name="bridgehead" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="sect1" text="%t"/>
+<l:template name="sect2" text="%t"/>
+<l:template name="sect3" text="%t"/>
+<l:template name="sect4" text="%t"/>
+<l:template name="sect5" text="%t"/>
+<l:template name="section" text="%t"/>
+<l:template name="simplesect" text="%t"/>
+<l:template name="part" text="%t" lang="en"/>
+</l:context>
+<l:context name="title-numbered"><l:template name="appendix" text="Appendice %n. %t"/>
+<l:template name="article/appendix" text="%n. %t" lang="en"/>
+<l:template name="bridgehead" text="%n. %t"/>
+<l:template name="chapter" text="Capitolo %n. %t"/>
+<l:template name="part" text="Parte %n. %t"/>
+<l:template name="sect1" text="%n. %t"/>
+<l:template name="sect2" text="%n. %t"/>
+<l:template name="sect3" text="%n. %t"/>
+<l:template name="sect4" text="%n. %t"/>
+<l:template name="sect5" text="%n. %t"/>
+<l:template name="section" text="%n. %t"/>
+<l:template name="simplesect" text="%t"/>
+</l:context>
+<l:context name="subtitle"><l:template name="appendix" text="%s"/>
+<l:template name="article" text="%s"/>
+<l:template name="bibliodiv" text="%s"/>
+<l:template name="biblioentry" text="%s"/>
+<l:template name="bibliography" text="%s"/>
+<l:template name="bibliomixed" text="%s"/>
+<l:template name="bibliomset" text="%s"/>
+<l:template name="biblioset" text="%s"/>
+<l:template name="book" text="%s"/>
+<l:template name="chapter" text="%s"/>
+<l:template name="colophon" text="%s"/>
+<l:template name="dedication" text="%s"/>
+<l:template name="glossary" text="%s"/>
+<l:template name="glossdiv" text="%s"/>
+<l:template name="index" text="%s"/>
+<l:template name="indexdiv" text="%s"/>
+<l:template name="lot" text="%s"/>
+<l:template name="part" text="%s"/>
+<l:template name="partintro" text="%s"/>
+<l:template name="preface" text="%s"/>
+<l:template name="refentry" text="%s"/>
+<l:template name="reference" text="%s"/>
+<l:template name="refsection" text="%s"/>
+<l:template name="refsect1" text="%s"/>
+<l:template name="refsect2" text="%s"/>
+<l:template name="refsect3" text="%s"/>
+<l:template name="refsynopsisdiv" text="%s"/>
+<l:template name="sect1" text="%s"/>
+<l:template name="sect2" text="%s"/>
+<l:template name="sect3" text="%s"/>
+<l:template name="sect4" text="%s"/>
+<l:template name="sect5" text="%s"/>
+<l:template name="section" text="%s"/>
+<l:template name="set" text="%s"/>
+<l:template name="setindex" text="%s"/>
+<l:template name="sidebar" text="%s"/>
+<l:template name="simplesect" text="%s"/>
+<l:template name="toc" text="%s"/>
+</l:context>
+<l:context name="xref"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="R: %n"/>
+<l:template name="appendix" text="%t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="constraintdef" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="%t"/>
+<l:template name="example" text="%t"/>
+<l:template name="figure" text="%t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text="%n"/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="%t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="D: %n"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="D: %n"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="table" text="%t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="%n"/>
+<l:template name="warning" text="%t"/>
+<l:template name="olink.document.citation" text=" in %o" lang="en"/>
+<l:template name="olink.page.citation" text=" (page %p)" lang="en"/>
+<l:template name="page.citation" text=" [%p]"/>
+<l:template name="page" text="(page %p)" lang="en"/>
+<l:template name="docname" text=" in %o" lang="en"/>
+<l:template name="docnamelong" text=" in the document titled %o" lang="en"/>
+<l:template name="pageabbrev" text="(p. %p)" lang="en"/>
+<l:template name="Page" text="Page %p" lang="en"/>
+<l:template name="bridgehead" text="la sezione chiamata «%t»"/>
+<l:template name="refsection" text="la sezione chiamata «%t»"/>
+<l:template name="refsect1" text="la sezione chiamata «%t»"/>
+<l:template name="refsect2" text="la sezione chiamata «%t»"/>
+<l:template name="refsect3" text="la sezione chiamata «%t»"/>
+<l:template name="sect1" text="la sezione chiamata «%t»"/>
+<l:template name="sect2" text="la sezione chiamata «%t»"/>
+<l:template name="sect3" text="la sezione chiamata «%t»"/>
+<l:template name="sect4" text="la sezione chiamata «%t»"/>
+<l:template name="sect5" text="la sezione chiamata «%t»"/>
+<l:template name="section" text="la sezione chiamata «%t»"/>
+<l:template name="simplesect" text="la sezione chiamata «%t»"/>
+</l:context>
+<l:context name="xref-number"><l:template name="answer" text="R: %n"/>
+<l:template name="appendix" text="Appendice %n"/>
+<l:template name="bridgehead" text="Sezione %n"/>
+<l:template name="chapter" text="Capitolo %n"/>
+<l:template name="equation" text="Equazione %n"/>
+<l:template name="example" text="Esempio %n"/>
+<l:template name="figure" text="Figura %n"/>
+<l:template name="part" text="Parte %n"/>
+<l:template name="procedure" text="Procedura %n"/>
+<l:template name="productionset" text="Produzione %n"/>
+<l:template name="qandadiv" text="D e R %n"/>
+<l:template name="qandaentry" text="D: %n"/>
+<l:template name="question" text="D: %n"/>
+<l:template name="sect1" text="Sezione %n"/>
+<l:template name="sect2" text="Sezione %n"/>
+<l:template name="sect3" text="Sezione %n"/>
+<l:template name="sect4" text="Sezione %n"/>
+<l:template name="sect5" text="Sezione %n"/>
+<l:template name="section" text="Sezione %n"/>
+<l:template name="table" text="Tabella %n"/>
+</l:context>
+<l:context name="xref-number-and-title"><l:template name="appendix" text="Appendice %n, %t"/>
+<l:template name="bridgehead" text="Sezione %n, «%t»"/>
+<l:template name="chapter" text="Capitolo %n, %t"/>
+<l:template name="equation" text="Equazione %n, «%t»"/>
+<l:template name="example" text="Esempio %n, «%t»"/>
+<l:template name="figure" text="Figura %n, «%t»"/>
+<l:template name="part" text="Parte %n, «%t»"/>
+<l:template name="procedure" text="Procedura %n, «%t»"/>
+<l:template name="productionset" text="Produzione %n, «%t»"/>
+<l:template name="qandadiv" text="D e R %n, «%t»"/>
+<l:template name="refsect1" text="la sezione chiamata «%t»"/>
+<l:template name="refsect2" text="la sezione chiamata «%t»"/>
+<l:template name="refsect3" text="la sezione chiamata «%t»"/>
+<l:template name="refsection" text="la sezione chiamata «%t»"/>
+<l:template name="sect1" text="Sezione %n, «%t»"/>
+<l:template name="sect2" text="Sezione %n, «%t»"/>
+<l:template name="sect3" text="Sezione %n, «%t»"/>
+<l:template name="sect4" text="Sezione %n, «%t»"/>
+<l:template name="sect5" text="Sezione %n, «%t»"/>
+<l:template name="section" text="Sezione %n, «%t»"/>
+<l:template name="simplesect" text="la sezione chiamata «%t»"/>
+<l:template name="table" text="Tabella %n, «%t»"/>
+</l:context>
+<l:context name="authorgroup"><l:template name="sep" text=", "/>
+<l:template name="sep2" text=" e "/>
+<l:template name="seplast" text=", e "/>
+</l:context>
+<l:context name="glossary"><l:template name="see" text="Vedi %t"/>
+<l:template name="seealso" text="Vedi Anche %t"/>
+</l:context>
+<l:context name="msgset"><l:template name="MsgAud" text="Pubblico: "/>
+<l:template name="MsgLevel" text="Livello: "/>
+<l:template name="MsgOrig" text="Origine: "/>
+</l:context>
+<l:context name="datetime"><l:template name="format" text="d/m/Y"/>
+</l:context>
+<l:context name="termdef"><l:template name="prefix" text="[Definition: " lang="en"/>
+<l:template name="suffix" text="]" lang="en"/>
+</l:context>
+<l:context name="datetime-full"><l:template name="January" text="gennaio"/>
+<l:template name="February" text="febbraio"/>
+<l:template name="March" text="marzo"/>
+<l:template name="April" text="aprile"/>
+<l:template name="May" text="maggio"/>
+<l:template name="June" text="giugno"/>
+<l:template name="July" text="luglio"/>
+<l:template name="August" text="agosto"/>
+<l:template name="September" text="settembre"/>
+<l:template name="October" text="ottobre"/>
+<l:template name="November" text="novembre"/>
+<l:template name="December" text="dicembre"/>
+<l:template name="Monday" text="lunedì"/>
+<l:template name="Tuesday" text="martedì"/>
+<l:template name="Wednesday" text="mercoledì"/>
+<l:template name="Thursday" text="giovedì"/>
+<l:template name="Friday" text="venerdì"/>
+<l:template name="Saturday" text="sabato"/>
+<l:template name="Sunday" text="domenica"/>
+</l:context>
+<l:context name="datetime-abbrev"><l:template name="Jan" text="gen"/>
+<l:template name="Feb" text="feb"/>
+<l:template name="Mar" text="mar"/>
+<l:template name="Apr" text="apr"/>
+<l:template name="May" text="mag"/>
+<l:template name="Jun" text="giu"/>
+<l:template name="Jul" text="lug"/>
+<l:template name="Aug" text="ago"/>
+<l:template name="Sep" text="set"/>
+<l:template name="Oct" text="ott"/>
+<l:template name="Nov" text="nov"/>
+<l:template name="Dec" text="dic"/>
+<l:template name="Mon" text="lun"/>
+<l:template name="Tue" text="mar"/>
+<l:template name="Wed" text="mer"/>
+<l:template name="Thu" text="gio"/>
+<l:template name="Fri" text="ven"/>
+<l:template name="Sat" text="sab"/>
+<l:template name="Sun" text="dom"/>
+</l:context>
+<l:context name="htmlhelp"><l:template name="langcode" text="0x0410 Italian"/>
+</l:context>
+<l:context name="index"><l:template name="term-separator" text=", " lang="en"/>
+<l:template name="number-separator" text=", " lang="en"/>
+<l:template name="range-separator" text="-" lang="en"/>
+</l:context>
+<l:context name="iso690"><l:template name="lastfirst.sep" text=", " lang="en"/>
+<l:template name="alt.person.two.sep" text=" – " lang="en"/>
+<l:template name="alt.person.last.sep" text=" – " lang="en"/>
+<l:template name="alt.person.more.sep" text=" – " lang="en"/>
+<l:template name="primary.editor" text=" (ed.)" lang="en"/>
+<l:template name="primary.many" text=", et al." lang="en"/>
+<l:template name="primary.sep" text=". " lang="en"/>
+<l:template name="submaintitle.sep" text=": " lang="en"/>
+<l:template name="title.sep" text=". " lang="en"/>
+<l:template name="othertitle.sep" text=", " lang="en"/>
+<l:template name="medium1" text=" [" lang="en"/>
+<l:template name="medium2" text="]" lang="en"/>
+<l:template name="secondary.person.sep" text="; " lang="en"/>
+<l:template name="secondary.sep" text=". " lang="en"/>
+<l:template name="respons.sep" text=". " lang="en"/>
+<l:template name="edition.sep" text=". " lang="en"/>
+<l:template name="edition.serial.sep" text=", " lang="en"/>
+<l:template name="issuing.range" text="-" lang="en"/>
+<l:template name="issuing.div" text=", " lang="en"/>
+<l:template name="issuing.sep" text=". " lang="en"/>
+<l:template name="partnr.sep" text=". " lang="en"/>
+<l:template name="placepubl.sep" text=": " lang="en"/>
+<l:template name="publyear.sep" text=", " lang="en"/>
+<l:template name="pubinfo.sep" text=". " lang="en"/>
+<l:template name="spec.pubinfo.sep" text=", " lang="en"/>
+<l:template name="upd.sep" text=", " lang="en"/>
+<l:template name="datecit1" text=" [cited " lang="en"/>
+<l:template name="datecit2" text="]" lang="en"/>
+<l:template name="extent.sep" text=". " lang="en"/>
+<l:template name="locs.sep" text=", " lang="en"/>
+<l:template name="location.sep" text=". " lang="en"/>
+<l:template name="serie.sep" text=". " lang="en"/>
+<l:template name="notice.sep" text=". " lang="en"/>
+<l:template name="access" text="Available " lang="en"/>
+<l:template name="acctoo" text="Also available " lang="en"/>
+<l:template name="onwww" text="from World Wide Web" lang="en"/>
+<l:template name="oninet" text="from Internet" lang="en"/>
+<l:template name="access.end" text=": " lang="en"/>
+<l:template name="link1" text="&lt;" lang="en"/>
+<l:template name="link2" text="&gt;" lang="en"/>
+<l:template name="access.sep" text=". " lang="en"/>
+<l:template name="isbn" text="ISBN " lang="en"/>
+<l:template name="issn" text="ISSN " lang="en"/>
+<l:template name="stdnum.sep" text=". " lang="en"/>
+<l:template name="patcountry.sep" text=". " lang="en"/>
+<l:template name="pattype.sep" text=", " lang="en"/>
+<l:template name="patnum.sep" text=". " lang="en"/>
+<l:template name="patdate.sep" text=". " lang="en"/>
+</l:context><l:letters lang="en"><l:l i="-1"/>
+<l:l i="0">Symbols</l:l>
+<l:l i="10">A</l:l>
+<l:l i="10">a</l:l>
+<l:l i="10">À</l:l>
+<l:l i="10">à</l:l>
+<l:l i="10">Á</l:l>
+<l:l i="10">á</l:l>
+<l:l i="10">Â</l:l>
+<l:l i="10">â</l:l>
+<l:l i="10">Ã</l:l>
+<l:l i="10">ã</l:l>
+<l:l i="10">Ä</l:l>
+<l:l i="10">ä</l:l>
+<l:l i="10">Å</l:l>
+<l:l i="10">å</l:l>
+<l:l i="10">Ā</l:l>
+<l:l i="10">ā</l:l>
+<l:l i="10">Ă</l:l>
+<l:l i="10">ă</l:l>
+<l:l i="10">Ą</l:l>
+<l:l i="10">ą</l:l>
+<l:l i="10">Ǎ</l:l>
+<l:l i="10">ǎ</l:l>
+<l:l i="10">Ǟ</l:l>
+<l:l i="10">ǟ</l:l>
+<l:l i="10">Ǡ</l:l>
+<l:l i="10">ǡ</l:l>
+<l:l i="10">Ǻ</l:l>
+<l:l i="10">ǻ</l:l>
+<l:l i="10">Ȁ</l:l>
+<l:l i="10">ȁ</l:l>
+<l:l i="10">Ȃ</l:l>
+<l:l i="10">ȃ</l:l>
+<l:l i="10">Ȧ</l:l>
+<l:l i="10">ȧ</l:l>
+<l:l i="10">Ḁ</l:l>
+<l:l i="10">ḁ</l:l>
+<l:l i="10">ẚ</l:l>
+<l:l i="10">Ạ</l:l>
+<l:l i="10">ạ</l:l>
+<l:l i="10">Ả</l:l>
+<l:l i="10">ả</l:l>
+<l:l i="10">Ấ</l:l>
+<l:l i="10">ấ</l:l>
+<l:l i="10">Ầ</l:l>
+<l:l i="10">ầ</l:l>
+<l:l i="10">Ẩ</l:l>
+<l:l i="10">ẩ</l:l>
+<l:l i="10">Ẫ</l:l>
+<l:l i="10">ẫ</l:l>
+<l:l i="10">Ậ</l:l>
+<l:l i="10">ậ</l:l>
+<l:l i="10">Ắ</l:l>
+<l:l i="10">ắ</l:l>
+<l:l i="10">Ằ</l:l>
+<l:l i="10">ằ</l:l>
+<l:l i="10">Ẳ</l:l>
+<l:l i="10">ẳ</l:l>
+<l:l i="10">Ẵ</l:l>
+<l:l i="10">ẵ</l:l>
+<l:l i="10">Ặ</l:l>
+<l:l i="10">ặ</l:l>
+<l:l i="20">B</l:l>
+<l:l i="20">b</l:l>
+<l:l i="20">ƀ</l:l>
+<l:l i="20">Ɓ</l:l>
+<l:l i="20">ɓ</l:l>
+<l:l i="20">Ƃ</l:l>
+<l:l i="20">ƃ</l:l>
+<l:l i="20">Ḃ</l:l>
+<l:l i="20">ḃ</l:l>
+<l:l i="20">Ḅ</l:l>
+<l:l i="20">ḅ</l:l>
+<l:l i="20">Ḇ</l:l>
+<l:l i="20">ḇ</l:l>
+<l:l i="30">C</l:l>
+<l:l i="30">c</l:l>
+<l:l i="30">Ç</l:l>
+<l:l i="30">ç</l:l>
+<l:l i="30">Ć</l:l>
+<l:l i="30">ć</l:l>
+<l:l i="30">Ĉ</l:l>
+<l:l i="30">ĉ</l:l>
+<l:l i="30">Ċ</l:l>
+<l:l i="30">ċ</l:l>
+<l:l i="30">Č</l:l>
+<l:l i="30">č</l:l>
+<l:l i="30">Ƈ</l:l>
+<l:l i="30">ƈ</l:l>
+<l:l i="30">ɕ</l:l>
+<l:l i="30">Ḉ</l:l>
+<l:l i="30">ḉ</l:l>
+<l:l i="40">D</l:l>
+<l:l i="40">d</l:l>
+<l:l i="40">Ď</l:l>
+<l:l i="40">ď</l:l>
+<l:l i="40">Đ</l:l>
+<l:l i="40">đ</l:l>
+<l:l i="40">Ɗ</l:l>
+<l:l i="40">ɗ</l:l>
+<l:l i="40">Ƌ</l:l>
+<l:l i="40">ƌ</l:l>
+<l:l i="40">Dž</l:l>
+<l:l i="40">Dz</l:l>
+<l:l i="40">ȡ</l:l>
+<l:l i="40">ɖ</l:l>
+<l:l i="40">Ḋ</l:l>
+<l:l i="40">ḋ</l:l>
+<l:l i="40">Ḍ</l:l>
+<l:l i="40">ḍ</l:l>
+<l:l i="40">Ḏ</l:l>
+<l:l i="40">ḏ</l:l>
+<l:l i="40">Ḑ</l:l>
+<l:l i="40">ḑ</l:l>
+<l:l i="40">Ḓ</l:l>
+<l:l i="40">ḓ</l:l>
+<l:l i="50">E</l:l>
+<l:l i="50">e</l:l>
+<l:l i="50">È</l:l>
+<l:l i="50">è</l:l>
+<l:l i="50">É</l:l>
+<l:l i="50">é</l:l>
+<l:l i="50">Ê</l:l>
+<l:l i="50">ê</l:l>
+<l:l i="50">Ë</l:l>
+<l:l i="50">ë</l:l>
+<l:l i="50">Ē</l:l>
+<l:l i="50">ē</l:l>
+<l:l i="50">Ĕ</l:l>
+<l:l i="50">ĕ</l:l>
+<l:l i="50">Ė</l:l>
+<l:l i="50">ė</l:l>
+<l:l i="50">Ę</l:l>
+<l:l i="50">ę</l:l>
+<l:l i="50">Ě</l:l>
+<l:l i="50">ě</l:l>
+<l:l i="50">Ȅ</l:l>
+<l:l i="50">ȅ</l:l>
+<l:l i="50">Ȇ</l:l>
+<l:l i="50">ȇ</l:l>
+<l:l i="50">Ȩ</l:l>
+<l:l i="50">ȩ</l:l>
+<l:l i="50">Ḕ</l:l>
+<l:l i="50">ḕ</l:l>
+<l:l i="50">Ḗ</l:l>
+<l:l i="50">ḗ</l:l>
+<l:l i="50">Ḙ</l:l>
+<l:l i="50">ḙ</l:l>
+<l:l i="50">Ḛ</l:l>
+<l:l i="50">ḛ</l:l>
+<l:l i="50">Ḝ</l:l>
+<l:l i="50">ḝ</l:l>
+<l:l i="50">Ẹ</l:l>
+<l:l i="50">ẹ</l:l>
+<l:l i="50">Ẻ</l:l>
+<l:l i="50">ẻ</l:l>
+<l:l i="50">Ẽ</l:l>
+<l:l i="50">ẽ</l:l>
+<l:l i="50">Ế</l:l>
+<l:l i="50">ế</l:l>
+<l:l i="50">Ề</l:l>
+<l:l i="50">ề</l:l>
+<l:l i="50">Ể</l:l>
+<l:l i="50">ể</l:l>
+<l:l i="50">Ễ</l:l>
+<l:l i="50">ễ</l:l>
+<l:l i="50">Ệ</l:l>
+<l:l i="50">ệ</l:l>
+<l:l i="60">F</l:l>
+<l:l i="60">f</l:l>
+<l:l i="60">Ƒ</l:l>
+<l:l i="60">ƒ</l:l>
+<l:l i="60">Ḟ</l:l>
+<l:l i="60">ḟ</l:l>
+<l:l i="70">G</l:l>
+<l:l i="70">g</l:l>
+<l:l i="70">Ĝ</l:l>
+<l:l i="70">ĝ</l:l>
+<l:l i="70">Ğ</l:l>
+<l:l i="70">ğ</l:l>
+<l:l i="70">Ġ</l:l>
+<l:l i="70">ġ</l:l>
+<l:l i="70">Ģ</l:l>
+<l:l i="70">ģ</l:l>
+<l:l i="70">Ɠ</l:l>
+<l:l i="70">ɠ</l:l>
+<l:l i="70">Ǥ</l:l>
+<l:l i="70">ǥ</l:l>
+<l:l i="70">Ǧ</l:l>
+<l:l i="70">ǧ</l:l>
+<l:l i="70">Ǵ</l:l>
+<l:l i="70">ǵ</l:l>
+<l:l i="70">Ḡ</l:l>
+<l:l i="70">ḡ</l:l>
+<l:l i="80">H</l:l>
+<l:l i="80">h</l:l>
+<l:l i="80">Ĥ</l:l>
+<l:l i="80">ĥ</l:l>
+<l:l i="80">Ħ</l:l>
+<l:l i="80">ħ</l:l>
+<l:l i="80">Ȟ</l:l>
+<l:l i="80">ȟ</l:l>
+<l:l i="80">ɦ</l:l>
+<l:l i="80">Ḣ</l:l>
+<l:l i="80">ḣ</l:l>
+<l:l i="80">Ḥ</l:l>
+<l:l i="80">ḥ</l:l>
+<l:l i="80">Ḧ</l:l>
+<l:l i="80">ḧ</l:l>
+<l:l i="80">Ḩ</l:l>
+<l:l i="80">ḩ</l:l>
+<l:l i="80">Ḫ</l:l>
+<l:l i="80">ḫ</l:l>
+<l:l i="80">ẖ</l:l>
+<l:l i="90">I</l:l>
+<l:l i="90">i</l:l>
+<l:l i="90">Ì</l:l>
+<l:l i="90">ì</l:l>
+<l:l i="90">Í</l:l>
+<l:l i="90">í</l:l>
+<l:l i="90">Î</l:l>
+<l:l i="90">î</l:l>
+<l:l i="90">Ï</l:l>
+<l:l i="90">ï</l:l>
+<l:l i="90">Ĩ</l:l>
+<l:l i="90">ĩ</l:l>
+<l:l i="90">Ī</l:l>
+<l:l i="90">ī</l:l>
+<l:l i="90">Ĭ</l:l>
+<l:l i="90">ĭ</l:l>
+<l:l i="90">Į</l:l>
+<l:l i="90">į</l:l>
+<l:l i="90">İ</l:l>
+<l:l i="90">Ɨ</l:l>
+<l:l i="90">ɨ</l:l>
+<l:l i="90">Ǐ</l:l>
+<l:l i="90">ǐ</l:l>
+<l:l i="90">Ȉ</l:l>
+<l:l i="90">ȉ</l:l>
+<l:l i="90">Ȋ</l:l>
+<l:l i="90">ȋ</l:l>
+<l:l i="90">Ḭ</l:l>
+<l:l i="90">ḭ</l:l>
+<l:l i="90">Ḯ</l:l>
+<l:l i="90">ḯ</l:l>
+<l:l i="90">Ỉ</l:l>
+<l:l i="90">ỉ</l:l>
+<l:l i="90">Ị</l:l>
+<l:l i="90">ị</l:l>
+<l:l i="100">J</l:l>
+<l:l i="100">j</l:l>
+<l:l i="100">Ĵ</l:l>
+<l:l i="100">ĵ</l:l>
+<l:l i="100">ǰ</l:l>
+<l:l i="100">ʝ</l:l>
+<l:l i="110">K</l:l>
+<l:l i="110">k</l:l>
+<l:l i="110">Ķ</l:l>
+<l:l i="110">ķ</l:l>
+<l:l i="110">Ƙ</l:l>
+<l:l i="110">ƙ</l:l>
+<l:l i="110">Ǩ</l:l>
+<l:l i="110">ǩ</l:l>
+<l:l i="110">Ḱ</l:l>
+<l:l i="110">ḱ</l:l>
+<l:l i="110">Ḳ</l:l>
+<l:l i="110">ḳ</l:l>
+<l:l i="110">Ḵ</l:l>
+<l:l i="110">ḵ</l:l>
+<l:l i="120">L</l:l>
+<l:l i="120">l</l:l>
+<l:l i="120">Ĺ</l:l>
+<l:l i="120">ĺ</l:l>
+<l:l i="120">Ļ</l:l>
+<l:l i="120">ļ</l:l>
+<l:l i="120">Ľ</l:l>
+<l:l i="120">ľ</l:l>
+<l:l i="120">Ŀ</l:l>
+<l:l i="120">ŀ</l:l>
+<l:l i="120">Ł</l:l>
+<l:l i="120">ł</l:l>
+<l:l i="120">ƚ</l:l>
+<l:l i="120">Lj</l:l>
+<l:l i="120">ȴ</l:l>
+<l:l i="120">ɫ</l:l>
+<l:l i="120">ɬ</l:l>
+<l:l i="120">ɭ</l:l>
+<l:l i="120">Ḷ</l:l>
+<l:l i="120">ḷ</l:l>
+<l:l i="120">Ḹ</l:l>
+<l:l i="120">ḹ</l:l>
+<l:l i="120">Ḻ</l:l>
+<l:l i="120">ḻ</l:l>
+<l:l i="120">Ḽ</l:l>
+<l:l i="120">ḽ</l:l>
+<l:l i="130">M</l:l>
+<l:l i="130">m</l:l>
+<l:l i="130">ɱ</l:l>
+<l:l i="130">Ḿ</l:l>
+<l:l i="130">ḿ</l:l>
+<l:l i="130">Ṁ</l:l>
+<l:l i="130">ṁ</l:l>
+<l:l i="130">Ṃ</l:l>
+<l:l i="130">ṃ</l:l>
+<l:l i="140">N</l:l>
+<l:l i="140">n</l:l>
+<l:l i="140">Ñ</l:l>
+<l:l i="140">ñ</l:l>
+<l:l i="140">Ń</l:l>
+<l:l i="140">ń</l:l>
+<l:l i="140">Ņ</l:l>
+<l:l i="140">ņ</l:l>
+<l:l i="140">Ň</l:l>
+<l:l i="140">ň</l:l>
+<l:l i="140">Ɲ</l:l>
+<l:l i="140">ɲ</l:l>
+<l:l i="140">ƞ</l:l>
+<l:l i="140">Ƞ</l:l>
+<l:l i="140">Nj</l:l>
+<l:l i="140">Ǹ</l:l>
+<l:l i="140">ǹ</l:l>
+<l:l i="140">ȵ</l:l>
+<l:l i="140">ɳ</l:l>
+<l:l i="140">Ṅ</l:l>
+<l:l i="140">ṅ</l:l>
+<l:l i="140">Ṇ</l:l>
+<l:l i="140">ṇ</l:l>
+<l:l i="140">Ṉ</l:l>
+<l:l i="140">ṉ</l:l>
+<l:l i="140">Ṋ</l:l>
+<l:l i="140">ṋ</l:l>
+<l:l i="150">O</l:l>
+<l:l i="150">o</l:l>
+<l:l i="150">Ò</l:l>
+<l:l i="150">ò</l:l>
+<l:l i="150">Ó</l:l>
+<l:l i="150">ó</l:l>
+<l:l i="150">Ô</l:l>
+<l:l i="150">ô</l:l>
+<l:l i="150">Õ</l:l>
+<l:l i="150">õ</l:l>
+<l:l i="150">Ö</l:l>
+<l:l i="150">ö</l:l>
+<l:l i="150">Ø</l:l>
+<l:l i="150">ø</l:l>
+<l:l i="150">Ō</l:l>
+<l:l i="150">ō</l:l>
+<l:l i="150">Ŏ</l:l>
+<l:l i="150">ŏ</l:l>
+<l:l i="150">Ő</l:l>
+<l:l i="150">ő</l:l>
+<l:l i="150">Ɵ</l:l>
+<l:l i="150">Ơ</l:l>
+<l:l i="150">ơ</l:l>
+<l:l i="150">Ǒ</l:l>
+<l:l i="150">ǒ</l:l>
+<l:l i="150">Ǫ</l:l>
+<l:l i="150">ǫ</l:l>
+<l:l i="150">Ǭ</l:l>
+<l:l i="150">ǭ</l:l>
+<l:l i="150">Ǿ</l:l>
+<l:l i="150">ǿ</l:l>
+<l:l i="150">Ȍ</l:l>
+<l:l i="150">ȍ</l:l>
+<l:l i="150">Ȏ</l:l>
+<l:l i="150">ȏ</l:l>
+<l:l i="150">Ȫ</l:l>
+<l:l i="150">ȫ</l:l>
+<l:l i="150">Ȭ</l:l>
+<l:l i="150">ȭ</l:l>
+<l:l i="150">Ȯ</l:l>
+<l:l i="150">ȯ</l:l>
+<l:l i="150">Ȱ</l:l>
+<l:l i="150">ȱ</l:l>
+<l:l i="150">Ṍ</l:l>
+<l:l i="150">ṍ</l:l>
+<l:l i="150">Ṏ</l:l>
+<l:l i="150">ṏ</l:l>
+<l:l i="150">Ṑ</l:l>
+<l:l i="150">ṑ</l:l>
+<l:l i="150">Ṓ</l:l>
+<l:l i="150">ṓ</l:l>
+<l:l i="150">Ọ</l:l>
+<l:l i="150">ọ</l:l>
+<l:l i="150">Ỏ</l:l>
+<l:l i="150">ỏ</l:l>
+<l:l i="150">Ố</l:l>
+<l:l i="150">ố</l:l>
+<l:l i="150">Ồ</l:l>
+<l:l i="150">ồ</l:l>
+<l:l i="150">Ổ</l:l>
+<l:l i="150">ổ</l:l>
+<l:l i="150">Ỗ</l:l>
+<l:l i="150">ỗ</l:l>
+<l:l i="150">Ộ</l:l>
+<l:l i="150">ộ</l:l>
+<l:l i="150">Ớ</l:l>
+<l:l i="150">ớ</l:l>
+<l:l i="150">Ờ</l:l>
+<l:l i="150">ờ</l:l>
+<l:l i="150">Ở</l:l>
+<l:l i="150">ở</l:l>
+<l:l i="150">Ỡ</l:l>
+<l:l i="150">ỡ</l:l>
+<l:l i="150">Ợ</l:l>
+<l:l i="150">ợ</l:l>
+<l:l i="160">P</l:l>
+<l:l i="160">p</l:l>
+<l:l i="160">Ƥ</l:l>
+<l:l i="160">ƥ</l:l>
+<l:l i="160">Ṕ</l:l>
+<l:l i="160">ṕ</l:l>
+<l:l i="160">Ṗ</l:l>
+<l:l i="160">ṗ</l:l>
+<l:l i="170">Q</l:l>
+<l:l i="170">q</l:l>
+<l:l i="170">ʠ</l:l>
+<l:l i="180">R</l:l>
+<l:l i="180">r</l:l>
+<l:l i="180">Ŕ</l:l>
+<l:l i="180">ŕ</l:l>
+<l:l i="180">Ŗ</l:l>
+<l:l i="180">ŗ</l:l>
+<l:l i="180">Ř</l:l>
+<l:l i="180">ř</l:l>
+<l:l i="180">Ȑ</l:l>
+<l:l i="180">ȑ</l:l>
+<l:l i="180">Ȓ</l:l>
+<l:l i="180">ȓ</l:l>
+<l:l i="180">ɼ</l:l>
+<l:l i="180">ɽ</l:l>
+<l:l i="180">ɾ</l:l>
+<l:l i="180">Ṙ</l:l>
+<l:l i="180">ṙ</l:l>
+<l:l i="180">Ṛ</l:l>
+<l:l i="180">ṛ</l:l>
+<l:l i="180">Ṝ</l:l>
+<l:l i="180">ṝ</l:l>
+<l:l i="180">Ṟ</l:l>
+<l:l i="180">ṟ</l:l>
+<l:l i="190">S</l:l>
+<l:l i="190">s</l:l>
+<l:l i="190">Ś</l:l>
+<l:l i="190">ś</l:l>
+<l:l i="190">Ŝ</l:l>
+<l:l i="190">ŝ</l:l>
+<l:l i="190">Ş</l:l>
+<l:l i="190">ş</l:l>
+<l:l i="190">Š</l:l>
+<l:l i="190">š</l:l>
+<l:l i="190">Ș</l:l>
+<l:l i="190">ș</l:l>
+<l:l i="190">ʂ</l:l>
+<l:l i="190">Ṡ</l:l>
+<l:l i="190">ṡ</l:l>
+<l:l i="190">Ṣ</l:l>
+<l:l i="190">ṣ</l:l>
+<l:l i="190">Ṥ</l:l>
+<l:l i="190">ṥ</l:l>
+<l:l i="190">Ṧ</l:l>
+<l:l i="190">ṧ</l:l>
+<l:l i="190">Ṩ</l:l>
+<l:l i="190">ṩ</l:l>
+<l:l i="200">T</l:l>
+<l:l i="200">t</l:l>
+<l:l i="200">Ţ</l:l>
+<l:l i="200">ţ</l:l>
+<l:l i="200">Ť</l:l>
+<l:l i="200">ť</l:l>
+<l:l i="200">Ŧ</l:l>
+<l:l i="200">ŧ</l:l>
+<l:l i="200">ƫ</l:l>
+<l:l i="200">Ƭ</l:l>
+<l:l i="200">ƭ</l:l>
+<l:l i="200">Ʈ</l:l>
+<l:l i="200">ʈ</l:l>
+<l:l i="200">Ț</l:l>
+<l:l i="200">ț</l:l>
+<l:l i="200">ȶ</l:l>
+<l:l i="200">Ṫ</l:l>
+<l:l i="200">ṫ</l:l>
+<l:l i="200">Ṭ</l:l>
+<l:l i="200">ṭ</l:l>
+<l:l i="200">Ṯ</l:l>
+<l:l i="200">ṯ</l:l>
+<l:l i="200">Ṱ</l:l>
+<l:l i="200">ṱ</l:l>
+<l:l i="200">ẗ</l:l>
+<l:l i="210">U</l:l>
+<l:l i="210">u</l:l>
+<l:l i="210">Ù</l:l>
+<l:l i="210">ù</l:l>
+<l:l i="210">Ú</l:l>
+<l:l i="210">ú</l:l>
+<l:l i="210">Û</l:l>
+<l:l i="210">û</l:l>
+<l:l i="210">Ü</l:l>
+<l:l i="210">ü</l:l>
+<l:l i="210">Ũ</l:l>
+<l:l i="210">ũ</l:l>
+<l:l i="210">Ū</l:l>
+<l:l i="210">ū</l:l>
+<l:l i="210">Ŭ</l:l>
+<l:l i="210">ŭ</l:l>
+<l:l i="210">Ů</l:l>
+<l:l i="210">ů</l:l>
+<l:l i="210">Ű</l:l>
+<l:l i="210">ű</l:l>
+<l:l i="210">Ų</l:l>
+<l:l i="210">ų</l:l>
+<l:l i="210">Ư</l:l>
+<l:l i="210">ư</l:l>
+<l:l i="210">Ǔ</l:l>
+<l:l i="210">ǔ</l:l>
+<l:l i="210">Ǖ</l:l>
+<l:l i="210">ǖ</l:l>
+<l:l i="210">Ǘ</l:l>
+<l:l i="210">ǘ</l:l>
+<l:l i="210">Ǚ</l:l>
+<l:l i="210">ǚ</l:l>
+<l:l i="210">Ǜ</l:l>
+<l:l i="210">ǜ</l:l>
+<l:l i="210">Ȕ</l:l>
+<l:l i="210">ȕ</l:l>
+<l:l i="210">Ȗ</l:l>
+<l:l i="210">ȗ</l:l>
+<l:l i="210">Ṳ</l:l>
+<l:l i="210">ṳ</l:l>
+<l:l i="210">Ṵ</l:l>
+<l:l i="210">ṵ</l:l>
+<l:l i="210">Ṷ</l:l>
+<l:l i="210">ṷ</l:l>
+<l:l i="210">Ṹ</l:l>
+<l:l i="210">ṹ</l:l>
+<l:l i="210">Ṻ</l:l>
+<l:l i="210">ṻ</l:l>
+<l:l i="210">Ụ</l:l>
+<l:l i="210">ụ</l:l>
+<l:l i="210">Ủ</l:l>
+<l:l i="210">ủ</l:l>
+<l:l i="210">Ứ</l:l>
+<l:l i="210">ứ</l:l>
+<l:l i="210">Ừ</l:l>
+<l:l i="210">ừ</l:l>
+<l:l i="210">Ử</l:l>
+<l:l i="210">ử</l:l>
+<l:l i="210">Ữ</l:l>
+<l:l i="210">ữ</l:l>
+<l:l i="210">Ự</l:l>
+<l:l i="210">ự</l:l>
+<l:l i="220">V</l:l>
+<l:l i="220">v</l:l>
+<l:l i="220">Ʋ</l:l>
+<l:l i="220">ʋ</l:l>
+<l:l i="220">Ṽ</l:l>
+<l:l i="220">ṽ</l:l>
+<l:l i="220">Ṿ</l:l>
+<l:l i="220">ṿ</l:l>
+<l:l i="230">W</l:l>
+<l:l i="230">w</l:l>
+<l:l i="230">Ŵ</l:l>
+<l:l i="230">ŵ</l:l>
+<l:l i="230">Ẁ</l:l>
+<l:l i="230">ẁ</l:l>
+<l:l i="230">Ẃ</l:l>
+<l:l i="230">ẃ</l:l>
+<l:l i="230">Ẅ</l:l>
+<l:l i="230">ẅ</l:l>
+<l:l i="230">Ẇ</l:l>
+<l:l i="230">ẇ</l:l>
+<l:l i="230">Ẉ</l:l>
+<l:l i="230">ẉ</l:l>
+<l:l i="230">ẘ</l:l>
+<l:l i="240">X</l:l>
+<l:l i="240">x</l:l>
+<l:l i="240">Ẋ</l:l>
+<l:l i="240">ẋ</l:l>
+<l:l i="240">Ẍ</l:l>
+<l:l i="240">ẍ</l:l>
+<l:l i="250">Y</l:l>
+<l:l i="250">y</l:l>
+<l:l i="250">Ý</l:l>
+<l:l i="250">ý</l:l>
+<l:l i="250">ÿ</l:l>
+<l:l i="250">Ÿ</l:l>
+<l:l i="250">Ŷ</l:l>
+<l:l i="250">ŷ</l:l>
+<l:l i="250">Ƴ</l:l>
+<l:l i="250">ƴ</l:l>
+<l:l i="250">Ȳ</l:l>
+<l:l i="250">ȳ</l:l>
+<l:l i="250">Ẏ</l:l>
+<l:l i="250">ẏ</l:l>
+<l:l i="250">ẙ</l:l>
+<l:l i="250">Ỳ</l:l>
+<l:l i="250">ỳ</l:l>
+<l:l i="250">Ỵ</l:l>
+<l:l i="250">ỵ</l:l>
+<l:l i="250">Ỷ</l:l>
+<l:l i="250">ỷ</l:l>
+<l:l i="250">Ỹ</l:l>
+<l:l i="250">ỹ</l:l>
+<l:l i="260">Z</l:l>
+<l:l i="260">z</l:l>
+<l:l i="260">Ź</l:l>
+<l:l i="260">ź</l:l>
+<l:l i="260">Ż</l:l>
+<l:l i="260">ż</l:l>
+<l:l i="260">Ž</l:l>
+<l:l i="260">ž</l:l>
+<l:l i="260">Ƶ</l:l>
+<l:l i="260">ƶ</l:l>
+<l:l i="260">Ȥ</l:l>
+<l:l i="260">ȥ</l:l>
+<l:l i="260">ʐ</l:l>
+<l:l i="260">ʑ</l:l>
+<l:l i="260">Ẑ</l:l>
+<l:l i="260">ẑ</l:l>
+<l:l i="260">Ẓ</l:l>
+<l:l i="260">ẓ</l:l>
+<l:l i="260">Ẕ</l:l>
+<l:l i="260">ẕ</l:l>
+</l:letters>
+</l:l10n>

+ 63 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/l10n.dtd

@@ -0,0 +1,63 @@
+<!ENTITY % prefix "l">
+
+<!ENTITY % xmlns "xmlns:%prefix;">
+<!ENTITY % uri "'http://docbook.sourceforge.net/xmlns/l10n/1.0'">
+
+<!ENTITY % i18n "%prefix;:i18n">
+<!ENTITY % l10n "%prefix;:l10n">
+<!ENTITY % gentext "%prefix;:gentext">
+<!ENTITY % dingbat "%prefix;:dingbat">
+<!ENTITY % context "%prefix;:context">
+<!ENTITY % template "%prefix;:template">
+<!ENTITY % letters "%prefix;:letters">
+<!ENTITY % l "%prefix;:l">
+<!ENTITY % lang "lang NMTOKEN #IMPLIED"> 
+
+<!ELEMENT %i18n; ((%l10n;)+)>
+<!ATTLIST %i18n;
+	%xmlns;		CDATA	#FIXED %uri;
+>
+
+<!ELEMENT %l10n; (%gentext;|%dingbat;|%context;|%letters;)*>
+<!ATTLIST %l10n;
+	%xmlns;		CDATA	#FIXED %uri;
+	language	CDATA	#REQUIRED
+	english-language-name	CDATA	#IMPLIED
+>
+
+<!ELEMENT %gentext; EMPTY>
+<!ATTLIST %gentext;
+	%lang;
+	key		CDATA	#REQUIRED
+	text		CDATA	#REQUIRED
+>
+
+<!ELEMENT %dingbat; EMPTY>
+<!ATTLIST %dingbat;
+        %lang;
+	key		CDATA	#REQUIRED
+	text		CDATA	#REQUIRED
+>
+
+<!ELEMENT %context; ((%template;)+)>
+<!ATTLIST %context;
+	name		CDATA	#REQUIRED
+>
+
+<!ELEMENT %template; EMPTY>
+<!ATTLIST %template;
+        %lang;
+	name		CDATA	#REQUIRED
+	text		CDATA	#REQUIRED
+	style		CDATA	#IMPLIED
+>
+
+<!ELEMENT %letters; ((%l;)+)>
+<!ATTLIST %letters;
+          %lang;
+>
+
+<!ELEMENT %l; (#PCDATA)>
+<!ATTLIST %l;
+          i 		CDATA 	#REQUIRED
+>

+ 19 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/l10n.xml

@@ -0,0 +1,19 @@
+<?xml version='1.0'?>
+<!DOCTYPE l:i18n SYSTEM "l10n.dtd" [
+<!ENTITY de SYSTEM "de.xml">
+<!ENTITY en SYSTEM "en.xml">
+<!ENTITY es SYSTEM "es.xml">
+<!ENTITY fr SYSTEM "fr.xml">
+<!ENTITY it SYSTEM "it.xml">
+<!ENTITY zh_cn SYSTEM "zh_cn.xml">
+<!ENTITY zh_tw SYSTEM "zh_tw.xml">
+]>
+<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
+&de;
+&en;
+&es;
+&fr;
+&it;
+&zh_cn;
+&zh_tw;
+</l:i18n>

+ 441 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/l10n.xsl

@@ -0,0 +1,441 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
+                exclude-result-prefixes="l"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     This file contains localization templates (for internationalization)
+     ******************************************************************** -->
+
+<xsl:param name="l10n.xml" select="document('../common/l10n.xml')"/>
+<xsl:param name="local.l10n.xml" select="document('')"/>
+
+<xsl:template name="l10n.language">
+  <xsl:param name="target" select="."/>
+  <xsl:param name="xref-context" select="false()"/>
+
+  <xsl:variable name="mc-language">
+    <xsl:choose>
+      <xsl:when test="$l10n.gentext.language != ''">
+        <xsl:value-of select="$l10n.gentext.language"/>
+      </xsl:when>
+
+      <xsl:when test="$xref-context or $l10n.gentext.use.xref.language != 0">
+        <!-- can't do this one step: attributes are unordered! -->
+        <xsl:variable name="lang-scope"
+                      select="$target/ancestor-or-self::*
+                              [@lang or @xml:lang][1]"/>
+        <xsl:variable name="lang-attr"
+                      select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
+        <xsl:choose>
+          <xsl:when test="string($lang-attr) = ''">
+            <xsl:value-of select="$l10n.gentext.default.language"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$lang-attr"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- can't do this one step: attributes are unordered! -->
+        <xsl:variable name="lang-scope"
+                      select="$target/ancestor-or-self::*
+                              [@lang or @xml:lang][1]"/>
+        <xsl:variable name="lang-attr"
+                      select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
+
+        <xsl:choose>
+          <xsl:when test="string($lang-attr) = ''">
+            <xsl:value-of select="$l10n.gentext.default.language"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$lang-attr"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="language" select="translate($mc-language,
+                                        'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+                                        'abcdefghijklmnopqrstuvwxyz')"/>
+
+  <xsl:variable name="adjusted.language">
+    <xsl:choose>
+      <xsl:when test="contains($language,'-')">
+        <xsl:value-of select="substring-before($language,'-')"/>
+        <xsl:text>_</xsl:text>
+        <xsl:value-of select="substring-after($language,'-')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$language"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$l10n.xml/l:i18n/l:l10n[@language=$adjusted.language]">
+      <xsl:value-of select="$adjusted.language"/>
+    </xsl:when>
+    <!-- try just the lang code without country -->
+    <xsl:when test="$l10n.xml/l:i18n/l:l10n[@language=substring-before($adjusted.language,'_')]">
+      <xsl:value-of select="substring-before($adjusted.language,'_')"/>
+    </xsl:when>
+    <!-- or use the default -->
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>No localization exists for "</xsl:text>
+        <xsl:value-of select="$adjusted.language"/>
+        <xsl:text>" or "</xsl:text>
+        <xsl:value-of select="substring-before($adjusted.language,'_')"/>
+        <xsl:text>". Using default "</xsl:text>
+        <xsl:value-of select="$l10n.gentext.default.language"/>
+        <xsl:text>".</xsl:text>
+      </xsl:message>
+      <xsl:value-of select="$l10n.gentext.default.language"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="language.attribute">
+  <xsl:param name="node" select="."/>
+
+  <xsl:variable name="language">
+    <xsl:choose>
+      <xsl:when test="$l10n.gentext.language != ''">
+        <xsl:value-of select="$l10n.gentext.language"/>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- can't do this one step: attributes are unordered! -->
+        <xsl:variable name="lang-scope"
+                      select="$node/ancestor-or-self::*
+                              [@lang or @xml:lang][1]"/>
+        <xsl:variable name="lang-attr"
+                      select="($lang-scope/@lang | $lang-scope/@xml:lang)[1]"/>
+
+        <xsl:choose>
+          <xsl:when test="string($lang-attr) = ''">
+            <xsl:value-of select="$l10n.gentext.default.language"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$lang-attr"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="$language != ''">
+    <xsl:attribute name="lang">
+      <xsl:choose>
+        <xsl:when test="$l10n.lang.value.rfc.compliant != 0">
+          <xsl:value-of select="translate($language, '_', '-')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$language"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+  </xsl:if>
+
+  <!-- FIXME: This is sort of hack, but it was the easiest way to add at least partial support for dir attribute -->
+  <xsl:copy-of select="ancestor-or-self::*[@dir][1]/@dir"/>
+</xsl:template>
+
+<xsl:template name="gentext">
+  <xsl:param name="key" select="local-name(.)"/>
+  <xsl:param name="lang">
+    <xsl:call-template name="l10n.language"/>
+  </xsl:param>
+
+  <xsl:variable name="local.l10n.gentext"
+                select="($local.l10n.xml//l:i18n/l:l10n[@language=$lang]/l:gentext[@key=$key])[1]"/>
+
+  <xsl:variable name="l10n.gentext"
+                select="($l10n.xml/l:i18n/l:l10n[@language=$lang]/l:gentext[@key=$key])[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="$local.l10n.gentext">
+      <xsl:value-of select="$local.l10n.gentext/@text"/>
+    </xsl:when>
+    <xsl:when test="$l10n.gentext">
+      <xsl:value-of select="$l10n.gentext/@text"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>No "</xsl:text>
+        <xsl:value-of select="$lang"/>
+        <xsl:text>" localization of "</xsl:text>
+        <xsl:value-of select="$key"/>
+        <xsl:text>" exists</xsl:text>
+        <xsl:choose>
+          <xsl:when test="$lang = 'en'">
+             <xsl:text>.</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+             <xsl:text>; using "en".</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:message>
+
+      <xsl:value-of select="($l10n.xml/l:i18n/l:l10n[@language='en']/l:gentext[@key=$key])[1]/@text"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="gentext.element.name">
+  <xsl:param name="element.name" select="local-name(.)"/>
+  <xsl:param name="lang">
+    <xsl:call-template name="l10n.language"/>
+  </xsl:param>
+
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="$element.name"/>
+    <xsl:with-param name="lang" select="$lang"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.space">
+  <xsl:text> </xsl:text>
+</xsl:template>
+
+<xsl:template name="gentext.edited.by">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'Editedby'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.by">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'by'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.dingbat">
+  <xsl:param name="dingbat">bullet</xsl:param>
+  <xsl:param name="lang">
+    <xsl:call-template name="l10n.language"/>
+  </xsl:param>
+
+  <xsl:variable name="local.l10n.dingbat"
+                select="($local.l10n.xml//l:i18n/l:l10n[@language=$lang]/l:dingbat[@key=$dingbat])[1]"/>
+
+  <xsl:variable name="l10n.dingbat"
+                select="($l10n.xml/l:i18n/l:l10n[@language=$lang]/l:dingbat[@key=$dingbat])[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="$local.l10n.dingbat">
+      <xsl:value-of select="$local.l10n.dingbat/@text"/>
+    </xsl:when>
+    <xsl:when test="$l10n.dingbat">
+      <xsl:value-of select="$l10n.dingbat/@text"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>No "</xsl:text>
+        <xsl:value-of select="$lang"/>
+        <xsl:text>" localization of dingbat </xsl:text>
+        <xsl:value-of select="$dingbat"/>
+        <xsl:text> exists; using "en".</xsl:text>
+      </xsl:message>
+
+      <xsl:value-of select="($l10n.xml/l:i18n/l:l10n[@language='en']/l:dingbat[@key=$dingbat])[1]/@text"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="gentext.startquote">
+  <xsl:call-template name="gentext.dingbat">
+    <xsl:with-param name="dingbat">startquote</xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.endquote">
+  <xsl:call-template name="gentext.dingbat">
+    <xsl:with-param name="dingbat">endquote</xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.nestedstartquote">
+  <xsl:call-template name="gentext.dingbat">
+    <xsl:with-param name="dingbat">nestedstartquote</xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.nestedendquote">
+  <xsl:call-template name="gentext.dingbat">
+    <xsl:with-param name="dingbat">nestedendquote</xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.nav.prev">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'nav-prev'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.nav.next">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'nav-next'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.nav.home">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'nav-home'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="gentext.nav.up">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'nav-up'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template name="gentext.template">
+  <xsl:param name="context" select="'default'"/>
+  <xsl:param name="name" select="'default'"/>
+  <xsl:param name="origname" select="$name"/>
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="referrer"/>
+  <xsl:param name="lang">
+    <xsl:call-template name="l10n.language"/>
+  </xsl:param>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:variable name="local.localization.node"
+                select="($local.l10n.xml//l:i18n/l:l10n[@language=$lang])[1]"/>
+
+  <xsl:variable name="localization.node"
+                select="($l10n.xml/l:i18n/l:l10n[@language=$lang])[1]"/>
+
+  <xsl:if test="count($localization.node) = 0
+                and count($local.localization.node) = 0
+                and $verbose != 0">
+    <xsl:message>
+      <xsl:text>No "</xsl:text>
+      <xsl:value-of select="$lang"/>
+      <xsl:text>" localization exists.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:variable name="local.context.node"
+                select="$local.localization.node/l:context[@name=$context]"/>
+
+  <xsl:variable name="context.node"
+                select="$localization.node/l:context[@name=$context]"/>
+
+  <xsl:if test="count($context.node) = 0
+                and count($local.context.node) = 0
+                and $verbose != 0">
+    <xsl:message>
+      <xsl:text>No context named "</xsl:text>
+      <xsl:value-of select="$context"/>
+      <xsl:text>" exists in the "</xsl:text>
+      <xsl:value-of select="$lang"/>
+      <xsl:text>" localization.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:variable name="local.template.node"
+                select="($local.context.node/l:template[@name=$name
+                                                        and @style
+                                                        and @style=$xrefstyle]
+                        |$local.context.node/l:template[@name=$name
+                                                        and not(@style)])[1]"/>
+
+  <xsl:variable name="template.node"
+                select="($context.node/l:template[@name=$name
+                                                  and @style
+                                                  and @style=$xrefstyle]
+                        |$context.node/l:template[@name=$name
+                                                  and not(@style)])[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="$local.template.node/@text">
+      <xsl:value-of select="$local.template.node/@text"/>
+    </xsl:when>
+    <xsl:when test="$template.node/@text">
+      <xsl:value-of select="$template.node/@text"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="contains($name, '/')">
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="$context"/>
+            <xsl:with-param name="name" select="substring-after($name, '/')"/>
+            <xsl:with-param name="origname" select="$origname"/>
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="referrer" select="$referrer"/>
+            <xsl:with-param name="lang" select="$lang"/>
+            <xsl:with-param name="verbose" select="$verbose"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="$verbose = 0">
+          <!-- silence -->
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>No template for "</xsl:text>
+            <xsl:value-of select="$origname"/>
+            <xsl:text>" (or any of its leaves) exists
+in the context named "</xsl:text>
+            <xsl:value-of select="$context"/>
+            <xsl:text>" in the "</xsl:text>
+            <xsl:value-of select="$lang"/>
+            <xsl:text>" localization.</xsl:text>
+          </xsl:message>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- silently test if a gentext template exists -->
+
+<xsl:template name="gentext.template.exists">
+  <xsl:param name="context" select="'default'"/>
+  <xsl:param name="name" select="'default'"/>
+  <xsl:param name="origname" select="$name"/>
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="referrer"/>
+  <xsl:param name="lang">
+    <xsl:call-template name="l10n.language"/>
+  </xsl:param>
+
+  <xsl:variable name="template">
+    <xsl:call-template name="gentext.template">
+      <xsl:with-param name="context" select="$context"/>
+      <xsl:with-param name="name" select="$name"/>
+      <xsl:with-param name="origname" select="$origname"/>
+      <xsl:with-param name="purpose" select="$purpose"/>
+      <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+      <xsl:with-param name="referrer" select="$referrer"/>
+      <xsl:with-param name="lang" select="$lang"/>
+      <xsl:with-param name="verbose" select="0"/>
+    </xsl:call-template>
+  </xsl:variable>
+  
+  <xsl:choose>
+    <xsl:when test="string-length($template) != 0">1</xsl:when>
+    <xsl:otherwise>0</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 850 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/labels.xsl

@@ -0,0 +1,850 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                exclude-result-prefixes="doc"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<!-- label markup -->
+
+<doc:mode mode="label.markup" xmlns="">
+<refpurpose>Provides access to element labels</refpurpose>
+<refdescription id="label.markup-desc">
+<para>Processing an element in the
+<literal role="mode">label.markup</literal> mode produces the
+element label.</para>
+<para>Trailing punctuation is not added to the label.
+</para>
+</refdescription>
+</doc:mode>
+
+<xsl:template match="*" mode="intralabel.punctuation">
+  <xsl:text>.</xsl:text>
+</xsl:template>
+
+<xsl:template match="*" mode="label.markup">
+  <xsl:param name="verbose" select="1"/>
+  <xsl:if test="$verbose">
+    <xsl:message>
+      <xsl:text>Request for label of unexpected element: </xsl:text>
+      <xsl:value-of select="local-name(.)"/>
+    </xsl:message>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="set|book" mode="label.markup">
+  <xsl:if test="@label">
+    <xsl:value-of select="@label"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="part" mode="label.markup">
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="string($part.autolabel) != 0">
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$part.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:number from="book" count="part" format="{$format}"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="partintro" mode="label.markup">
+  <!-- no label -->
+</xsl:template>
+
+<xsl:template match="preface" mode="label.markup">
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="string($preface.autolabel) != 0">
+      <xsl:if test="$component.label.includes.part.label != 0 and
+                      ancestor::part">
+        <xsl:variable name="part.label">
+          <xsl:apply-templates select="ancestor::part" 
+                               mode="label.markup"/>
+        </xsl:variable>
+        <xsl:if test="$part.label != ''">
+          <xsl:value-of select="$part.label"/>
+          <xsl:apply-templates select="ancestor::part" 
+                               mode="intralabel.punctuation"/>
+        </xsl:if>
+      </xsl:if>
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$preface.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="$label.from.part != 0 and ancestor::part">
+          <xsl:number from="part" count="preface" format="{$format}" level="any"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number from="book" count="preface" format="{$format}" level="any"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="chapter" mode="label.markup">
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="string($chapter.autolabel) != 0">
+      <xsl:if test="$component.label.includes.part.label != 0 and
+                      ancestor::part">
+        <xsl:variable name="part.label">
+          <xsl:apply-templates select="ancestor::part" 
+                               mode="label.markup"/>
+        </xsl:variable>
+        <xsl:if test="$part.label != ''">
+          <xsl:value-of select="$part.label"/>
+          <xsl:apply-templates select="ancestor::part" 
+                               mode="intralabel.punctuation"/>
+        </xsl:if>
+      </xsl:if>
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$chapter.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="$label.from.part != 0 and ancestor::part">
+          <xsl:number from="part" count="chapter" format="{$format}" level="any"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number from="book" count="chapter" format="{$format}" level="any"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="appendix" mode="label.markup">
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="string($appendix.autolabel) != 0">
+      <xsl:if test="$component.label.includes.part.label != 0 and
+                      ancestor::part">
+        <xsl:variable name="part.label">
+          <xsl:apply-templates select="ancestor::part" 
+                               mode="label.markup"/>
+        </xsl:variable>
+        <xsl:if test="$part.label != ''">
+          <xsl:value-of select="$part.label"/>
+          <xsl:apply-templates select="ancestor::part" 
+                               mode="intralabel.punctuation"/>
+        </xsl:if>
+      </xsl:if>
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$appendix.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="$label.from.part != 0 and ancestor::part">
+          <xsl:number from="part" count="appendix" format="{$format}" level="any"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number from="book|article"
+                      count="appendix" format="{$format}" level="any"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="article" mode="label.markup">
+  <xsl:if test="@label">
+    <xsl:value-of select="@label"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="dedication|colophon" mode="label.markup">
+  <xsl:if test="@label">
+    <xsl:value-of select="@label"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="reference" mode="label.markup">
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="string($reference.autolabel) != 0">
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$reference.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:number from="book" count="reference" format="{$format}" level="any"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="refentry" mode="label.markup">
+  <xsl:if test="@label">
+    <xsl:value-of select="@label"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="section" mode="label.markup">
+  <!-- if this is a nested section, label the parent -->
+  <xsl:if test="local-name(..) = 'section'">
+    <xsl:variable name="parent.section.label">
+      <xsl:call-template name="label.this.section">
+        <xsl:with-param name="section" select=".."/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:if test="$parent.section.label != '0'">
+      <xsl:apply-templates select=".." mode="label.markup"/>
+      <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+    </xsl:if>
+  </xsl:if>
+
+  <!-- if the parent is a component, maybe label that too -->
+  <xsl:variable name="parent.is.component">
+    <xsl:call-template name="is.component">
+      <xsl:with-param name="node" select=".."/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <!-- does this section get labelled? -->
+  <xsl:variable name="label">
+    <xsl:call-template name="label.this.section">
+      <xsl:with-param name="section" select="."/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:if test="$section.label.includes.component.label != 0
+                and $parent.is.component != 0">
+    <xsl:variable name="parent.label">
+      <xsl:apply-templates select=".." mode="label.markup"/>
+    </xsl:variable>
+    <xsl:if test="$parent.label != ''">
+      <xsl:apply-templates select=".." mode="label.markup"/>
+      <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+    </xsl:if>
+  </xsl:if>
+
+<!--
+  <xsl:message>
+    test: <xsl:value-of select="$label"/>, <xsl:number count="section"/>
+  </xsl:message>
+-->
+
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="$label != 0">      
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$section.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:number format="{$format}" count="section"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="sect1" mode="label.markup">
+  <!-- if the parent is a component, maybe label that too -->
+  <xsl:variable name="parent.is.component">
+    <xsl:call-template name="is.component">
+      <xsl:with-param name="node" select=".."/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="component.label">
+    <xsl:if test="$section.label.includes.component.label != 0
+                  and $parent.is.component != 0">
+      <xsl:variable name="parent.label">
+        <xsl:apply-templates select=".." mode="label.markup"/>
+      </xsl:variable>
+      <xsl:if test="$parent.label != ''">
+        <xsl:apply-templates select=".." mode="label.markup"/>
+        <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+      </xsl:if>
+    </xsl:if>
+  </xsl:variable>
+
+
+  <xsl:variable name="is.numbered">
+    <xsl:call-template name="label.this.section"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="$is.numbered != 0">
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$section.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:copy-of select="$component.label"/>
+      <xsl:number format="{$format}" count="sect1"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup">
+  <!-- label the parent -->
+  <xsl:variable name="parent.section.label">
+    <xsl:call-template name="label.this.section">
+      <xsl:with-param name="section" select=".."/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:if test="$parent.section.label != '0'">
+    <xsl:apply-templates select=".." mode="label.markup"/>
+    <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+  </xsl:if>
+
+  <xsl:variable name="is.numbered">
+    <xsl:call-template name="label.this.section"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="$is.numbered != 0">
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$section.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="local-name(.) = 'sect2'">
+          <xsl:number format="{$format}" count="sect2"/>
+        </xsl:when>
+        <xsl:when test="local-name(.) = 'sect3'">
+          <xsl:number format="{$format}" count="sect3"/>
+        </xsl:when>
+        <xsl:when test="local-name(.) = 'sect4'">
+          <xsl:number format="{$format}" count="sect4"/>
+        </xsl:when>
+        <xsl:when test="local-name(.) = 'sect5'">
+          <xsl:number format="{$format}" count="sect5"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>label.markup: this can't happen!</xsl:message>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="bridgehead" mode="label.markup">
+  <!-- FIXME: could we do a better job here? -->
+  <xsl:variable name="contsec"
+                select="(ancestor::section
+                         |ancestor::simplesect
+                         |ancestor::sect1
+                         |ancestor::sect2
+                         |ancestor::sect3
+                         |ancestor::sect4
+                         |ancestor::sect5
+                         |ancestor::refsect1
+                         |ancestor::refsect2
+                         |ancestor::refsect3
+                         |ancestor::chapter
+                         |ancestor::appendix
+                         |ancestor::preface)[last()]"/>
+
+  <xsl:apply-templates select="$contsec" mode="label.markup"/>
+</xsl:template>
+
+<xsl:template match="refsect1" mode="label.markup">
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="$section.autolabel != 0">
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$section.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:number count="refsect1" format="{$format}"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="refsect2|refsect3" mode="label.markup">
+  <!-- label the parent -->
+  <xsl:variable name="parent.label">
+    <xsl:apply-templates select=".." mode="label.markup"/>
+  </xsl:variable>
+  <xsl:if test="$parent.label != ''">
+    <xsl:apply-templates select=".." mode="label.markup"/>
+    <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="$section.autolabel != 0">
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$section.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="local-name(.) = 'refsect2'">
+          <xsl:number count="refsect2" format="{$format}"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number count="refsect3" format="{$format}"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="simplesect" mode="label.markup">
+  <!-- if this is a nested section, label the parent -->
+  <xsl:if test="local-name(..) = 'section'
+                or local-name(..) = 'sect1'
+                or local-name(..) = 'sect2'
+                or local-name(..) = 'sect3'
+                or local-name(..) = 'sect4'
+                or local-name(..) = 'sect5'">
+    <xsl:variable name="parent.section.label">
+      <xsl:apply-templates select=".." mode="label.markup"/>
+    </xsl:variable>
+    <xsl:if test="$parent.section.label != ''">
+      <xsl:apply-templates select=".." mode="label.markup"/>
+      <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+    </xsl:if>
+  </xsl:if>
+
+  <!-- if the parent is a component, maybe label that too -->
+  <xsl:variable name="parent.is.component">
+    <xsl:call-template name="is.component">
+      <xsl:with-param name="node" select=".."/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <!-- does this section get labelled? -->
+  <xsl:variable name="label">
+    <xsl:call-template name="label.this.section">
+      <xsl:with-param name="section" select="."/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:if test="$section.label.includes.component.label != 0
+                and $parent.is.component != 0">
+    <xsl:variable name="parent.label">
+      <xsl:apply-templates select=".." mode="label.markup"/>
+    </xsl:variable>
+    <xsl:if test="$parent.label != ''">
+      <xsl:apply-templates select=".." mode="label.markup"/>
+      <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
+    </xsl:if>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="$label != 0">
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$section.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:number format="{$format}" count="simplesect"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="qandadiv" mode="label.markup">
+  <xsl:variable name="lparent" select="(ancestor::set
+                                       |ancestor::book
+                                       |ancestor::chapter
+                                       |ancestor::appendix
+                                       |ancestor::preface
+                                       |ancestor::section
+                                       |ancestor::simplesect
+                                       |ancestor::sect1
+                                       |ancestor::sect2
+                                       |ancestor::sect3
+                                       |ancestor::sect4
+                                       |ancestor::sect5
+                                       |ancestor::refsect1
+                                       |ancestor::refsect2
+                                       |ancestor::refsect3)[last()]"/>
+
+  <xsl:variable name="lparent.prefix">
+    <xsl:apply-templates select="$lparent" mode="label.markup"/>
+  </xsl:variable>
+
+  <xsl:variable name="prefix">
+    <xsl:if test="$qanda.inherit.numeration != 0">
+      <xsl:if test="$lparent.prefix != ''">
+        <xsl:apply-templates select="$lparent" mode="label.markup"/>
+        <xsl:apply-templates select="$lparent" mode="intralabel.punctuation"/>
+      </xsl:if>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$qandadiv.autolabel != 0">
+      <xsl:variable name="format">
+        <xsl:call-template name="autolabel.format">
+          <xsl:with-param name="format" select="$qandadiv.autolabel"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:value-of select="$prefix"/>
+      <xsl:number level="multiple" count="qandadiv" format="{$format}"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="question|answer" mode="label.markup">
+  <xsl:variable name="lparent" select="(ancestor::set
+                                       |ancestor::book
+                                       |ancestor::chapter
+                                       |ancestor::appendix
+                                       |ancestor::preface
+                                       |ancestor::section
+                                       |ancestor::simplesect
+                                       |ancestor::sect1
+                                       |ancestor::sect2
+                                       |ancestor::sect3
+                                       |ancestor::sect4
+                                       |ancestor::sect5
+                                       |ancestor::refsect1
+                                       |ancestor::refsect2
+                                       |ancestor::refsect3)[last()]"/>
+
+  <xsl:variable name="lparent.prefix">
+    <xsl:apply-templates select="$lparent" mode="label.markup"/>
+  </xsl:variable>
+
+  <xsl:variable name="prefix">
+    <xsl:if test="$qanda.inherit.numeration != 0">
+      <xsl:choose>
+        <xsl:when test="ancestor::qandadiv">
+          <xsl:apply-templates select="ancestor::qandadiv[1]" mode="label.markup"/>
+          <xsl:apply-templates select="ancestor::qandadiv[1]"
+                               mode="intralabel.punctuation"/>
+        </xsl:when>
+        <xsl:when test="$lparent.prefix != ''">
+          <xsl:apply-templates select="$lparent" mode="label.markup"/>
+          <xsl:apply-templates select="$lparent" mode="intralabel.punctuation"/>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="inhlabel"
+                select="ancestor-or-self::qandaset/@defaultlabel[1]"/>
+
+  <xsl:variable name="deflabel">
+    <xsl:choose>
+      <xsl:when test="$inhlabel != ''">
+        <xsl:value-of select="$inhlabel"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$qanda.defaultlabel"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="label" select="label"/>
+
+  <xsl:choose>
+    <xsl:when test="count($label)>0">
+      <xsl:apply-templates select="$label"/>
+    </xsl:when>
+
+    <xsl:when test="$deflabel = 'qanda' and local-name(.) = 'question'">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Question'"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:when test="$deflabel = 'qanda' and local-name(.) = 'answer'">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Answer'"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:when test="$deflabel = 'number' and local-name(.) = 'question'">
+      <xsl:value-of select="$prefix"/>
+      <xsl:number level="multiple" count="qandaentry" format="1"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="bibliography|glossary|
+                     qandaset|index|setindex" mode="label.markup">
+  <xsl:if test="@label">
+    <xsl:value-of select="@label"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="figure|table|example" mode="label.markup">
+  <xsl:variable name="pchap"
+                select="ancestor::chapter
+                        |ancestor::appendix
+                        |ancestor::article[ancestor::book]"/>
+
+  <xsl:variable name="prefix">
+    <xsl:if test="count($pchap) &gt; 0">
+      <xsl:apply-templates select="$pchap" mode="label.markup"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$prefix != ''">
+            <xsl:apply-templates select="$pchap" mode="label.markup"/>
+            <xsl:apply-templates select="$pchap" mode="intralabel.punctuation"/>
+          <xsl:number format="1" from="chapter|appendix" level="any"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number format="1" from="book|article" level="any"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="procedure" mode="label.markup">
+  <xsl:variable name="pchap"
+                select="ancestor::chapter
+                        |ancestor::appendix
+                        |ancestor::article[ancestor::book]"/>
+
+  <xsl:variable name="prefix">
+    <xsl:if test="count($pchap) &gt; 0">
+      <xsl:apply-templates select="$pchap" mode="label.markup"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="$formal.procedures = 0">
+      <!-- No label -->
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="count($pchap)>0">
+          <xsl:if test="$prefix != ''">
+            <xsl:apply-templates select="$pchap" mode="label.markup"/>
+            <xsl:apply-templates select="$pchap" mode="intralabel.punctuation"/>
+          </xsl:if>
+          <xsl:number count="procedure[title]" format="1" 
+                      from="chapter|appendix" level="any"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number count="procedure[title]" format="1" 
+                      from="book|article" level="any"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="equation" mode="label.markup">
+  <xsl:variable name="pchap"
+                select="ancestor::chapter
+                        |ancestor::appendix
+                        |ancestor::article[ancestor::book]"/>
+
+  <xsl:variable name="prefix">
+    <xsl:if test="count($pchap) &gt; 0">
+      <xsl:apply-templates select="$pchap" mode="label.markup"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@label">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="count($pchap)>0">
+          <xsl:if test="$prefix != ''">
+            <xsl:apply-templates select="$pchap" mode="label.markup"/>
+            <xsl:apply-templates select="$pchap" mode="intralabel.punctuation"/>
+          </xsl:if>
+          <xsl:number format="1" count="equation[title or info/title]" 
+	              from="chapter|appendix" level="any"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number format="1" count="equation[title or info/title]" 
+	              from="book|article" level="any"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="orderedlist/listitem" mode="label.markup">
+  <xsl:variable name="numeration">
+    <xsl:call-template name="list.numeration">
+      <xsl:with-param name="node" select="parent::orderedlist"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="type">
+    <xsl:choose>
+      <xsl:when test="$numeration='arabic'">1</xsl:when>
+      <xsl:when test="$numeration='loweralpha'">a</xsl:when>
+      <xsl:when test="$numeration='lowerroman'">i</xsl:when>
+      <xsl:when test="$numeration='upperalpha'">A</xsl:when>
+      <xsl:when test="$numeration='upperroman'">I</xsl:when>
+      <!-- What!? This should never happen -->
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>Unexpected numeration: </xsl:text>
+          <xsl:value-of select="$numeration"/>
+        </xsl:message>
+        <xsl:value-of select="1."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="item-number">
+    <xsl:call-template name="orderedlist-item-number"/>
+  </xsl:variable>
+
+  <xsl:number value="$item-number" format="{$type}"/>
+</xsl:template>
+
+<xsl:template match="abstract" mode="label.markup">
+  <!-- nop -->
+</xsl:template>
+
+<xsl:template match="sidebar" mode="label.markup">
+  <!-- nop -->
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template name="label.this.section">
+  <xsl:param name="section" select="."/>
+
+  <xsl:variable name="level">
+    <xsl:call-template name="section.level"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$level &lt;= $section.autolabel.max.depth">      
+      <xsl:value-of select="$section.autolabel"/>
+    </xsl:when>
+    <xsl:otherwise>0</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<doc:template name="label.this.section" xmlns="">
+<refpurpose>Returns true if $section should be labelled</refpurpose>
+<refdescription id="label.this.section-desc">
+<para>Returns true if the specified section should be labelled.
+By default, this template returns zero unless 
+the section level is less than or equal to the value of the
+<literal>$section.autolabel.max.depth</literal> parameter, in
+which case it returns
+<literal>$section.autolabel</literal>.
+Custom stylesheets may override it to get more selective behavior.</para>
+</refdescription>
+</doc:template>
+
+<!-- ============================================================ -->
+
+<xsl:template name="default.autolabel.format">
+  <xsl:param name="context" select="."/>
+  <xsl:choose>
+    <xsl:when test="local-name($context) = 'appendix'">
+      <xsl:value-of select="'A'"/>
+    </xsl:when>
+    <xsl:when test="local-name($context) = 'part'">
+      <xsl:value-of select="'I'"/>
+    </xsl:when>
+    <xsl:otherwise>1</xsl:otherwise>
+  </xsl:choose>  
+</xsl:template>
+  
+<xsl:template name="autolabel.format">
+  <xsl:param name="context" select="."/>
+  <xsl:param name="format"/>
+
+  <xsl:choose>
+    <xsl:when test="string($format) != 0">
+      <xsl:choose>
+        <xsl:when test="string($format)='arabic' or $format='1'">1</xsl:when>
+        <xsl:when test="$format='loweralpha' or $format='a'">
+          <xsl:value-of select="'a'"/>
+        </xsl:when>
+        <xsl:when test="$format='lowerroman' or $format='i'">
+          <xsl:value-of select="'i'"/>
+        </xsl:when>
+        <xsl:when test="$format='upperalpha' or $format='A'">
+          <xsl:value-of select="'A'"/>
+        </xsl:when>
+        <xsl:when test="$format='upperroman' or $format='I'">
+          <xsl:value-of select="'I'"/>
+        </xsl:when>      
+	<xsl:when test="$format='arabicindic' or $format='&#x661;'">
+	  <xsl:value-of select="'&#x661;'"/>
+	</xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>Unexpected </xsl:text><xsl:value-of select="local-name(.)"/><xsl:text>.autolabel value: </xsl:text>
+            <xsl:value-of select="$format"/><xsl:text>; using default.</xsl:text>
+          </xsl:message>
+          <xsl:call-template name="default.autolabel.format"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<doc:template name="autolabel.format" xmlns="">
+<refpurpose>Returns format for autolabel parameters</refpurpose>
+<refdescription id="autolabel.format-desc">
+<para>Returns format passed as parameter if non zero. Supported
+  format are 'arabic' or '1', 'loweralpha' or 'a', 'lowerroman' or 'i', 
+  'upperlapha' or 'A', 'upperroman' or 'I', 'arabicindic' or '&#x661;'.
+  If its not one of these then 
+  returns the default format.</para>
+</refdescription>
+</doc:template>
+
+<!-- ============================================================ -->
+
+</xsl:stylesheet>

+ 1149 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/olink.xsl

@@ -0,0 +1,1149 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+<!-- Create keys for quickly looking up olink targets -->
+<xsl:key name="targetdoc-key" match="document" use="@targetdoc" />
+<xsl:key name="targetptr-key"  match="div|obj"
+         use="concat(ancestor::document/@targetdoc, '/',
+                     @targetptr, '/', ancestor::document/@lang)" />
+
+<!-- Return filename of database -->
+<xsl:template name="select.target.database">
+  <xsl:param name="targetdoc.att" select="''"/>
+  <xsl:param name="targetptr.att" select="''"/>
+  <xsl:param name="olink.lang" select="''"/>
+
+  <!-- use root's xml:base if exists -->
+  <xsl:variable name="xml.base" select="/*/@xml:base"/>
+
+  <!-- This selection can be customized if needed -->
+  <xsl:variable name="target.database.filename">
+    <xsl:choose>
+      <xsl:when test="$xml.base != '' and
+                   not(starts-with($target.database.document, 'file:/')) and
+                   not(starts-with($target.database.document, '/'))">
+        <xsl:call-template name="systemIdToBaseURI">
+          <xsl:with-param name="systemId" select="$xml.base"/>
+        </xsl:call-template>
+        <xsl:value-of select="$target.database.document"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$target.database.document"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="target.database" 
+      select="document($target.database.filename,/)"/>
+
+  <xsl:choose>
+    <!-- Was the database document parameter not set? -->
+    <xsl:when test="$target.database.document = ''">
+      <xsl:message>
+        <xsl:text>Olinks not processed: must specify a </xsl:text>
+        <xsl:text>$target.database.document parameter&#10;</xsl:text>
+        <xsl:text>when using olinks with targetdoc </xsl:text>
+        <xsl:text>and targetptr attributes.</xsl:text>
+      </xsl:message>
+    </xsl:when>
+    <!-- Did it not open? Should be a targetset element -->
+    <xsl:when test="not($target.database/*)">
+      <xsl:message>
+        <xsl:text>Olink error: could not open target database '</xsl:text>
+        <xsl:value-of select="$target.database.filename"/>
+        <xsl:text>'.</xsl:text>
+      </xsl:message>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$target.database.filename"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="select.olink.key">
+  <xsl:param name="targetdoc.att" select="''"/>
+  <xsl:param name="targetptr.att" select="''"/>
+  <xsl:param name="olink.lang" select="''"/>
+  <xsl:param name="target.database"/>
+
+  <xsl:if test="$target.database/*">
+    <xsl:variable name="olink.fallback.sequence">
+      <xsl:call-template name="select.olink.lang.fallback">
+        <xsl:with-param name="olink.lang" select="$olink.lang"/>
+      </xsl:call-template>
+    </xsl:variable>
+  
+    <!-- Recurse through the languages until you find a match -->
+    <xsl:call-template name="select.olink.key.in.lang">
+      <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
+      <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
+      <xsl:with-param name="olink.lang" select="$olink.lang"/>
+      <xsl:with-param name="target.database" select="$target.database"/>
+      <xsl:with-param name="fallback.index" select="1"/>
+      <xsl:with-param name="olink.fallback.sequence"
+                      select="$olink.fallback.sequence"/>
+    </xsl:call-template>
+  </xsl:if>
+  
+</xsl:template>
+
+<!-- Locate olink key in a particular language -->
+<xsl:template name="select.olink.key.in.lang">
+  <xsl:param name="targetdoc.att" select="''"/>
+  <xsl:param name="targetptr.att" select="''"/>
+  <xsl:param name="olink.lang" select="''"/>
+  <xsl:param name="target.database"/>
+  <xsl:param name="fallback.index" select="1"/>
+  <xsl:param name="olink.fallback.sequence" select="''"/>
+  
+  <xsl:variable name="target.lang">
+    <xsl:call-template name="select.target.lang">
+      <xsl:with-param name="fallback.index" select="$fallback.index"/>
+      <xsl:with-param name="olink.fallback.sequence"
+                      select="$olink.fallback.sequence"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:if test="$olink.debug != 0">
+    <xsl:message><xsl:text>Olink debug: cases for targetdoc='</xsl:text>
+      <xsl:value-of select="$targetdoc.att"/>
+      <xsl:text>' and targetptr='</xsl:text>
+      <xsl:value-of select="$targetptr.att"/>
+      <xsl:text>' in language '</xsl:text>
+      <xsl:value-of select="$target.lang"/>
+      <xsl:text>'.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <!-- Customize these cases if you want different selection logic -->
+  <xsl:variable name="CaseA">
+    <!-- targetdoc.att = not blank
+         targetptr.att = not blank
+    -->
+    <xsl:if test="$targetdoc.att != '' and
+                  $targetptr.att != ''">
+      <xsl:for-each select="$target.database">
+        <xsl:variable name="key" 
+                      select="concat($targetdoc.att, '/', 
+                                     $targetptr.att, '/',
+                                     $target.lang)"/>
+        <xsl:choose>
+          <xsl:when test="key('targetptr-key', $key)/@href != ''">
+            <xsl:value-of select="$key"/>
+            <xsl:if test="$olink.debug != 0">
+              <xsl:message>Olink debug: CaseA matched.</xsl:message>
+            </xsl:if>
+          </xsl:when>
+          <xsl:when test="$olink.debug != 0">
+            <xsl:message>Olink debug: CaseA NOT matched</xsl:message>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:for-each>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="CaseB">
+    <!-- targetdoc.att = not blank
+         targetptr.att = not blank
+         prefer.internal.olink = not zero
+         current.docid = not blank 
+    -->
+    <xsl:if test="$targetdoc.att != '' and
+                  $targetptr.att != '' and
+                  $current.docid != '' and
+                  $prefer.internal.olink != 0">
+      <xsl:for-each select="$target.database">
+        <xsl:variable name="key" 
+                      select="concat($current.docid, '/', 
+                                     $targetptr.att, '/',
+                                     $target.lang)"/>
+        <xsl:choose>
+          <xsl:when test="key('targetptr-key', $key)/@href != ''">
+            <xsl:value-of select="$key"/>
+            <xsl:if test="$olink.debug != 0">
+              <xsl:message>Olink debug: CaseB matched.</xsl:message>
+            </xsl:if>
+          </xsl:when>
+          <xsl:when test="$olink.debug != 0">
+            <xsl:message>Olink debug: CaseB NOT matched</xsl:message>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:for-each>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="CaseC">
+    <!-- targetdoc.att = blank
+         targetptr.att = not blank
+         current.docid = not blank 
+    -->
+    <xsl:if test="string-length($targetdoc.att) = 0 and
+                  $targetptr.att != '' and
+                  $current.docid != ''">
+      <!-- Must use a for-each to change context for keys to work -->
+      <xsl:for-each select="$target.database">
+        <xsl:variable name="key" 
+                      select="concat($current.docid, '/', 
+                                     $targetptr.att, '/',
+                                     $target.lang)"/>
+        <xsl:choose>
+          <xsl:when test="key('targetptr-key', $key)/@href != ''">
+            <xsl:value-of select="$key"/>
+            <xsl:if test="$olink.debug != 0">
+              <xsl:message>Olink debug: CaseC matched.</xsl:message>
+            </xsl:if>
+          </xsl:when>
+          <xsl:when test="$olink.debug != 0">
+            <xsl:message>Olink debug: CaseC NOT matched.</xsl:message>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:for-each>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="CaseD">
+    <!-- targetdoc.att = blank
+         targetptr.att = not blank
+         current.docid = blank 
+    -->
+    <!-- This is possible if only one document in the database -->
+    <xsl:if test="string-length($targetdoc.att) = 0 and
+                  $targetptr.att != '' and
+                  string-length($current.docid) = 0 and
+                  count($target.database//document) = 1">
+      <xsl:for-each select="$target.database">
+        <xsl:variable name="key" 
+                      select="concat(.//document/@targetdoc, '/', 
+                                     $targetptr.att, '/',
+                                     $target.lang)"/>
+        <xsl:choose>
+          <xsl:when test="key('targetptr-key', $key)/@href != ''">
+            <xsl:value-of select="$key"/>
+            <xsl:if test="$olink.debug != 0">
+              <xsl:message>Olink debug: CaseD matched.</xsl:message>
+            </xsl:if>
+          </xsl:when>
+          <xsl:when test="$olink.debug != 0">
+            <xsl:message>Olink debug: CaseD NOT matched</xsl:message>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:for-each>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="CaseE">
+    <!-- targetdoc.att = not blank
+         targetptr.att = blank
+    -->
+    <xsl:if test="$targetdoc.att != '' and
+                  string-length($targetptr.att) = 0">
+
+      <!-- Try the document's root element id -->
+      <xsl:variable name="rootid">
+        <xsl:choose>
+          <xsl:when test="$target.lang != ''">
+            <xsl:value-of select="$target.database//document[@targetdoc = $targetdoc.att and @lang = $target.lang]/*[1]/@targetptr"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$target.database//document[@targetdoc = $targetdoc.att and not(@lang)]/*[1]/@targetptr"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:for-each select="$target.database">
+        <xsl:variable name="key" 
+                      select="concat($targetdoc.att, '/', 
+                                     $rootid, '/',
+                                     $target.lang)"/>
+        <xsl:choose>
+          <xsl:when test="key('targetptr-key', $key)/@href != ''">
+            <xsl:value-of select="$key"/>
+            <xsl:if test="$olink.debug != 0">
+              <xsl:message>Olink debug: CaseE matched.</xsl:message>
+            </xsl:if>
+          </xsl:when>
+          <xsl:when test="$olink.debug != 0">
+            <xsl:message>Olink debug: CaseE NOT matched.</xsl:message>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:for-each>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="CaseF">
+    <!-- targetdoc.att = not blank
+         targetptr.att = blank
+         prefer.internal.olink = not zero
+         current.docid = not blank 
+    -->
+    <xsl:if test="$targetdoc.att != '' and
+                  string-length($targetptr.att) = 0 and
+                  $current.docid != '' and
+                  $prefer.internal.olink != 0">
+      <!-- Try the document's root element id -->
+      <xsl:variable name="rootid">
+        <xsl:choose>
+          <xsl:when test="$target.lang != ''">
+            <xsl:value-of select="$target.database//document[@targetdoc = $current.docid and @lang = $target.lang]/*[1]/@targetptr"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$target.database//document[@targetdoc = $current.docid and not(@lang)]/*[1]/@targetptr"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:for-each select="$target.database">
+        <xsl:variable name="key" 
+                      select="concat($current.docid, '/', 
+                                     $rootid, '/',
+                                     $target.lang)"/>
+        <xsl:choose>
+          <xsl:when test="key('targetptr-key', $key)/@href != ''">
+            <xsl:value-of select="$key"/>
+            <xsl:if test="$olink.debug != 0">
+              <xsl:message>Olink debug: CaseF matched.</xsl:message>
+            </xsl:if>
+          </xsl:when>
+          <xsl:when test="$olink.debug != 0">
+            <xsl:message>Olink debug: CaseF NOT matched.</xsl:message>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:for-each>
+    </xsl:if>
+  </xsl:variable>
+
+  <!-- Now select the best match. Customize the order if needed -->
+  <xsl:variable name="selected.key">
+    <xsl:choose>
+      <xsl:when test="$CaseB != ''">
+        <xsl:value-of select="$CaseB"/>
+        <xsl:if test="$olink.debug != 0">
+          <xsl:message>
+            <xsl:text>Olink debug: CaseB key is the final selection: </xsl:text>
+            <xsl:value-of select="$CaseB"/>
+          </xsl:message>
+        </xsl:if>
+      </xsl:when>
+      <xsl:when test="$CaseA != ''">
+        <xsl:value-of select="$CaseA"/>
+        <xsl:if test="$olink.debug != 0">
+          <xsl:message>
+            <xsl:text>Olink debug: CaseA key is the final selection: </xsl:text>
+            <xsl:value-of select="$CaseA"/>
+          </xsl:message>
+        </xsl:if>
+      </xsl:when>
+      <xsl:when test="$CaseC != ''">
+        <xsl:value-of select="$CaseC"/>
+        <xsl:if test="$olink.debug != 0">
+          <xsl:message>
+            <xsl:text>Olink debug: CaseC key is the final selection: </xsl:text>
+            <xsl:value-of select="$CaseC"/>
+          </xsl:message>
+        </xsl:if>
+      </xsl:when>
+      <xsl:when test="$CaseD != ''">
+        <xsl:value-of select="$CaseD"/>
+        <xsl:if test="$olink.debug != 0">
+          <xsl:message>
+            <xsl:text>Olink debug: CaseD key is the final selection: </xsl:text>
+            <xsl:value-of select="$CaseD"/>
+          </xsl:message>
+        </xsl:if>
+      </xsl:when>
+      <xsl:when test="$CaseF != ''">
+        <xsl:value-of select="$CaseF"/>
+        <xsl:if test="$olink.debug != 0">
+          <xsl:message>
+            <xsl:text>Olink debug: CaseF key is the final selection: </xsl:text>
+            <xsl:value-of select="$CaseF"/>
+          </xsl:message>
+        </xsl:if>
+      </xsl:when>
+      <xsl:when test="$CaseE != ''">
+        <xsl:value-of select="$CaseE"/>
+        <xsl:if test="$olink.debug != 0">
+          <xsl:message>
+            <xsl:text>Olink debug: CaseE key is the final selection: </xsl:text>
+            <xsl:value-of select="$CaseE"/>
+          </xsl:message>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:if test="$olink.debug != 0">
+          <xsl:message>
+            <xsl:text>Olink debug: No case matched for lang '</xsl:text>
+            <xsl:value-of select="$target.lang"/>
+            <xsl:text>'.</xsl:text>
+          </xsl:message>
+        </xsl:if>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$selected.key != ''">
+      <xsl:value-of select="$selected.key"/>
+    </xsl:when>
+    <xsl:when test="string-length($selected.key) = 0 and 
+                    string-length($target.lang) = 0">
+      <!-- No match on last try, and we are done -->
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- Recurse through next language -->
+      <xsl:call-template name="select.olink.key.in.lang">
+        <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
+        <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
+        <xsl:with-param name="olink.lang" select="$olink.lang"/>
+        <xsl:with-param name="target.database" select="$target.database"/>
+        <xsl:with-param name="fallback.index" select="$fallback.index + 1"/>
+        <xsl:with-param name="olink.fallback.sequence"
+                        select="$olink.fallback.sequence"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="select.target.lang">
+  <xsl:param name="fallback.index" select="1"/>
+  <xsl:param name="olink.fallback.sequence" select="''"/>
+
+  <!-- recurse backwards to find the lang matching the index -->
+  <xsl:variable name="firstlang" 
+                select="substring-before($olink.fallback.sequence, ' ')"/>
+  <xsl:variable name="rest" 
+                select="substring-after($olink.fallback.sequence, ' ')"/>
+  <xsl:choose>
+    <xsl:when test="$fallback.index = 1">
+      <xsl:value-of select="$firstlang"/>
+    </xsl:when>
+    <xsl:when test="$fallback.index &gt; 1">
+      <xsl:call-template name="select.target.lang">
+        <xsl:with-param name="fallback.index" select="$fallback.index - 1"/>
+        <xsl:with-param name="olink.fallback.sequence"
+                        select="$rest"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="select.olink.lang.fallback">
+  <xsl:param name="olink.lang" select="''"/>
+
+  <!-- Prefer language of the olink element -->
+  <xsl:value-of select="concat(normalize-space(concat($olink.lang, ' ', 
+                        $olink.lang.fallback.sequence)), ' ')"/>
+</xsl:template>
+
+<!-- Returns the complete olink href value if found -->
+<xsl:template name="make.olink.href">
+  <xsl:param name="olink.key" select="''"/>
+  <xsl:param name="target.database"/>
+
+  <xsl:if test="$olink.key != ''">
+    <xsl:variable name="target.href" >
+      <xsl:for-each select="$target.database" >
+        <xsl:value-of select="key('targetptr-key', $olink.key)/@href" />
+      </xsl:for-each>
+    </xsl:variable>
+  
+    <xsl:variable name="targetdoc">
+      <xsl:value-of select="substring-before($olink.key, '/')"/>
+    </xsl:variable>
+  
+    <!-- Does the target database use a sitemap? -->
+    <xsl:variable name="use.sitemap">
+      <xsl:choose>
+        <xsl:when test="$target.database//sitemap">1</xsl:when>
+        <xsl:otherwise>0</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+  
+  
+    <!-- Get the baseuri for this targetptr -->
+    <xsl:variable name="baseuri" >
+      <xsl:choose>
+        <!-- Does the database use a sitemap? -->
+        <xsl:when test="$use.sitemap != 0" >
+          <xsl:choose>
+            <!-- Was current.docid parameter set? -->
+            <xsl:when test="$current.docid != ''">
+              <!-- Was it found in the database? -->
+              <xsl:variable name="currentdoc.key" >
+                <xsl:for-each select="$target.database" >
+                  <xsl:value-of select="key('targetdoc-key',
+                                        $current.docid)/@targetdoc" />
+                </xsl:for-each>
+              </xsl:variable>
+              <xsl:choose>
+                <xsl:when test="$currentdoc.key != ''">
+                  <xsl:for-each select="$target.database" >
+                    <xsl:call-template name="targetpath" >
+                      <xsl:with-param name="dirnode" 
+                          select="key('targetdoc-key', $current.docid)/parent::dir"/>
+                      <xsl:with-param name="targetdoc" select="$targetdoc"/>
+                    </xsl:call-template>
+                  </xsl:for-each >
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:message>
+                    <xsl:text>Olink error: cannot compute relative </xsl:text>
+                    <xsl:text>sitemap path because $current.docid '</xsl:text>
+                    <xsl:value-of select="$current.docid"/>
+                    <xsl:text>' not found in target database.</xsl:text>
+                  </xsl:message>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:message>
+                <xsl:text>Olink warning: cannot compute relative </xsl:text>
+                <xsl:text>sitemap path without $current.docid parameter</xsl:text>
+              </xsl:message>
+            </xsl:otherwise>
+          </xsl:choose> 
+          <!-- In either case, add baseuri from its document entry-->
+          <xsl:variable name="docbaseuri">
+            <xsl:for-each select="$target.database" >
+              <xsl:value-of select="key('targetdoc-key', $targetdoc)/@baseuri" />
+            </xsl:for-each>
+          </xsl:variable>
+          <xsl:if test="$docbaseuri != ''" >
+            <xsl:value-of select="$docbaseuri"/>
+          </xsl:if>
+        </xsl:when>
+        <!-- No database sitemap in use -->
+        <xsl:otherwise>
+          <!-- Just use any baseuri from its document entry -->
+          <xsl:variable name="docbaseuri">
+            <xsl:for-each select="$target.database" >
+              <xsl:value-of select="key('targetdoc-key', $targetdoc)/@baseuri" />
+            </xsl:for-each>
+          </xsl:variable>
+          <xsl:if test="$docbaseuri != ''" >
+            <xsl:value-of select="$docbaseuri"/>
+          </xsl:if>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+  
+    <!-- Form the href information -->
+    <xsl:if test="$baseuri != ''">
+      <xsl:value-of select="$baseuri"/>
+      <xsl:if test="substring($target.href,1,1) != '#'">
+        <!--xsl:text>/</xsl:text-->
+      </xsl:if>
+    </xsl:if>
+    <!-- optionally turn off frag for PDF references -->
+    <xsl:if test="not($insert.olink.pdf.frag = 0 and
+          translate(substring($baseuri, string-length($baseuri) - 3),
+                    'PDF', 'pdf') = '.pdf'
+          and starts-with($target.href, '#') )">
+      <xsl:value-of select="$target.href"/>
+    </xsl:if>
+  </xsl:if>
+</xsl:template>
+
+<!-- Computes the href of the object containing the olink element -->
+<xsl:template name="olink.from.uri">
+  <xsl:param name="target.database"/>
+  <xsl:param name="object" select="NotAnElement"/>
+  <xsl:param name="object.targetdoc" select="$current.docid"/>
+  <xsl:param name="object.lang" 
+           select="concat($object/ancestor::*[last()]/@lang,
+                          $object/ancestor::*[last()]/@xml:lang)"/>
+
+  <xsl:variable name="parent.id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="$object"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <!-- Get the olink key for the parent of olink element -->
+  <xsl:variable name="from.key">
+    <xsl:call-template name="select.olink.key">
+      <xsl:with-param name="targetdoc.att" select="$object.targetdoc"/>
+      <xsl:with-param name="targetptr.att" select="$parent.id"/>
+      <xsl:with-param name="olink.lang" select="$object.lang"/>
+      <xsl:with-param name="target.database" select="$target.database"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="from.olink.href">
+    <xsl:for-each select="$target.database" >
+      <xsl:value-of select="key('targetptr-key', $from.key)/@href" />
+    </xsl:for-each>
+  </xsl:variable>
+
+  <xsl:choose>
+    <!-- we found the olink object -->
+    <xsl:when test="$from.olink.href != ''">
+      <xsl:value-of select="$from.olink.href"/>
+    </xsl:when>
+    <xsl:when test="not($object/parent::*)">
+      <xsl:value-of select="$from.olink.href"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- recurse upward in current document -->
+      <xsl:call-template name="olink.from.uri">
+        <xsl:with-param name="target.database" select="$target.database"/>
+        <xsl:with-param name="object" select="$object/parent::*"/>
+        <xsl:with-param name="object.targetdoc" select="$object.targetdoc"/>
+        <xsl:with-param name="object.lang" select="$object.lang"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="olink.hottext">
+  <xsl:param name="target.database"/>
+  <xsl:param name="olink.lang" select="''"/>
+  <xsl:param name="olink.key" select="''"/>
+  <xsl:param name="referrer" select="."/>
+  <xsl:param name="xrefstyle">
+    <xsl:choose>
+      <xsl:when test="@role and not(@xrefstyle) 
+                      and $use.role.as.xrefstyle != 0">
+        <xsl:value-of select="@role"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@xrefstyle"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+
+  <xsl:choose>
+    <!-- If it has elements or text (not just PI or comment) -->
+    <xsl:when test="child::text() or child::*">
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:when test="$olink.key != ''">
+      <!-- Get the xref text for this record -->
+      <xsl:variable name="xref.text" >
+        <xsl:for-each select="$target.database" >
+          <xsl:copy-of 
+                  select="key('targetptr-key', $olink.key)/xreftext/node()" />
+        </xsl:for-each>
+      </xsl:variable>
+
+      <xsl:variable name="xref.number" >
+        <xsl:for-each select="$target.database" >
+          <xsl:value-of select="key('targetptr-key', $olink.key)/@number" />
+        </xsl:for-each>
+      </xsl:variable>
+
+      <xsl:variable name="target.elem" >
+        <xsl:for-each select="$target.database" >
+          <xsl:value-of select="key('targetptr-key', $olink.key)/@element" />
+        </xsl:for-each>
+      </xsl:variable>
+
+      <xsl:variable name="lang">
+        <xsl:variable name="candidate">
+          <xsl:for-each select="$target.database" >
+            <xsl:value-of 
+                      select="key('targetptr-key', $olink.key)/@lang" />
+          </xsl:for-each>
+        </xsl:variable>
+        <xsl:choose>
+          <xsl:when test="$candidate != ''">
+            <xsl:value-of select="$candidate"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$olink.lang"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="targetdoc">
+        <xsl:value-of select="substring-before($olink.key, '/')"/>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$xrefstyle != '' and
+                        starts-with(normalize-space($xrefstyle), 'select:') and
+                        (contains($xrefstyle, 'nodocname') or
+                        contains($xrefstyle, 'nopage')) and
+                        not(contains($xrefstyle, 'title')) and
+                        not(contains($xrefstyle, 'label'))"> 
+          <xsl:copy-of select="$xref.text"/>
+        </xsl:when>
+        <xsl:when test="$xrefstyle != ''">
+          <xsl:if test="$olink.debug != 0">
+            <xsl:message>
+              <xsl:text>xrefstyle is '</xsl:text>
+              <xsl:value-of select="$xrefstyle"/>
+              <xsl:text>'.</xsl:text>
+            </xsl:message>
+          </xsl:if>
+          <xsl:variable name="template">
+            <xsl:choose>
+              <xsl:when test="starts-with(normalize-space($xrefstyle),
+                                          'select:')">
+                <xsl:call-template name="make.gentext.template">
+                  <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+                  <xsl:with-param name="purpose" select="'olink'"/>
+                  <xsl:with-param name="referrer" select="."/>
+                  <xsl:with-param name="target.elem" select="$target.elem"/>
+                </xsl:call-template>
+              </xsl:when>
+              <xsl:when test="starts-with(normalize-space($xrefstyle),
+                                          'template:')">
+                <xsl:value-of select="substring-after(
+                                 normalize-space($xrefstyle), 'template:')"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <!-- Look for Gentext template with @style attribute -->
+                <!-- Must compare to no style value because gentext.template
+                     falls back to no style -->
+
+                <xsl:variable name="xref-context">
+                  <xsl:call-template name="gentext.template">
+                    <xsl:with-param name="context" select="'xref'"/>
+                    <xsl:with-param name="name" select="$target.elem"/>
+                    <xsl:with-param name="lang" select="$lang"/>
+                  </xsl:call-template>
+                </xsl:variable>
+
+                <xsl:variable name="styled-xref-context">
+                  <xsl:call-template name="gentext.template">
+                    <xsl:with-param name="context" select="'xref'"/>
+                    <xsl:with-param name="name" select="$target.elem"/>
+                    <xsl:with-param name="lang" select="$lang"/>
+                    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+                  </xsl:call-template>
+                </xsl:variable>
+
+                <xsl:variable name="xref-number-context">
+                  <xsl:call-template name="gentext.template">
+                    <xsl:with-param name="context" select="'xref-number'"/>
+                    <xsl:with-param name="name" select="$target.elem"/>
+                    <xsl:with-param name="lang" select="$lang"/>
+                  </xsl:call-template>
+                </xsl:variable>
+
+                <xsl:variable name="styled-xref-number-context">
+                  <xsl:call-template name="gentext.template">
+                    <xsl:with-param name="context" select="'xref-number'"/>
+                    <xsl:with-param name="name" select="$target.elem"/>
+                    <xsl:with-param name="lang" select="$lang"/>
+                    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+                  </xsl:call-template>
+                </xsl:variable>
+
+                <xsl:variable name="xref-number-and-title-context">
+                  <xsl:call-template name="gentext.template">
+                    <xsl:with-param name="context" 
+                                    select="'xref-number-and-title'"/>
+                    <xsl:with-param name="name" select="$target.elem"/>
+                    <xsl:with-param name="lang" select="$lang"/>
+                  </xsl:call-template>
+                </xsl:variable>
+
+                <xsl:variable name="styled-xref-number-and-title-context">
+                  <xsl:call-template name="gentext.template">
+                    <xsl:with-param name="context" 
+                                    select="'xref-number-and-title'"/>
+                    <xsl:with-param name="name" select="$target.elem"/>
+                    <xsl:with-param name="lang" select="$lang"/>
+                    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+                  </xsl:call-template>
+                </xsl:variable>
+
+                <xsl:choose>
+                  <xsl:when test="$xref-number-and-title-context != 
+                                 $styled-xref-number-and-title-context and
+                                 $xref.number != '' and
+                                 $xref.with.number.and.title != 0">
+                    <xsl:value-of 
+                            select="$styled-xref-number-and-title-context"/>
+                  </xsl:when>
+                  <xsl:when test="$xref-number-context != 
+                                 $styled-xref-number-context and
+                                 $xref.number != ''">
+                    <xsl:value-of select="$styled-xref-number-context"/>
+                  </xsl:when>
+                  <xsl:when test="$xref-context != $styled-xref-context">
+                    <xsl:value-of select="$styled-xref-context"/>
+                  </xsl:when>
+                  <xsl:when test="$xref-number-and-title-context != '' and
+                                 $xref.number != '' and
+                                 $xref.with.number.and.title != 0">
+                    <xsl:value-of 
+                            select="$xref-number-and-title-context"/>
+                    <xsl:if test="$olink.debug">
+                      <xsl:message>
+                        <xsl:text>Olink error: no gentext template</xsl:text>
+                        <xsl:text> exists for xrefstyle '</xsl:text>
+                        <xsl:value-of select="$xrefstyle"/>
+                        <xsl:text>' for element '</xsl:text>
+                        <xsl:value-of select="$target.elem"/>
+                        <xsl:text>' in language '</xsl:text>
+                        <xsl:value-of select="$lang"/>
+                        <xsl:text>' in context 'xref-number-and-title</xsl:text>
+                        <xsl:text>'. Using template without @style.</xsl:text>
+                      </xsl:message>
+                    </xsl:if>
+                  </xsl:when>
+                  <xsl:when test="$xref-number-context != '' and
+                                 $xref.number != ''">
+                    <xsl:value-of select="$xref-number-context"/>
+                    <xsl:if test="$olink.debug">
+                      <xsl:message>
+                        <xsl:text>Olink error: no gentext template</xsl:text>
+                        <xsl:text> exists for xrefstyle '</xsl:text>
+                        <xsl:value-of select="$xrefstyle"/>
+                        <xsl:text>' for element '</xsl:text>
+                        <xsl:value-of select="$target.elem"/>
+                        <xsl:text>' in language '</xsl:text>
+                        <xsl:value-of select="$lang"/>
+                        <xsl:text>' in context 'xref-number</xsl:text>
+                        <xsl:text>'. Using template without @style.</xsl:text>
+                      </xsl:message>
+                    </xsl:if>
+                  </xsl:when>
+                  <xsl:when test="$xref-context != ''">
+                    <xsl:value-of select="$xref-context"/>
+                    <xsl:if test="$olink.debug">
+                      <xsl:message>
+                        <xsl:text>Olink error: no gentext template</xsl:text>
+                        <xsl:text> exists for xrefstyle '</xsl:text>
+                        <xsl:value-of select="$xrefstyle"/>
+                        <xsl:text>' for element '</xsl:text>
+                        <xsl:value-of select="$target.elem"/>
+                        <xsl:text>' in language '</xsl:text>
+                        <xsl:value-of select="$lang"/>
+                        <xsl:text>' in context 'xref</xsl:text>
+                        <xsl:text>'. Using template without @style.</xsl:text>
+                      </xsl:message>
+                    </xsl:if>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:message>
+                      <xsl:text>Olink error: no gentext template</xsl:text>
+                      <xsl:text> exists for xrefstyle '</xsl:text>
+                      <xsl:value-of select="$xrefstyle"/>
+                      <xsl:text>' for element '</xsl:text>
+                      <xsl:value-of select="$target.elem"/>
+                      <xsl:text>' in language '</xsl:text>
+                      <xsl:value-of select="$lang"/>
+                      <xsl:text>'. Trying '%t'.</xsl:text>
+                    </xsl:message>
+                    <xsl:value-of select="'%t'"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:variable>
+
+          <xsl:if test="$olink.debug != 0">
+            <xsl:message>
+              <xsl:text>Olink debug: xrefstyle template is '</xsl:text>
+              <xsl:value-of select="$template"/>
+              <xsl:text>'.</xsl:text>
+            </xsl:message>
+          </xsl:if>
+
+          <xsl:call-template name="substitute-markup">
+            <xsl:with-param name="template" select="$template"/>
+            <xsl:with-param name="title">
+              <xsl:for-each select="$target.database" >
+                <xsl:value-of select="key('targetptr-key', $olink.key)/ttl" />
+              </xsl:for-each>
+            </xsl:with-param>
+            <xsl:with-param name="label">
+              <xsl:for-each select="$target.database" >
+                <xsl:value-of 
+                        select="key('targetptr-key', $olink.key)/@number" />
+              </xsl:for-each>
+            </xsl:with-param>
+            <xsl:with-param name="pagenumber">
+              <xsl:for-each select="$target.database" >
+                <xsl:value-of 
+                        select="key('targetptr-key', $olink.key)/@page" />
+              </xsl:for-each>
+            </xsl:with-param>
+            <xsl:with-param name="docname">
+              <xsl:for-each select="$target.database" >
+                <xsl:value-of 
+                       select="key('targetdoc-key', $targetdoc)/div[1]/ttl" />
+              </xsl:for-each>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:when>
+
+        <xsl:when test="$use.local.olink.style != 0">
+
+          <xsl:variable name="template">
+            <xsl:call-template name="gentext.template">
+              <xsl:with-param name="context" select="'xref'"/>
+              <xsl:with-param name="name" select="$target.elem"/>
+              <xsl:with-param name="lang" select="$lang"/>
+            </xsl:call-template>
+          </xsl:variable>
+
+          <xsl:call-template name="substitute-markup">
+            <xsl:with-param name="template" select="$template"/>
+            <xsl:with-param name="title">
+              <xsl:for-each select="$target.database" >
+                <xsl:value-of select="key('targetptr-key', $olink.key)/ttl" />
+              </xsl:for-each>
+            </xsl:with-param>
+            <xsl:with-param name="label">
+              <xsl:for-each select="$target.database" >
+                <xsl:value-of 
+                          select="key('targetptr-key', $olink.key)/@number" />
+              </xsl:for-each>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="$xref.text !=''">
+          <xsl:copy-of select="$xref.text"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>Olink error: no generated text for </xsl:text>
+            <xsl:text>targetdoc/targetptr/lang = '</xsl:text>
+            <xsl:value-of select="$olink.key"/>
+            <xsl:text>'.</xsl:text>
+          </xsl:message>
+          <xsl:text>????</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="@targetdoc != '' or @targetptr != ''">
+      <xsl:if test="$olink.key != ''">
+        <xsl:message>
+          <xsl:text>Olink error: no generated text for </xsl:text>
+          <xsl:text>targetdoc/targetptr/lang = '</xsl:text>
+          <xsl:value-of select="$olink.key"/>
+          <xsl:text>'.</xsl:text>
+        </xsl:message>
+      </xsl:if>
+      <xsl:text>????</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- old style olink -->
+      <xsl:call-template name="olink.outline">
+        <xsl:with-param name="outline.base.uri"
+                        select="unparsed-entity-uri(@targetdocent)"/>
+        <xsl:with-param name="localinfo" select="@localinfo"/>
+        <xsl:with-param name="return" select="'xreftext'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*" mode="olink.docname.markup">
+  <!-- No-op for now -->
+</xsl:template>
+
+<xsl:template name="targetpath">
+  <xsl:param name="dirnode" />
+  <xsl:param name="targetdoc" select="''"/>
+
+<!-- 
+<xsl:message>dirnode is <xsl:value-of select="$dirnode/@name"/></xsl:message>
+<xsl:message>targetdoc is <xsl:value-of select="$targetdoc"/></xsl:message>
+-->
+  <!-- recursive template generates path to olink target directory -->
+  <xsl:choose>
+    <!-- Have we arrived at the final path step? -->
+    <xsl:when test="$dirnode/child::document[@targetdoc = $targetdoc]">
+      <!-- We are done -->
+    </xsl:when>
+    <!-- Have we reached the top without a match? -->
+    <xsl:when test="local-name($dirnode) != 'dir'" >
+        <xsl:message>Olink error: cannot locate targetdoc <xsl:value-of select="$targetdoc"/> in sitemap</xsl:message>
+    </xsl:when>
+    <!-- Is the target in a descendant? -->
+    <xsl:when test="$dirnode/descendant::document/@targetdoc = $targetdoc">
+      <xsl:variable name="step" select="$dirnode/child::dir[descendant::document/@targetdoc = $targetdoc]"/>
+      <xsl:if test = "$step">
+        <xsl:value-of select="$step/@name"/>
+        <xsl:text>/</xsl:text>
+      </xsl:if>
+      <!-- Now recurse with the child -->
+      <xsl:call-template name="targetpath" >
+        <xsl:with-param name="dirnode" select="$step"/>
+        <xsl:with-param name="targetdoc" select="$targetdoc"/>
+      </xsl:call-template>
+    </xsl:when>
+    <!-- Otherwise we need to move up a step -->
+    <xsl:otherwise>
+      <xsl:if test="$dirnode/parent::dir">
+        <xsl:text>../</xsl:text>
+      </xsl:if>
+      <xsl:call-template name="targetpath" >
+        <xsl:with-param name="dirnode" select="$dirnode/parent::*"/>
+        <xsl:with-param name="targetdoc" select="$targetdoc"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="olink.page.citation">
+  <xsl:param name="olink.key" select="''"/>
+  <xsl:param name="olink.lang" select="'en'"/>
+  <xsl:param name="target.database"/>
+  <xsl:param name="linkend" select="''"/>
+  <xsl:param name="xrefstyle">
+    <xsl:choose>
+      <xsl:when test="@role and not(@xrefstyle) 
+                      and $use.role.as.xrefstyle != 0">
+        <xsl:value-of select="@role"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@xrefstyle"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+
+  <xsl:variable name="targetdoc">
+    <xsl:value-of select="substring-before($olink.key, '/')"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$linkend != ''">
+      <xsl:call-template name="xref.page.citation">
+        <xsl:with-param name="linkend" select="$linkend"/>
+        <xsl:with-param name="target" select="key('id', $linkend)"/>
+        <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="not(starts-with(normalize-space($xrefstyle),
+                        'select:') 
+                and (contains($xrefstyle, 'page')
+                     or contains($xrefstyle, 'Page')))
+                and $current.docid != '' 
+                and $current.docid != $targetdoc
+                and $insert.olink.page.number = 'yes' ">
+  
+      <xsl:variable name="page-number">
+        <xsl:for-each select="$target.database" >
+          <xsl:value-of 
+                 select="key('targetptr-key', $olink.key)/@page" />
+        </xsl:for-each>
+      </xsl:variable>
+  
+      <xsl:if test="$page-number != ''">
+        <xsl:call-template name="substitute-markup">
+          <xsl:with-param name="template">
+            <xsl:call-template name="gentext.template">
+              <xsl:with-param name="name" select="'olink.page.citation'"/>
+              <xsl:with-param name="context" select="'xref'"/>
+              <xsl:with-param name="lang" select="$olink.lang"/>
+            </xsl:call-template>
+          </xsl:with-param>
+          <xsl:with-param name="pagenumber" select="$page-number"/>
+        </xsl:call-template>
+      </xsl:if>
+  
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="olink.document.citation">
+  <xsl:param name="olink.key" select="''"/>
+  <xsl:param name="olink.lang" select="'en'"/>
+  <xsl:param name="target.database"/>
+  <xsl:param name="xrefstyle">
+    <xsl:choose>
+      <xsl:when test="@role and not(@xrefstyle) 
+                      and $use.role.as.xrefstyle != 0">
+        <xsl:value-of select="@role"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@xrefstyle"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+
+  <xsl:variable name="page">
+    <xsl:for-each select="$target.database" >
+      <xsl:value-of 
+             select="key('targetptr-key', $olink.key)/@page" />
+    </xsl:for-each>
+  </xsl:variable>
+
+  <xsl:variable name="targetdoc">
+    <xsl:value-of select="substring-before($olink.key, '/')"/>
+  </xsl:variable>
+
+  <xsl:variable name="targetptr">
+    <xsl:value-of 
+          select="substring-before(substring-after($olink.key, '/'), '/')"/>
+  </xsl:variable>
+
+  <!-- Don't add docname if pointing to root element -->
+  <xsl:variable name="rootptr">
+    <xsl:for-each select="$target.database" >
+      <xsl:value-of 
+             select="key('targetdoc-key', $targetdoc)/div[1]/@targetptr" />
+    </xsl:for-each>
+  </xsl:variable>
+
+  <xsl:variable name="docname">
+    <xsl:for-each select="$target.database" >
+      <xsl:value-of 
+             select="key('targetdoc-key', $targetdoc)/div[1]/ttl" />
+    </xsl:for-each>
+  </xsl:variable>
+
+  <xsl:if test="not(starts-with(normalize-space($xrefstyle), 'select:') 
+              and (contains($xrefstyle, 'docname')))
+              and ($olink.doctitle = 'yes' or $olink.doctitle = '1')
+              and $current.docid != '' 
+              and $rootptr != $targetptr
+              and $current.docid != $targetdoc
+              and $docname != ''">
+    <xsl:call-template name="substitute-markup">
+      <xsl:with-param name="template">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="name" select="'olink.document.citation'"/>
+          <xsl:with-param name="context" select="'xref'"/>
+          <xsl:with-param name="lang" select="$olink.lang"/>
+        </xsl:call-template>
+      </xsl:with-param>
+      <xsl:with-param name="docname" select="$docname"/>
+      <xsl:with-param name="pagenumber" select="$page"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="xref.page.citation">
+  <!-- Determine if this xref should have a page citation.
+       Context node is the xref or local olink element -->
+  <xsl:param name="linkend" select="@linkend"/>
+  <xsl:param name="target" select="key('id', $linkend)"/>
+  <xsl:param name="xrefstyle">
+    <xsl:choose>
+      <xsl:when test="@role and not(@xrefstyle) 
+                      and $use.role.as.xrefstyle != 0">
+        <xsl:value-of select="@role"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@xrefstyle"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+
+  <xsl:if test="not(starts-with(normalize-space($xrefstyle),'select:')
+                    and (contains($xrefstyle, 'page')
+                         or contains($xrefstyle, 'Page')))
+                and ( $insert.xref.page.number = 'yes' 
+                   or $insert.xref.page.number = '1')
+                or local-name($target) = 'para'">
+    <xsl:apply-templates select="$target" mode="page.citation">
+      <xsl:with-param name="id" select="$linkend"/>
+    </xsl:apply-templates>
+  </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 211 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/pi.xsl

@@ -0,0 +1,211 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                xmlns:date="http://exslt.org/dates-and-times"
+                xmlns:exsl="http://exslt.org/common"
+                exclude-result-prefixes="doc date exsl"
+                extension-element-prefixes="date exsl"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     This file contains general templates for processing processing
+     instructions common to both the HTML and FO versions of the
+     DocBook stylesheets.
+     ******************************************************************** -->
+
+<!-- Process PIs also on title pages -->
+<xsl:template match="processing-instruction()" mode="titlepage.mode">
+  <xsl:apply-templates select="."/>
+</xsl:template>
+
+<xsl:template match="processing-instruction('dbtimestamp')">
+  <xsl:variable name="format">
+    <xsl:variable name="pi-format">
+      <xsl:call-template name="pi-attribute">
+        <xsl:with-param name="pis" select="."/>
+        <xsl:with-param name="attribute">format</xsl:with-param>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$pi-format != ''">
+        <xsl:value-of select="$pi-format"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'datetime'"/>
+          <xsl:with-param name="name" select="'format'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>  
+
+  <xsl:variable name="padding">
+    <xsl:variable name="pi-padding">
+      <xsl:call-template name="pi-attribute">
+        <xsl:with-param name="pis" select="."/>
+        <xsl:with-param name="attribute">padding</xsl:with-param>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$pi-padding != ''">
+        <xsl:value-of select="$pi-padding"/>
+      </xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="date">
+    <xsl:choose>
+      <xsl:when test="function-available('date:date-time')">
+        <xsl:value-of select="date:date-time()"/>
+      </xsl:when>
+      <xsl:when test="function-available('date:dateTime')">
+        <!-- Xalan quirk -->
+        <xsl:value-of select="date:dateTime()"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="function-available('date:date-time') or
+                    function-available('date:dateTime')">
+      <xsl:call-template name="datetime.format">
+        <xsl:with-param name="date" select="$date"/>
+        <xsl:with-param name="format" select="$format"/>
+        <xsl:with-param name="padding" select="$padding"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        Timestamp processing requires XSLT processor with EXSLT date support.
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="datetime.format">
+  <xsl:param name="date"/>
+  <xsl:param name="format"/>
+  <xsl:param name="padding" select="1"/>
+  
+  <xsl:if test="$format != ''">
+    <!-- replace any whitespace in the format string with a non-breaking space -->
+    <xsl:variable name="format-nbsp"
+		  select="translate($format,
+			  '&#x20;&#x9;&#xd;&#xa;',
+			  '&#xa0;&#xa0;&#xa0;&#xa0;')"/>
+    <xsl:variable name="tokenized-format-string">
+      <xsl:call-template name="str.tokenize.keep.delimiters">
+	<xsl:with-param name="string" select="$format-nbsp"/>
+	<xsl:with-param name="delimiters" select="'&#xa0;,./-()[]:'"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+  <xsl:choose>
+    <!-- include extra test for Xalan quirk -->
+    <xsl:when test="function-available('exsl:node-set') or 
+		    contains(system-property('xsl:vendor'),'Apache Software Foundation')">
+      <!-- We must preserve context node in order to get valid language -->
+      <xsl:variable name="context" select="."/>
+      <xsl:for-each select="exsl:node-set($tokenized-format-string)/node()">
+        <xsl:variable name="token">
+          <xsl:value-of select="."/>
+        </xsl:variable>
+        <!-- Restore context node -->
+        <xsl:for-each select="$context">
+          <xsl:choose>
+            <xsl:when test="$token = 'a'">
+              <xsl:call-template name="gentext.template">
+                <xsl:with-param name="context" select="'datetime-abbrev'"/>
+                <xsl:with-param name="name" select="date:day-abbreviation($date)"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$token = 'A'">
+              <xsl:call-template name="gentext.template">
+                <xsl:with-param name="context" select="'datetime-full'"/>
+                <xsl:with-param name="name" select="date:day-name($date)"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$token = 'b'">
+              <xsl:call-template name="gentext.template">
+                <xsl:with-param name="context" select="'datetime-abbrev'"/>
+                <xsl:with-param name="name" select="date:month-abbreviation($date)"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$token = 'c'">
+              <xsl:value-of select="date:date($date)"/>
+              <xsl:text> </xsl:text>
+              <xsl:value-of select="date:time($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'B'">
+              <xsl:call-template name="gentext.template">
+                <xsl:with-param name="context" select="'datetime-full'"/>
+                <xsl:with-param name="name" select="date:month-name($date)"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$token = 'd'">
+              <xsl:if test="$padding = 1 and
+              string-length(date:day-in-month($date)) = 1">0</xsl:if>
+              <xsl:value-of select="date:day-in-month($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'H'">
+              <xsl:if test="$padding = 1 and string-length(date:hour-in-day($date)) = 1">0</xsl:if>
+              <xsl:value-of select="date:hour-in-day($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'j'">
+              <xsl:value-of select="date:day-in-year($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'm'">
+              <xsl:if test="$padding = 1 and string-length(date:month-in-year($date)) = 1">0</xsl:if>
+              <xsl:value-of select="date:month-in-year($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'M'">
+              <xsl:if test="string-length(date:minute-in-hour($date)) = 1">0</xsl:if>
+              <xsl:value-of select="date:minute-in-hour($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'S'">
+              <xsl:if test="string-length(date:second-in-minute($date)) = 1">0</xsl:if>
+              <xsl:value-of select="date:second-in-minute($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'U'">
+              <xsl:value-of select="date:week-in-year($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'w'">
+              <xsl:value-of select="date:day-in-week($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'x'">
+              <xsl:value-of select="date:date($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'X'">
+              <xsl:value-of select="date:time($date)"/>
+            </xsl:when>
+            <xsl:when test="$token = 'Y'">
+              <xsl:value-of select="date:year($date)"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$token"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:for-each>
+      </xsl:for-each>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        Timestamp processing requires an XSLT processor with support
+        for the EXSLT node-set() function.
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+  </xsl:if>
+
+</xsl:template>
+
+</xsl:stylesheet>

+ 1288 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/refentry.xsl

@@ -0,0 +1,1288 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                xmlns:date="http://exslt.org/dates-and-times"
+                exclude-result-prefixes="doc date"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+<doc:reference xmlns="">
+  <referenceinfo>
+    <releaseinfo role="meta">
+      $Id$
+    </releaseinfo>
+    <corpauthor>The DocBook Project</corpauthor>
+    <copyright>
+      <year>2005-2007</year>
+      <holder>The DocBook Project</holder>
+    </copyright>
+  </referenceinfo>
+  <title>Refentry Metadata-Gathering Template Reference</title>
+
+  <partintro id="partintro">
+    <title>Introduction</title>
+
+    <para>This is technical reference documentation for the "refentry
+    metadata gathering" templates in the DocBook XSL Stylesheets.</para>
+
+    <para>This is not intended to be user documentation. It is provided
+    for developers writing customization layers for the
+    stylesheets.</para>
+
+    <note>
+      <para>Currently, only the manpages stylesheets make use of these
+      templates. They are, however, potentially useful elsewhere.</para>
+    </note>
+
+  </partintro>
+
+</doc:reference>
+
+<!-- ==================================================================== -->
+<doc:template name="get.refentry.metadata" xmlns="">
+  <refpurpose>Gathers metadata from a refentry and its ancestors</refpurpose>
+  <refdescription id="get.refentry.metadata-desc">
+    <para>Reference documentation for particular commands, functions,
+    etc., is sometimes viewed in isolation from its greater "context". For
+    example, users view Unix man pages as, well, individual pages, not as
+    part of a "book" of some kind. Therefore, it is sometimes necessary to
+    embed "context" information in output for each <sgmltag>refentry</sgmltag>.</para>
+
+    <para>However, one problem is that different users mark up that
+    context information in different ways. Often (usually), the
+    context information is not actually part of the content of the
+    <sgmltag>refentry</sgmltag> itself, but instead part of the content of a
+    parent or ancestor element to the the <sgmltag>refentry</sgmltag>. And
+    even then, DocBook provides a variety of elements that users might
+    potentially use to mark up the same kind of information. One user
+    might use the <sgmltag>productnumber</sgmltag> element to mark up version
+    information about a particular product, while another might use
+    the <sgmltag>releaseinfo</sgmltag> element.</para>
+
+    <para>Taking all that in mind, the
+    <function>get.refentry.metadata</function> template tries to gather
+    metadata from a <sgmltag>refentry</sgmltag> element and its ancestor
+    elements in an intelligent and user-configurable way. The basic
+    mechanism used in the XPath expressions throughout this stylesheet
+    is to select the relevant metadata from the *info element that is
+    closest to the actual <sgmltag>refentry</sgmltag>&#160;– either on the
+    <sgmltag>refentry</sgmltag> itself, or on its nearest ancestor.</para>
+
+    <note>
+      <para>The <function>get.refentry.metadata</function>
+        template is actually just sort of a "driver" template; it
+        calls other templates that do the actual data collection,
+        then returns the data as a set.</para>
+    </note>
+
+  </refdescription>
+  <refparameter id="get.refentry.metadata-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>info</term>
+        <listitem>
+          <para>A set of info nodes (from a <sgmltag>refentry</sgmltag>
+          element and its ancestors)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>prefs</term>
+        <listitem>
+          <para>A node containing user preferences (from global
+          stylesheet parameters)</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="get.refentry.metadata-returns">
+    <para>Returns a node set with the following elements. The
+    descriptions are verbatim from the <literal>man(7)</literal> man
+    page.
+    <variablelist>
+      <varlistentry>
+        <term>title</term>
+        <listitem>
+          <para>the title of the man page (e.g., <literal>MAN</literal>)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>section</term>
+        <listitem>
+          <para>the section number the man page should be placed in (e.g.,
+          <literal>7</literal>)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>date</term>
+        <listitem>
+          <para>the date of the last revision</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>source</term>
+        <listitem>
+          <para>the source of the command</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>manual</term>
+        <listitem>
+          <para>the title of the manual (e.g., <citetitle>Linux
+          Programmer's Manual</citetitle>)</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+    </para>
+  </refreturn>
+</doc:template>
+<xsl:template name="get.refentry.metadata">
+  <xsl:param name="refname"/>
+  <xsl:param name="info"/>
+  <xsl:param name="prefs"/>
+  <title>
+    <xsl:call-template name="get.refentry.title">
+      <xsl:with-param name="refname" select="$refname"/>
+    </xsl:call-template>
+  </title>
+  <section>
+    <xsl:call-template name="get.refentry.section">
+      <xsl:with-param name="refname" select="$refname"/>
+    </xsl:call-template>
+  </section>
+  <date>
+    <xsl:call-template name="get.refentry.date">
+      <xsl:with-param name="info" select="$info"/>
+      <xsl:with-param name="refname" select="$refname"/>
+      <xsl:with-param name="prefs" select="$prefs/DatePrefs"/>
+    </xsl:call-template>
+  </date>
+  <source>
+    <xsl:call-template name="get.refentry.source">
+      <xsl:with-param name="info" select="$info"/>
+      <xsl:with-param name="refname" select="$refname"/>
+      <xsl:with-param name="prefs" select="$prefs/SourcePrefs"/>
+    </xsl:call-template>
+  </source>
+  <manual>
+    <xsl:call-template name="get.refentry.manual">
+      <xsl:with-param name="info" select="$info"/>
+      <xsl:with-param name="refname" select="$refname"/>
+      <xsl:with-param name="prefs" select="$prefs/ManualPrefs"/>
+    </xsl:call-template>
+  </manual>
+</xsl:template>
+
+<!-- ====================================================================== -->
+<doc:template name="get.refentry.title" xmlns="">
+  <refpurpose>Gets title metadata for a refentry</refpurpose>
+  <refdescription id="get.refentry.title-desc">
+    <para>The <literal>man(7)</literal> man page describes this as "the
+    title of the man page (e.g., <literal>MAN</literal>). This differs
+    from <sgmltag>refname</sgmltag> in that, if the <sgmltag>refentry</sgmltag> has a
+    <sgmltag>refentrytitle</sgmltag>, we use that as the <sgmltag>title</sgmltag>;
+    otherwise, we just use first <sgmltag>refname</sgmltag> in the first
+    <sgmltag>refnamediv</sgmltag> in the source.</para>
+  </refdescription>
+  <refparameter id="get.refentry.title-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="get.refentry.title-returns">
+  <para>Returns a <sgmltag>title</sgmltag> node.</para></refreturn>
+</doc:template>
+<xsl:template name="get.refentry.title">
+  <xsl:param name="refname"/>
+  <xsl:choose>
+    <xsl:when test="refmeta/refentrytitle">
+      <xsl:copy>
+        <xsl:apply-templates select="refmeta/refentrytitle/node()"/>
+      </xsl:copy>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$refname"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<doc:template name="get.refentry.section" xmlns="">
+  <refpurpose>Gets section metadata for a refentry</refpurpose>
+  <refdescription id="get.refentry.section-desc">
+    <para>The <literal>man(7)</literal> man page describes this as "the
+    section number the man page should be placed in (e.g.,
+    <literal>7</literal>)". If we do not find a <sgmltag>manvolnum</sgmltag>
+    specified in the source, and we find that the <sgmltag>refentry</sgmltag> is
+    for a function, we use the section number <literal>3</literal>
+    ["Library calls (functions within program libraries)"]; otherwise, we
+    default to using <literal>1</literal> ["Executable programs or shell
+    commands"].</para>
+  </refdescription>
+  <refparameter id="get.refentry.section-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>quiet</term>
+        <listitem>
+          <para>If non-zero, no "missing" message is emitted</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="get.refentry.section-returns">
+  <para>Returns a string representing a section number.</para></refreturn>
+</doc:template>
+<xsl:template name="get.refentry.section">
+  <xsl:param name="refname"/>
+  <xsl:param name="quiet" select="0"/>
+  <xsl:choose>
+    <xsl:when test="refmeta/manvolnum">
+      <xsl:value-of select="refmeta/manvolnum"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$quiet = 0">
+        <xsl:if test="$refentry.meta.get.quietly = 0">
+          <xsl:call-template name="log.message">
+            <xsl:with-param name="level">Note</xsl:with-param>
+            <xsl:with-param name="source" select="$refname"/>
+            <xsl:with-param name="context-desc">meta manvol</xsl:with-param>
+            <xsl:with-param name="message">
+              <xsl:text>no refentry/refmeta/manvolnum</xsl:text>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:call-template name="log.message">
+            <xsl:with-param name="level">Note</xsl:with-param>
+            <xsl:with-param name="source" select="$refname"/>
+            <xsl:with-param name="context-desc">meta manvol</xsl:with-param>
+            <xsl:with-param name="message">
+              <xsl:text>see http://docbook.sf.net/el/manvolnum</xsl:text>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+      </xsl:if>
+      <xsl:choose>
+        <xsl:when test=".//funcsynopsis">
+          <xsl:if test="$quiet = 0">
+            <xsl:if test="$refentry.meta.get.quietly = 0">
+              <xsl:call-template name="log.message">
+                <xsl:with-param name="level">Note</xsl:with-param>
+                <xsl:with-param name="source" select="$refname"/>
+                <xsl:with-param name="context-desc">meta manvol</xsl:with-param>
+                <xsl:with-param name="message">
+                  <xsl:text>Setting man section to 3</xsl:text>
+                </xsl:with-param>
+              </xsl:call-template>
+            </xsl:if>
+          </xsl:if>
+          <xsl:text>3</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>1</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<doc:template name="get.refentry.date" xmlns="">
+  <refpurpose>Gets date metadata for a refentry</refpurpose>
+  <refdescription id="get.refentry.date-desc">
+    <para>The <literal>man(7)</literal> man page describes this as "the
+    date of the last revision". If we cannot find a date in the source, we
+    generate one.</para>
+  </refdescription>
+  <refparameter id="get.refentry.date-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>info</term>
+        <listitem>
+          <para>A set of info nodes (from a <sgmltag>refentry</sgmltag>
+          element and its ancestors)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>prefs</term>
+        <listitem>
+          <para>A node containing users preferences (from global stylesheet parameters)</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="get.refentry.date-returns">
+    <para>Returns a <sgmltag>date</sgmltag> node.</para>
+  </refreturn>
+</doc:template>
+<xsl:template name="get.refentry.date">
+  <xsl:param name="refname"/>
+  <xsl:param name="info"/>
+  <xsl:param name="prefs"/>
+  <xsl:variable name="Date">
+    <xsl:choose>
+      <!-- * if profiling is enabled for date, and the date -->
+      <!-- * profile is non-empty, use it -->
+      <xsl:when test="not($prefs/@profileEnabled = 0) and
+                      not($prefs/@profile = '')">
+        <xsl:call-template name="evaluate.info.profile">
+          <xsl:with-param name="profile" select="$prefs/@profile"/>
+          <xsl:with-param name="info" select="$info"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- * either profiling is not enabled for date, or the-->
+        <!-- * date profile is empty, so we need to look for date -->
+        <!-- * in *info -->
+        <xsl:choose>
+          <!-- * look for date or pubdate in *info -->
+          <xsl:when test="$info/date/node()
+                          |$info/pubdate/node()">
+            <xsl:apply-templates
+                select="(($info[date])[last()]/date)[1]|
+                        (($info[pubdate])[last()]/pubdate)[1]"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <!-- * found no Date or Pubdate -->
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="not($Date = '')">
+      <xsl:value-of select="$Date"/>
+    </xsl:when>
+    <!-- * We couldn't find a date, so we generate a date. -->
+    <!-- * And we make it an appropriately localized date. -->
+    <xsl:otherwise>
+      <xsl:if test="$refentry.meta.get.quietly = 0">
+        <xsl:call-template name="log.message">
+          <xsl:with-param name="level">Note</xsl:with-param>
+          <xsl:with-param name="source" select="$refname"/>
+          <xsl:with-param name="context-desc">meta date</xsl:with-param>
+          <xsl:with-param name="message">
+            <xsl:text>no date; using generated date</xsl:text>
+          </xsl:with-param>
+        </xsl:call-template>
+        <xsl:call-template name="log.message">
+          <xsl:with-param name="level">Note</xsl:with-param>
+          <xsl:with-param name="source" select="$refname"/>
+          <xsl:with-param name="context-desc">meta date</xsl:with-param>
+          <xsl:with-param name="message">
+            <xsl:text>see http://docbook.sf.net/el/date</xsl:text>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <xsl:call-template name="datetime.format">
+        <xsl:with-param name="date">
+          <xsl:choose>
+            <xsl:when test="function-available('date:date-time')">
+              <xsl:value-of select="date:date-time()"/>
+            </xsl:when>
+            <xsl:when test="function-available('date:dateTime')">
+              <!-- Xalan quirk -->
+              <xsl:value-of select="date:dateTime()"/>
+            </xsl:when>
+          </xsl:choose>
+        </xsl:with-param>
+        <xsl:with-param name="format">
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="context" select="'datetime'"/>
+            <xsl:with-param name="name" select="'format'"/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<doc:template name="get.refentry.source" xmlns="">
+  <refpurpose>Gets source metadata for a refentry</refpurpose>
+  <refdescription id="get.refentry.source-desc">
+    <para>The <literal>man(7)</literal> man page describes this as "the
+    source of the command", and provides the following examples:
+    <itemizedlist>
+      <listitem>
+        <para>For binaries, use something like: GNU, NET-2, SLS
+        Distribution, MCC Distribution.</para>
+      </listitem>
+      <listitem>
+        <para>For system calls, use the version of the kernel that you are
+        currently looking at: Linux 0.99.11.</para>
+      </listitem>
+      <listitem>
+        <para>For library calls, use the source of the function: GNU, BSD
+        4.3, Linux DLL 4.4.1.</para>
+      </listitem>
+    </itemizedlist>
+    </para>
+
+    <para>The <literal>solbook(5)</literal> man page describes
+    something very much like what <literal>man(7)</literal> calls
+    "source", except that <literal>solbook(5)</literal> names it
+    "software" and describes it like this:
+    <blockquote>
+      <para>This is the name of the software product that the topic
+      discussed on the reference page belongs to. For example UNIX
+      commands are part of the <literal>SunOS x.x</literal>
+      release.</para>
+    </blockquote>
+    </para>
+
+    <para>In practice, there are many pages that simply have a version
+    number in the "source" field. So, it looks like what we have is a
+    two-part field,
+    <replaceable>Name</replaceable>&#160;<replaceable>Version</replaceable>,
+    where:
+    <variablelist>
+      <varlistentry>
+        <term>Name</term>
+        <listitem>
+          <para>product name (e.g., BSD) or org. name (e.g., GNU)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>Version</term>
+        <listitem>
+          <para>version name</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+    Each part is optional. If the <replaceable>Name</replaceable> is a
+    product name, then the <replaceable>Version</replaceable> is probably
+    the version of the product. Or there may be no
+    <replaceable>Name</replaceable>, in which case, if there is a
+    <replaceable>Version</replaceable>, it is probably the version of the
+    item itself, not the product it is part of. Or, if the
+    <replaceable>Name</replaceable> is an organization name, then there
+    probably will be no <replaceable>Version</replaceable>.
+    </para>
+  </refdescription>
+  <refparameter id="get.refentry.source-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>info</term>
+        <listitem>
+          <para>A set of info nodes (from a <sgmltag>refentry</sgmltag>
+          element and its ancestors)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>prefs</term>
+        <listitem>
+          <para>A node containing users preferences (from global
+          stylesheet parameters)</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="get.refentry.source-returns">
+    <para>Returns a <sgmltag>source</sgmltag> node.</para>
+  </refreturn>
+</doc:template>
+<xsl:template name="get.refentry.source">
+  <xsl:param name="refname"/>
+  <xsl:param name="info"/>
+  <xsl:param name="prefs"/>
+  <xsl:variable name="Name">
+    <xsl:if test="$prefs/Name/@suppress = 0">
+      <xsl:call-template name="get.refentry.source.name">
+        <xsl:with-param name="info" select="$info"/>
+        <xsl:with-param name="refname" select="$refname"/>
+        <xsl:with-param name="prefs" select="$prefs/Name"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="Version">
+    <xsl:if test="$prefs/Version/@suppress = 0">
+      <xsl:call-template name="get.refentry.version">
+        <xsl:with-param name="info" select="$info"/>
+        <xsl:with-param name="refname" select="$refname"/>
+        <xsl:with-param name="prefs" select="$prefs/Version"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:choose>
+    <!-- * if we have a Name and/or Version, use either or both -->
+    <!-- * of those, in the form "Name Version" or just "Name" -->
+    <!-- * or just "Version" -->
+    <xsl:when test="not($Name = '') or not($Version = '')">
+      <xsl:choose>
+        <xsl:when test="not($Name = '') and not($Version = '')">
+          <xsl:copy-of select="$Name"/>
+          <xsl:text> </xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select="$Name"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:copy-of select="$Version"/>
+    </xsl:when>
+    <!-- * if no Name and no Version, use fallback (if any) -->
+    <xsl:when test="not($prefs/@fallback = '')">
+      <xsl:variable name="source.fallback">
+        <xsl:call-template name="evaluate.info.profile">
+          <xsl:with-param name="profile" select="$prefs/@fallback"/>
+          <xsl:with-param name="info" select="$info"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="not($source.fallback = '')">
+          <xsl:value-of select="$source.fallback"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:if test="$refentry.meta.get.quietly = 0">
+            <xsl:call-template name="log.message">
+              <xsl:with-param name="level">Warn</xsl:with-param>
+              <xsl:with-param name="source" select="$refname"/>
+              <xsl:with-param name="context-desc">meta source</xsl:with-param>
+              <xsl:with-param name="message">
+                <xsl:text>no valid fallback for source; leaving empty</xsl:text>
+              </xsl:with-param>
+            </xsl:call-template>
+          </xsl:if>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$refentry.meta.get.quietly = 0">
+        <xsl:call-template name="log.message">
+          <xsl:with-param name="level">Warn</xsl:with-param>
+          <xsl:with-param name="source" select="$refname"/>
+          <xsl:with-param name="context-desc">meta source</xsl:with-param>
+          <xsl:with-param name="message">
+            <xsl:text>no source fallback specified; leaving empty</xsl:text>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<doc:template name="get.refentry.source.name" xmlns="">
+  <refpurpose>Gets source-name metadata for a refentry</refpurpose>
+  <refdescription id="get.refentry.source.name-desc">
+    <para>A "source name" is one part of a (potentially) two-part
+    <replaceable>Name</replaceable>&#160;<replaceable>Version</replaceable>
+    source field. For more details, see the documentation for the
+    <function>get.refentry.source</function> template.</para>
+  </refdescription>
+  <refparameter id="get.refentry.source.name-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>info</term>
+        <listitem>
+          <para>A set of info nodes (from a <sgmltag>refentry</sgmltag>
+          element and its ancestors)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>prefs</term>
+        <listitem>
+          <para>A node containing users preferences (from global
+          stylesheet parameters)</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="get.refentry.source.name-returns">
+    <para>Depending on what output method is used for the
+  current stylesheet, either returns a text node or possibly an element
+  node, containing "source name" data.</para>
+  </refreturn>
+</doc:template>
+<xsl:template name="get.refentry.source.name">
+  <xsl:param name="refname"/>
+  <xsl:param name="info"/>
+  <xsl:param name="prefs"/>
+  <xsl:choose>
+    <!-- * if profiling is enabled for source.name, and the -->
+    <!-- * source.name profile is non-empty, use it -->
+    <xsl:when test="not($prefs/@profileEnabled = 0) and
+                    not($prefs/@profile = '')">
+      <xsl:call-template name="evaluate.info.profile">
+        <xsl:with-param name="profile" select="$prefs/@profile"/>
+        <xsl:with-param name="info" select="$info"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- * either profiling for source.name is not enabled, or-->
+      <!-- * the source.name profile is empty; so we need to look -->
+      <!-- * for a name to use -->
+      <xsl:choose>
+        <xsl:when test="refmeta/refmiscinfo[@class = 'source' or @class = 'software']">
+          <xsl:apply-templates 
+              select="refmeta/refmiscinfo[@class = 'source' or @class='software'][1]/node()"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:choose>
+            <xsl:when test="$info/productname">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[productname])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[productname])[last()]/productname)[1]"/>
+                <xsl:with-param name="context">source</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$info/corpname">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[corpname])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[corpname])[last()]/corpname)[1]"/>
+                <xsl:with-param name="context">source</xsl:with-param>
+                <xsl:with-param name="preferred">productname</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$info/corpcredit">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[corpcredit])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[corpcredit])[last()]/corpcredit)[1]"/>
+                <xsl:with-param name="context">source</xsl:with-param>
+                <xsl:with-param name="preferred">productname</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$info/corpauthor">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[corpauthor])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[corpauthor])[last()]/corpauthor)[1]"/>
+                <xsl:with-param name="context">source</xsl:with-param>
+                <xsl:with-param name="preferred">productname</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$info//orgname">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[//orgname])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[//orgname])[last()]//orgname)[1]"/>
+                <xsl:with-param name="context">source</xsl:with-param>
+                <xsl:with-param name="preferred">productname</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$info//publishername">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[//publishername])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[//publishername])[last()]//publishername)[1]"/>
+                <xsl:with-param name="context">source</xsl:with-param>
+                <xsl:with-param name="preferred">productname</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:if test="$refentry.meta.get.quietly = 0">
+                <xsl:call-template name="log.message">
+                  <xsl:with-param name="level">Note</xsl:with-param>
+                  <xsl:with-param name="source" select="$refname"/>
+                  <xsl:with-param name="context-desc">meta source</xsl:with-param>
+                  <xsl:with-param name="message">
+                    <xsl:text>no *info/productname or alternative</xsl:text>
+                  </xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="log.message">
+                  <xsl:with-param name="level">Note</xsl:with-param>
+                  <xsl:with-param name="source" select="$refname"/>
+                  <xsl:with-param name="context-desc">meta source</xsl:with-param>
+                  <xsl:with-param name="message">
+                    <xsl:text>see http://docbook.sf.net/el/productname</xsl:text>
+                  </xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="log.message">
+                  <xsl:with-param name="level">Note</xsl:with-param>
+                  <xsl:with-param name="source" select="$refname"/>
+                  <xsl:with-param name="context-desc">meta source</xsl:with-param>
+                  <xsl:with-param name="message">
+                    <xsl:text>no refentry/refmeta/refmiscinfo@class=source</xsl:text>
+                  </xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="log.message">
+                  <xsl:with-param name="level">Note</xsl:with-param>
+                  <xsl:with-param name="source" select="$refname"/>
+                  <xsl:with-param name="context-desc">meta source</xsl:with-param>
+                  <xsl:with-param name="message">
+                    <xsl:text>see http://docbook.sf.net/el/refmiscinfo</xsl:text>
+                  </xsl:with-param>
+                </xsl:call-template>
+              </xsl:if>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<doc:template name="get.refentry.version" xmlns="">
+  <refpurpose>Gets version metadata for a refentry</refpurpose>
+  <refdescription id="get.refentry.version-desc">
+    <para>A "version" is one part of a (potentially) two-part
+    <replaceable>Name</replaceable>&#160;<replaceable>Version</replaceable>
+    source field. For more details, see the documentation for the
+    <function>get.refentry.source</function> template.</para>
+  </refdescription>
+  <refparameter id="get.refentry.version-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>info</term>
+        <listitem>
+          <para>A set of info nodes (from a <sgmltag>refentry</sgmltag>
+          element and its ancestors)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>prefs</term>
+        <listitem>
+          <para>A node containing users preferences (from global
+          stylesheet parameters)</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="get.refentry.version-returns">
+    <para>Depending on what output method is used for the
+  current stylesheet, either returns a text node or possibly an element
+  node, containing "version" data.</para>
+  </refreturn>
+</doc:template>
+<xsl:template name="get.refentry.version">
+  <xsl:param name="refname"/>
+  <xsl:param name="info"/>
+  <xsl:param name="prefs"/>
+  <xsl:choose>
+    <!-- * if profiling is enabled for version, and the -->
+    <!-- * version profile is non-empty, use it -->
+    <xsl:when test="not($prefs/@profileEnabled = 0) and
+                    not($prefs/@profile = '')">
+      <xsl:call-template name="evaluate.info.profile">
+        <xsl:with-param name="profile" select="$prefs/@profile"/>
+        <xsl:with-param name="info" select="$info"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- * either profiling for source.name is not enabled, or-->
+      <!-- * the source.name profile is empty; so we need to look -->
+      <!-- * for a name to use -->
+      <xsl:choose>
+        <xsl:when test="refmeta/refmiscinfo[@class = 'version']">
+          <xsl:apply-templates 
+              select="refmeta/refmiscinfo[@class = 'version'][1]/node()"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:choose>
+            <xsl:when test="$info/productnumber">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[productnumber])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[productnumber])[last()]/productnumber)[1]"/>
+                <xsl:with-param name="context">version</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$info/edition">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[edition])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[edition])[last()]/edition)[1]"/>
+                <xsl:with-param name="context">version</xsl:with-param>
+                <xsl:with-param name="preferred">productnumber</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$info/releaseinfo">
+              <xsl:call-template name="set.refentry.metadata">
+                <xsl:with-param name="refname" select="$refname"/>
+                <xsl:with-param
+                    name="info"
+                    select="($info[releaseinfo])[last()]"/>
+                <xsl:with-param
+                    name="contents"
+                    select="(($info[releaseinfo])[last()]/releaseinfo)[1]"/>
+                <xsl:with-param name="context">version</xsl:with-param>
+                <xsl:with-param name="preferred">productnumber</xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:if test="$refentry.meta.get.quietly = 0">
+                <xsl:call-template name="log.message">
+                  <xsl:with-param name="level">Note</xsl:with-param>
+                  <xsl:with-param name="source" select="$refname"/>
+                  <xsl:with-param name="context-desc">meta version</xsl:with-param>
+                  <xsl:with-param name="message">
+                    <xsl:text>no *info/productnumber or alternative</xsl:text>
+                  </xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="log.message">
+                  <xsl:with-param name="level">Note</xsl:with-param>
+                  <xsl:with-param name="source" select="$refname"/>
+                  <xsl:with-param name="context-desc">meta version</xsl:with-param>
+                  <xsl:with-param name="message">
+                    <xsl:text>see http://docbook.sf.net/el/productnumber</xsl:text>
+                  </xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="log.message">
+                  <xsl:with-param name="level">Note</xsl:with-param>
+                  <xsl:with-param name="source" select="$refname"/>
+                  <xsl:with-param name="context-desc">meta version</xsl:with-param>
+                  <xsl:with-param name="message">
+                    <xsl:text>no refentry/refmeta/refmiscinfo@class=version</xsl:text>
+                  </xsl:with-param>
+                </xsl:call-template>
+                <xsl:call-template name="log.message">
+                  <xsl:with-param name="level">Note</xsl:with-param>
+                  <xsl:with-param name="source" select="$refname"/>
+                  <xsl:with-param name="context-desc">meta version</xsl:with-param>
+                  <xsl:with-param name="message">
+                    <xsl:text>see http://docbook.sf.net/el/refmiscinfo</xsl:text>
+                  </xsl:with-param>
+                </xsl:call-template>
+              </xsl:if>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<doc:template name="get.refentry.manual" xmlns="">
+  <refpurpose>Gets source metadata for a refentry</refpurpose>
+  <refdescription id="get.refentry.manual-desc">
+    <para>The <literal>man(7)</literal> man page describes this as "the
+    title of the manual (e.g., <citetitle>Linux Programmer's
+    Manual</citetitle>)". Here are some examples from existing man pages:
+    <itemizedlist>
+      <listitem>
+        <para><citetitle>dpkg utilities</citetitle>
+        (<command>dpkg-name</command>)</para>
+      </listitem>
+      <listitem>
+        <para><citetitle>User Contributed Perl Documentation</citetitle>
+        (<command>GET</command>)</para>
+      </listitem>
+      <listitem>
+        <para><citetitle>GNU Development Tools</citetitle>
+        (<command>ld</command>)</para>
+      </listitem>
+      <listitem>
+        <para><citetitle>Emperor Norton Utilities</citetitle>
+        (<command>ddate</command>)</para>
+      </listitem>
+      <listitem>
+        <para><citetitle>Debian GNU/Linux manual</citetitle>
+        (<command>faked</command>)</para>
+      </listitem>
+      <listitem>
+        <para><citetitle>GIMP Manual Pages</citetitle>
+        (<command>gimp</command>)</para>
+      </listitem>
+      <listitem>
+        <para><citetitle>KDOC Documentation System</citetitle>
+        (<command>qt2kdoc</command>)</para>
+      </listitem>
+    </itemizedlist>
+    </para>
+
+    <para>The <literal>solbook(5)</literal> man page describes
+    something very much like what <literal>man(7)</literal> calls
+    "manual", except that <literal>solbook(5)</literal> names it
+    "sectdesc" and describes it like this:
+    <blockquote>
+      <para>This is the section title of the reference page; for
+      example <literal>User Commands</literal>.</para>
+    </blockquote>
+    </para>
+
+  </refdescription>
+  <refparameter id="get.refentry.manual-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>info</term>
+        <listitem>
+          <para>A set of info nodes (from a <sgmltag>refentry</sgmltag>
+          element and its ancestors)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>prefs</term>
+        <listitem>
+          <para>A node containing users preferences (from global
+          stylesheet parameters)</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="get.refentry.manual-returns">
+    <para>Returns a <sgmltag>manual</sgmltag> node.</para>
+  </refreturn>
+</doc:template>
+<xsl:template name="get.refentry.manual">
+  <xsl:param name="refname"/>
+  <xsl:param name="info"/>
+  <xsl:param name="prefs"/>
+  <xsl:variable name="Manual">
+    <xsl:choose>
+      <!-- * if profiling is enabled for manual, and the manual -->
+      <!-- * profile is non-empty, use it -->
+      <xsl:when test="not($prefs/@profileEnabled = 0) and
+                      not($prefs/@profile = '')">
+        <xsl:call-template name="evaluate.info.profile">
+          <xsl:with-param name="profile" select="$prefs/@profile"/>
+          <xsl:with-param name="info" select="$info"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="refmeta/refmiscinfo[@class = 'manual' or @class = 'sectdesc']">
+            <xsl:apply-templates 
+                select="refmeta/refmiscinfo[@class = 'manual' or @class = 'sectdesc'][1]/node()"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <!-- * only in the case of choosing appropriate -->
+            <!-- * "manual" content do we select the furthest -->
+            <!-- * (first) matching element instead of the -->
+            <!-- * closest (last) matching one -->
+            <xsl:choose>
+              <xsl:when test="ancestor::*/title">
+                <xsl:call-template name="set.refentry.metadata">
+                  <xsl:with-param name="refname" select="$refname"/>
+                  <xsl:with-param
+                      name="info"
+                      select="(ancestor::*[title])[1]"/>
+                  <xsl:with-param
+                      name="contents"
+                      select="(ancestor::*[title])[1]/title"/>
+                  <xsl:with-param name="context">manual</xsl:with-param>
+                </xsl:call-template>
+              </xsl:when>
+              <xsl:when test="$info/title">
+                <xsl:call-template name="set.refentry.metadata">
+                  <xsl:with-param name="refname" select="$refname"/>
+                  <xsl:with-param
+                      name="info"
+                      select="($info[title])[1]"/>
+                  <xsl:with-param
+                      name="contents"
+                      select="(($info[title])[1]/title)[1]"/>
+                  <xsl:with-param name="context">manual</xsl:with-param>
+                </xsl:call-template>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:if test="$refentry.meta.get.quietly = 0">
+                  <xsl:call-template name="log.message">
+                    <xsl:with-param name="level">Note</xsl:with-param>
+                    <xsl:with-param name="source" select="$refname"/>
+                    <xsl:with-param name="context-desc">meta manual</xsl:with-param>
+                    <xsl:with-param name="message">
+                      <xsl:text>no titled ancestor of refentry</xsl:text>
+                    </xsl:with-param>
+                  </xsl:call-template>
+                  <xsl:call-template name="log.message">
+                    <xsl:with-param name="level">Note</xsl:with-param>
+                    <xsl:with-param name="source" select="$refname"/>
+                    <xsl:with-param name="context-desc">meta manual</xsl:with-param>
+                    <xsl:with-param name="message">
+                      <xsl:text>no refentry/refmeta/refmiscinfo@class=manual</xsl:text>
+                    </xsl:with-param>
+                  </xsl:call-template>
+                  <xsl:call-template name="log.message">
+                    <xsl:with-param name="level">Note</xsl:with-param>
+                    <xsl:with-param name="source" select="$refname"/>
+                    <xsl:with-param name="context-desc">meta manual</xsl:with-param>
+                    <xsl:with-param name="message">
+                      <xsl:text>see http://docbook.sf.net/el/refmiscinfo</xsl:text>
+                    </xsl:with-param>
+                  </xsl:call-template>
+                </xsl:if>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="not($Manual = '')">
+      <xsl:copy-of select="$Manual"/>
+    </xsl:when>
+    <!-- * if no Manual, use contents of specified Fallback (if any) -->
+    <xsl:when test="not($prefs/@fallback = '')">
+      <xsl:variable name="manual.fallback">
+        <xsl:call-template name="evaluate.info.profile">
+          <xsl:with-param name="profile" select="$prefs/@fallback"/>
+          <xsl:with-param name="info" select="$info"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="not($manual.fallback = '')">
+          <xsl:value-of select="$manual.fallback"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:if test="$refentry.meta.get.quietly = 0">
+            <xsl:call-template name="log.message">
+              <xsl:with-param name="level">Warn</xsl:with-param>
+              <xsl:with-param name="source" select="$refname"/>
+              <xsl:with-param name="context-desc">meta manual</xsl:with-param>
+              <xsl:with-param name="message">
+                <xsl:text>no valid fallback for manual; leaving empty</xsl:text>
+              </xsl:with-param>
+            </xsl:call-template>
+          </xsl:if>
+        </xsl:otherwise>
+      </xsl:choose>
+
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$refentry.meta.get.quietly = 0">
+        <xsl:call-template name="log.message">
+          <xsl:with-param name="level">Warn</xsl:with-param>
+          <xsl:with-param name="source" select="$refname"/>
+          <xsl:with-param name="context-desc">meta manual</xsl:with-param>
+          <xsl:with-param name="message">
+            <xsl:text>no manual fallback specified; leaving empty</xsl:text>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ====================================================================== -->
+<doc:template name="get.refentry.metadata.prefs" xmlns="">
+  <refpurpose>Gets user preferences for refentry metadata gathering</refpurpose>
+  <refdescription id="get.refentry.metadata.prefs-desc">
+    <para>The DocBook XSL stylesheets include several user-configurable
+    global stylesheet parameters for controlling <sgmltag>refentry</sgmltag>
+    metadata gathering. Those parameters are not read directly by the
+    other <sgmltag>refentry</sgmltag> metadata-gathering
+    templates. Instead, they are read only by the
+    <function>get.refentry.metadata.prefs</function> template,
+    which assembles them into a structure that is then passed to
+    the other <sgmltag>refentry</sgmltag> metadata-gathering
+    templates.</para>
+
+    <para>So the, <function>get.refentry.metadata.prefs</function>
+    template is the only interface to collecting stylesheet parameters for
+    controlling <sgmltag>refentry</sgmltag> metadata gathering.</para>
+  </refdescription>
+  <refparameter id="get.refentry.metadata.prefs-params">
+    <para>There are no local parameters for this template; however, it
+    does rely on a number of global parameters.</para>
+  </refparameter>
+  <refreturn id="get.refentry.metadata.prefs-returns">
+    <para>Returns a <sgmltag>manual</sgmltag> node.</para>
+  </refreturn>
+</doc:template>
+<xsl:template name="get.refentry.metadata.prefs">
+  <DatePrefs>
+    <xsl:attribute name="profile">
+      <xsl:value-of select="$refentry.date.profile"/>
+    </xsl:attribute>
+    <xsl:attribute name="profileEnabled">
+      <xsl:value-of select="$refentry.date.profile.enabled"/>
+    </xsl:attribute>
+  </DatePrefs>
+  <SourcePrefs>
+    <xsl:attribute name="fallback">
+      <xsl:value-of select="$refentry.source.fallback.profile"/>
+    </xsl:attribute>
+    <Name>
+      <xsl:attribute name="profile">
+        <xsl:value-of select="$refentry.source.name.profile"/>
+      </xsl:attribute>
+      <xsl:attribute name="profileEnabled">
+        <xsl:value-of select="$refentry.source.name.profile.enabled"/>
+      </xsl:attribute>
+      <xsl:attribute name="suppress">
+        <xsl:value-of select="$refentry.source.name.suppress"/>
+      </xsl:attribute>
+    </Name>
+    <Version>
+      <xsl:attribute name="profile">
+        <xsl:value-of select="$refentry.version.profile"/>
+      </xsl:attribute>
+      <xsl:attribute name="profileEnabled">
+        <xsl:value-of select="$refentry.version.profile.enabled"/>
+      </xsl:attribute>
+      <xsl:attribute name="suppress">
+        <xsl:value-of select="$refentry.version.suppress"/>
+      </xsl:attribute>
+    </Version>
+  </SourcePrefs>
+  <ManualPrefs>
+    <xsl:attribute name="fallback">
+      <xsl:value-of select="$refentry.manual.fallback.profile"/>
+    </xsl:attribute>
+    <xsl:attribute name="profile">
+      <xsl:value-of select="$refentry.manual.profile"/>
+    </xsl:attribute>
+    <xsl:attribute name="profileEnabled">
+      <xsl:value-of select="$refentry.manual.profile.enabled"/>
+    </xsl:attribute>
+  </ManualPrefs>
+</xsl:template>
+
+<!-- ====================================================================== -->
+<doc:template name="set.refentry.metadata" xmlns="">
+  <refpurpose>Sets content of a refentry metadata item</refpurpose>
+  <refdescription id="set.refentry.metadata-desc">
+    <para>The <function>set.refentry.metadata</function> template is
+    called each time a suitable source element is found for a certain
+    metadata field.</para>
+  </refdescription>
+  <refparameter id="set.refentry.metadata-params">
+    <variablelist>
+      <varlistentry>
+        <term>refname</term>
+        <listitem>
+          <para>The first <sgmltag>refname</sgmltag> in the refentry</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>info</term>
+        <listitem>
+          <para>A single *info node that contains the selected source element.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>contents</term>
+        <listitem>
+          <para>A node containing the selected source element.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>context</term>
+        <listitem>
+          <para>A string describing the metadata context in which the
+          <function>set.refentry.metadata</function> template was
+          called: either "date", "source", "version", or "manual".</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="set.refentry.metadata-returns">
+  <para>Returns formatted contents of a selected source element.</para></refreturn>
+</doc:template>
+<xsl:template name="set.refentry.metadata">
+  <xsl:param name="refname"/>
+  <xsl:param name="info"/>
+  <xsl:param name="contents"/>
+  <xsl:param name="context"/>
+  <xsl:param name="preferred"/>
+  <xsl:if test="not($preferred = '')">
+    <xsl:if test="$refentry.meta.get.quietly = 0">
+      <xsl:call-template name="log.message">
+        <xsl:with-param name="level">Note</xsl:with-param>
+        <xsl:with-param name="source" select="$refname"/>
+        <xsl:with-param name="context-desc" select="concat('meta ', $context)"/>
+        <xsl:with-param name="message" select="concat('No ', $preferred)"/>
+      </xsl:call-template>
+      <xsl:call-template name="log.message">
+        <xsl:with-param name="level">Note</xsl:with-param>
+        <xsl:with-param name="source" select="$refname"/>
+        <xsl:with-param name="context-desc" select="concat('meta ', $context)"/>
+        <xsl:with-param name="message">
+          <xsl:text>no refentry/refmeta/refmiscinfo@class=</xsl:text>
+          <xsl:value-of select="$context"/>
+        </xsl:with-param>
+      </xsl:call-template>
+      <xsl:call-template name="log.message">
+        <xsl:with-param name="level">Note</xsl:with-param>
+        <xsl:with-param name="source" select="$refname"/>
+        <xsl:with-param name="context-desc" select="concat('meta ', $context)"/>
+        <xsl:with-param name="message" select="concat('Using ', local-name($contents))"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:if>
+  <xsl:value-of select="$contents"/>
+</xsl:template>
+
+</xsl:stylesheet>

+ 367 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/stripns.xsl

@@ -0,0 +1,367 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:ng="http://docbook.org/docbook-ng"
+                xmlns:db="http://docbook.org/ns/docbook"
+                xmlns:saxon="http://icl.com/saxon"
+                xmlns:NodeInfo="http://org.apache.xalan.lib.NodeInfo"
+                xmlns:exsl="http://exslt.org/common"
+                exclude-result-prefixes="db ng exsl saxon NodeInfo"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     This file contains general templates common to both the HTML and FO
+     versions of the DocBook stylesheets.
+     ******************************************************************** -->
+
+<xsl:import href="utility.xsl"/>
+
+<!-- * 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>
+
+<!-- put an xml:base attribute on the root element -->
+<xsl:template match="/*" mode="stripNS">
+  <xsl:choose>
+    <xsl:when test="self::ng:* or self::db:*">
+      <xsl:element name="{local-name(.)}">
+        <xsl:copy-of select="@*[not(name(.) = 'xml:id')
+                                and not(name(.) = 'version')]"/>
+        <xsl:if test="@xml:id">
+          <xsl:attribute name="id">
+            <xsl:value-of select="@xml:id"/>
+          </xsl:attribute>
+        </xsl:if>
+
+        <xsl:call-template name="add-xml-base"/>
+
+        <xsl:apply-templates mode="stripNS"/>
+      </xsl:element>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy>
+        <xsl:copy-of select="@*[not(name(.) = 'xml:id')
+                                and not(name(.) = 'version')]"/>
+        <xsl:if test="@xml:id">
+          <xsl:attribute name="id">
+            <xsl:value-of select="@xml:id"/>
+          </xsl:attribute>
+        </xsl:if>
+
+        <xsl:call-template name="add-xml-base"/>
+
+        <xsl:apply-templates mode="stripNS"/>
+      </xsl:copy>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*" mode="stripNS">
+  <xsl:choose>
+    <xsl:when test="self::ng:* or self::db:*">
+      <xsl:element name="{local-name(.)}">
+        <xsl:copy-of select="@*[not(name(.) = 'xml:id')
+                                and not(name(.) = 'version')]"/>
+        <xsl:if test="@xml:id">
+          <xsl:attribute name="id">
+            <xsl:value-of select="@xml:id"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates mode="stripNS"/>
+      </xsl:element>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy>
+        <xsl:copy-of select="@*[not(name(.) = 'xml:id')
+                                and not(name(.) = 'version')]"/>
+        <xsl:if test="@xml:id">
+          <xsl:attribute name="id">
+            <xsl:value-of select="@xml:id"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates mode="stripNS"/>
+      </xsl:copy>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="db:info" mode="stripNS">
+  <xsl:variable name="info">
+    <xsl:choose>
+      <xsl:when test="parent::db:article
+                      |parent::db:appendix
+                      |parent::db:bibliography
+                      |parent::db:book
+                      |parent::db:chapter
+                      |parent::db:glossary
+                      |parent::db:index
+                      |parent::db:part
+                      |parent::db:preface
+                      |parent::db:refentry
+                      |parent::db:reference
+                      |parent::db:refsect1
+                      |parent::db:refsect2
+                      |parent::db:refsect3
+                      |parent::db:refsection
+                      |parent::db:refsynopsisdiv
+                      |parent::db:sect1
+                      |parent::db:sect2
+                      |parent::db:sect3
+                      |parent::db:sect4
+                      |parent::db:sect5
+                      |parent::db:section
+                      |parent::db:setindex
+                      |parent::db:set
+                      |parent::db:slides
+                      |parent::db:sidebar">
+        <xsl:value-of select="local-name(parent::*)"/>
+        <xsl:text>info</xsl:text>
+      </xsl:when>
+      <xsl:when test="parent::db:audioobject
+                      |parent::db:imageobject
+                      |parent::db:inlinemediaobject
+                      |parent::db:mediaobject
+                      |parent::db:mediaobjectco
+                      |parent::db:textobject
+                      |parent::db:videoobject">
+        <xsl:text>objectinfo</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>blockinfo</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:element name="{$info}">
+    <xsl:copy-of select="@*[not(name(.) = 'xml:id')
+                         and not(name(.) = 'version')]"/>
+    <xsl:if test="@xml:id">
+      <xsl:attribute name="id">
+        <xsl:value-of select="@xml:id"/>
+      </xsl:attribute>
+    </xsl:if>
+    <xsl:apply-templates mode="stripNS"/>
+  </xsl:element>
+
+  <xsl:if test="(not(../db:title) and not(../ng:title))
+                and ($info = 'prefaceinfo'
+                     or $info = 'chapterinfo'
+                     or $info = 'sectioninfo'
+                     or $info = 'sect1info'
+                     or $info = 'sect2info'
+                     or $info = 'sect3info'
+                     or $info = 'sect4info'
+                     or $info = 'sect5info'
+                     or $info = 'refsectioninfo'
+                     or $info = 'refsect1info'
+                     or $info = 'refsect2info'
+                     or $info = 'refsect3info'
+                     or $info = 'blockinfo'
+                     or $info = 'appendixinfo')">
+    <xsl:apply-templates select="db:title|ng:title" mode="stripNS"/>
+  </xsl:if>
+
+</xsl:template>
+
+<xsl:template match="ng:link|db:link" mode="stripNS">
+  <xsl:variable xmlns:xlink="http://www.w3.org/1999/xlink"
+                name="href" select="@xlink:href|@href"/>
+  <xsl:choose>
+    <xsl:when test="$href != '' and not(starts-with($href,'#'))">
+      <ulink url="{$href}">
+        <xsl:for-each select="@*">
+          <xsl:if test="local-name(.) != 'href'
+                        and name(.) != 'version'
+                        and name(.) != 'xml:id'">
+            <xsl:copy/>
+          </xsl:if>
+        </xsl:for-each>
+        <xsl:if test="@xml:id">
+          <xsl:attribute name="id">
+            <xsl:value-of select="@xml:id"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates mode="stripNS"/>
+      </ulink>
+    </xsl:when>
+    <xsl:when test="$href != '' and starts-with($href,'#')">
+      <link linkend="{substring-after($href,'#')}">
+        <xsl:for-each select="@*">
+          <xsl:if test="local-name(.) != 'href'
+                        and name(.) != 'version'
+                        and name(.) != 'xml:id'">
+            <xsl:copy/>
+          </xsl:if>
+        </xsl:for-each>
+        <xsl:if test="@xml:id">
+          <xsl:attribute name="id">
+            <xsl:value-of select="@xml:id"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates mode="stripNS"/>
+      </link>
+    </xsl:when>
+    <xsl:otherwise>
+      <link>
+        <xsl:copy-of select="@*[not(name(.) = 'xml:id')
+                             and not(name(.) = 'version')]"/>
+        <xsl:if test="@xml:id">
+          <xsl:attribute name="id">
+            <xsl:value-of select="@xml:id"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates mode="stripNS"/>
+      </link>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="ng:tag|db:tag" mode="stripNS">
+  <sgmltag>
+    <xsl:copy-of select="@*[not(name(.) = 'xml:id')
+                         and not(name(.) = 'version')]"/>
+    <xsl:apply-templates mode="stripNS"/>
+  </sgmltag>
+</xsl:template>
+
+<xsl:template match="ng:textdata|db:textdata
+                     |ng:imagedata|db:imagedata
+                     |ng:videodata|db:videodata
+                     |ng:audiodata|db:audiodata" mode="stripNS">
+  <xsl:element name="{local-name(.)}">
+    <xsl:copy-of select="@*[not(name(.) = 'xml:id')
+                            and not(name(.) = 'version')
+                            and not(name(.) = 'entityref')]"/>
+    <xsl:if test="@xml:id">
+      <xsl:attribute name="id">
+        <xsl:value-of select="@xml:id"/>
+      </xsl:attribute>
+    </xsl:if>
+
+    <xsl:choose>
+      <xsl:when test="@entityref">
+        <xsl:attribute name="fileref">
+          <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
+        </xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
+
+    <xsl:apply-templates mode="stripNS"/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template name="add-xml-base">
+  <xsl:if test="not(@xml:base)">
+    <xsl:variable name="base">
+      <xsl:choose>
+        <xsl:when test="function-available('saxon:systemId')">
+          <xsl:value-of select="saxon:systemId()"/>
+        </xsl:when>
+        <xsl:when test="function-available('NodeInfo:systemId')">
+          <xsl:value-of select="NodeInfo:systemId()"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="log.message">
+            <xsl:with-param name="level">Warn</xsl:with-param>
+            <xsl:with-param name="source" select="$doc.title"/>
+            <xsl:with-param name="context-desc">
+              <xsl:text>no @xml:base</xsl:text>
+            </xsl:with-param>
+            <xsl:with-param name="message">
+              <xsl:text>cannot add @xml:base to node-set root element</xsl:text>
+            </xsl:with-param>
+          </xsl:call-template>
+          <xsl:call-template name="log.message">
+            <xsl:with-param name="level">Warn</xsl:with-param>
+            <xsl:with-param name="source" select="$doc.title"/>
+            <xsl:with-param name="context-desc">
+              <xsl:text>no @xml:base</xsl:text>
+            </xsl:with-param>
+            <xsl:with-param name="message">
+              <xsl:text>relative paths may not work</xsl:text>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <!-- debug
+    <xsl:message>base is <xsl:value-of select="$base"/></xsl:message>
+    -->
+    <xsl:if test="$base != ''">
+      <xsl:attribute name="xml:base">
+        <xsl:call-template name="systemIdToBaseURI">
+          <xsl:with-param name="systemId">
+            <!-- file: seems to confuse some processors. -->
+            <xsl:choose>
+              <!-- however, windows paths must use file:///c:/path -->
+              <xsl:when test="starts-with($base, 'file:///') and
+                              substring($base, 10, 1) = ':'">
+                <xsl:value-of select="$base"/>
+              </xsl:when>
+              <xsl:when test="starts-with($base, 'file:/')
+                              and substring($base, 8, 1) = ':'">
+                <xsl:value-of select="concat('file:///', 
+                                      substring-after($base,'file:/'))"/>
+              </xsl:when>
+              <xsl:when test="starts-with($base, 'file:///')">
+                <xsl:value-of select="substring-after($base,'file://')"/>
+              </xsl:when>
+              <xsl:when test="starts-with($base, 'file://')">
+                <xsl:value-of select="substring-after($base,'file:/')"/>
+              </xsl:when>
+              <xsl:when test="starts-with($base, 'file:/')">
+                <xsl:value-of select="substring-after($base,'file:')"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="$base"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:attribute>
+    </xsl:if>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="systemIdToBaseURI">
+  <xsl:param name="systemId" select="''"/>
+  <xsl:if test="contains($systemId,'/')">
+    <xsl:value-of select="substring-before($systemId,'/')"/>
+    <xsl:text>/</xsl:text>
+    <xsl:call-template name="systemIdToBaseURI">
+      <xsl:with-param name="systemId"
+                      select="substring-after($systemId,'/')"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="comment()|processing-instruction()|text()" mode="stripNS">
+  <xsl:copy/>
+</xsl:template>
+
+<xsl:template match="/" priority="-1">
+  <xsl:choose>
+    <xsl:when test="(function-available('exsl:node-set') or
+                     contains(system-property('xsl:vendor'),
+                       'Apache Software Foundation'))
+                    and (*/self::ng:* or */self::db:*)">
+      <xsl:message>Stripping namespace from DocBook 5 document.</xsl:message>
+      <xsl:variable name="nons">
+        <xsl:apply-templates mode="stripNS"/>
+      </xsl:variable>
+      <xsl:message>Processing stripped document.</xsl:message>
+      <xsl:apply-templates select="exsl:node-set($nons)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="@* | node()"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 155 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/subtitles.xsl

@@ -0,0 +1,155 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                exclude-result-prefixes="doc"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<!-- subtitle markup -->
+
+<doc:mode mode="subtitle.markup" xmlns="">
+<refpurpose>Provides access to element subtitles</refpurpose>
+<refdescription id="subtitle.markup-desc">
+<para>Processing an element in the
+<literal role="mode">subtitle.markup</literal> mode produces the
+subtitle of the element.
+</para>
+</refdescription>
+</doc:mode>
+
+<xsl:template match="*" mode="subtitle.markup">
+  <xsl:message>
+    <xsl:text>Request for subtitle of unexpected element: </xsl:text>
+    <xsl:value-of select="local-name(.)"/>
+  </xsl:message>
+  <xsl:text>???SUBTITLE???</xsl:text>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="set" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(setinfo/subtitle|info/subtitle|subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="book" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(bookinfo/subtitle|info/subtitle|subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="part" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(partinfo/subtitle
+                                |docinfo/subtitle
+                                |info/subtitle
+                                |subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="preface|chapter|appendix" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(docinfo/subtitle
+                                |info/subtitle
+                                |prefaceinfo/subtitle
+                                |chapterinfo/subtitle
+                                |appendixinfo/subtitle
+                                |subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="article" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(artheader/subtitle
+                                |articleinfo/subtitle
+                                |info/subtitle
+                                |subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="dedication|colophon" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(subtitle|info/subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="reference" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(referenceinfo/subtitle
+                                |docinfo/subtitle
+                                |info/subtitle
+                                |subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="qandaset" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(blockinfo/subtitle|info/subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="refentry" mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(refentryinfo/subtitle
+                                |info/subtitle
+                                |docinfo/subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="section
+                     |sect1|sect2|sect3|sect4|sect5
+                     |refsect1|refsect2|refsect3
+                     |simplesect"
+              mode="subtitle.markup">
+  <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:apply-templates select="(info/subtitle
+                                |sectioninfo/subtitle
+                                |sect1info/subtitle
+                                |sect2info/subtitle
+                                |sect3info/subtitle
+                                |sect4info/subtitle
+                                |sect5info/subtitle
+                                |refsect1info/subtitle
+                                |refsect2info/subtitle
+                                |refsect3info/subtitle
+                                |subtitle)[1]"
+                       mode="subtitle.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 514 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/table.xsl

@@ -0,0 +1,514 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                exclude-result-prefixes="doc"
+                version="1.0">
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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="blank.spans">
+  <xsl:param name="cols" select="1"/>
+  <xsl:if test="$cols &gt; 0">
+    <xsl:text>0:</xsl:text>
+    <xsl:call-template name="blank.spans">
+      <xsl:with-param name="cols" select="$cols - 1"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="calculate.following.spans">
+  <xsl:param name="colspan" select="1"/>
+  <xsl:param name="spans" select="''"/>
+
+  <xsl:choose>
+    <xsl:when test="$colspan &gt; 0">
+      <xsl:call-template name="calculate.following.spans">
+        <xsl:with-param name="colspan" select="$colspan - 1"/>
+        <xsl:with-param name="spans" select="substring-after($spans,':')"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$spans"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="finaltd">
+  <xsl:param name="spans"/>
+  <xsl:param name="col" select="0"/>
+
+  <xsl:if test="$spans != ''">
+    <xsl:choose>
+      <xsl:when test="starts-with($spans,'0:')">
+        <xsl:call-template name="empty.table.cell">
+          <xsl:with-param name="colnum" select="$col"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise></xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:call-template name="finaltd">
+      <xsl:with-param name="spans" select="substring-after($spans,':')"/>
+      <xsl:with-param name="col" select="$col+1"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="sfinaltd">
+  <xsl:param name="spans"/>
+
+  <xsl:if test="$spans != ''">
+    <xsl:choose>
+      <xsl:when test="starts-with($spans,'0:')">0:</xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="substring-before($spans,':')-1"/>
+        <xsl:text>:</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:call-template name="sfinaltd">
+      <xsl:with-param name="spans" select="substring-after($spans,':')"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="entry.colnum">
+  <xsl:param name="entry" select="."/>
+
+  <xsl:choose>
+    <xsl:when test="$entry/@spanname">
+      <xsl:variable name="spanname" select="$entry/@spanname"/>
+      <xsl:variable name="spanspec"
+                    select="($entry/ancestor::tgroup/spanspec[@spanname=$spanname]
+                             |$entry/ancestor::entrytbl/spanspec[@spanname=$spanname])[last()]"/>
+      <xsl:variable name="colspec"
+                    select="($entry/ancestor::tgroup/colspec[@colname=$spanspec/@namest]
+                             |$entry/ancestor::entrytbl/colspec[@colname=$spanspec/@namest])[last()]"/>
+      <xsl:call-template name="colspec.colnum">
+        <xsl:with-param name="colspec" select="$colspec"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$entry/@colname">
+      <xsl:variable name="colname" select="$entry/@colname"/>
+      <xsl:variable name="colspec"
+                    select="($entry/ancestor::tgroup/colspec[@colname=$colname]
+                             |$entry/ancestor::entrytbl/colspec[@colname=$colname])[last()]"/>
+      <xsl:call-template name="colspec.colnum">
+        <xsl:with-param name="colspec" select="$colspec"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$entry/@namest">
+      <xsl:variable name="namest" select="$entry/@namest"/>
+      <xsl:variable name="colspec"
+                    select="($entry/ancestor::tgroup/colspec[@colname=$namest]
+                             |$entry/ancestor::entrytbl/colspec[@colname=$namest])[last()]"/>
+      <xsl:call-template name="colspec.colnum">
+        <xsl:with-param name="colspec" select="$colspec"/>
+      </xsl:call-template>
+    </xsl:when>
+    <!-- no idea, return 0 -->
+    <xsl:otherwise>0</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<doc:template name="entry.colnum" xmlns="">
+<refpurpose>Determine the column number in which a given entry occurs</refpurpose>
+<refdescription id="entry.colnum-desc">
+<para>If an <sgmltag>entry</sgmltag> has a
+<sgmltag class="attribute">colname</sgmltag> or
+<sgmltag class="attribute">namest</sgmltag> attribute, this template
+will determine the number of the column in which the entry should occur.
+For other <sgmltag>entry</sgmltag>s, nothing is returned.</para>
+</refdescription>
+<refparameter id="entry.colnum-params">
+<variablelist>
+<varlistentry><term>entry</term>
+<listitem>
+<para>The <sgmltag>entry</sgmltag>-element which is to be tested.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn id="entry.colnum-returns">
+<para>This template returns the column number if it can be determined,
+or 0 (the empty string)</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="colspec.colnum">
+  <xsl:param name="colspec" select="."/>
+  <xsl:choose>
+    <xsl:when test="$colspec/@colnum">
+      <xsl:value-of select="$colspec/@colnum"/>
+    </xsl:when>
+    <xsl:when test="$colspec/preceding-sibling::colspec">
+      <xsl:variable name="prec.colspec.colnum">
+        <xsl:call-template name="colspec.colnum">
+          <xsl:with-param name="colspec"
+                          select="$colspec/preceding-sibling::colspec[1]"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:value-of select="$prec.colspec.colnum + 1"/>
+    </xsl:when>
+    <xsl:otherwise>1</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="calculate.colspan">
+  <xsl:param name="entry" select="."/>
+  <xsl:variable name="spanname" select="$entry/@spanname"/>
+  <xsl:variable name="spanspec"
+                select="($entry/ancestor::tgroup/spanspec[@spanname=$spanname]
+                         |$entry/ancestor::entrytbl/spanspec[@spanname=$spanname])[last()]"/>
+
+  <xsl:variable name="namest">
+    <xsl:choose>
+      <xsl:when test="@spanname">
+        <xsl:value-of select="$spanspec/@namest"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$entry/@namest"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="nameend">
+    <xsl:choose>
+      <xsl:when test="@spanname">
+        <xsl:value-of select="$spanspec/@nameend"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$entry/@nameend"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="scol">
+    <xsl:call-template name="colspec.colnum">
+      <xsl:with-param name="colspec"
+                      select="($entry/ancestor::tgroup/colspec[@colname=$namest]
+                               |$entry/ancestor::entrytbl/colspec[@colname=$namest])[last()]"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="ecol">
+    <xsl:call-template name="colspec.colnum">
+      <xsl:with-param name="colspec"
+                      select="($entry/ancestor::tgroup/colspec[@colname=$nameend]
+                               |$entry/ancestor::entrytbl/colspec[@colname=$nameend])[last()]"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$namest != '' and $nameend != ''">
+      <xsl:choose>
+        <xsl:when test="number($ecol) &gt;= number($scol)">
+          <xsl:value-of select="number($ecol) - number($scol) + 1"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="number($scol) - number($ecol) + 1"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>1</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="calculate.rowsep">
+  <xsl:param name="entry" select="."/>
+  <xsl:param name="colnum" select="0"/>
+
+  <xsl:call-template name="inherited.table.attribute">
+    <xsl:with-param name="entry" select="$entry"/>
+    <xsl:with-param name="colnum" select="$colnum"/>
+    <xsl:with-param name="attribute" select="'rowsep'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="calculate.colsep">
+  <xsl:param name="entry" select="."/>
+  <xsl:param name="colnum" select="0"/>
+
+  <xsl:call-template name="inherited.table.attribute">
+    <xsl:with-param name="entry" select="$entry"/>
+    <xsl:with-param name="colnum" select="$colnum"/>
+    <xsl:with-param name="attribute" select="'colsep'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="inherited.table.attribute">
+  <xsl:param name="entry" select="."/>
+  <xsl:param name="row" select="$entry/ancestor-or-self::row[1]"/>
+  <xsl:param name="colnum" select="0"/>
+  <xsl:param name="attribute" select="'colsep'"/>
+
+  <xsl:variable name="tgroup" select="$row/parent::*/parent::tgroup[1]"/>
+  <xsl:variable name="tbody" select="$row/parent::*[1]"/>
+
+  <xsl:variable name="table" select="($tgroup/ancestor::table
+                                     |$tgroup/ancestor::informaltable
+				     |$entry/ancestor::entrytbl)[last()]"/>
+
+  <xsl:variable name="entry.value">
+    <xsl:call-template name="get-attribute">
+      <xsl:with-param name="element" select="$entry"/>
+      <xsl:with-param name="attribute" select="$attribute"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="row.value">
+    <xsl:call-template name="get-attribute">
+      <xsl:with-param name="element" select="$row"/>
+      <xsl:with-param name="attribute" select="$attribute"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="span.value">
+    <xsl:if test="$entry/@spanname">
+      <xsl:variable name="spanname" select="$entry/@spanname"/>
+      <xsl:variable name="spanspec"
+                    select="$tgroup/spanspec[@spanname=$spanname]"/>
+      <xsl:variable name="span.colspec"
+                    select="$tgroup/colspec[@colname=$spanspec/@namest]"/>
+
+      <xsl:variable name="spanspec.value">
+        <xsl:call-template name="get-attribute">
+          <xsl:with-param name="element" select="$spanspec"/>
+          <xsl:with-param name="attribute" select="$attribute"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="scolspec.value">
+        <xsl:call-template name="get-attribute">
+          <xsl:with-param name="element" select="$span.colspec"/>
+          <xsl:with-param name="attribute" select="$attribute"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$spanspec.value != ''">
+          <xsl:value-of select="$spanspec.value"/>
+        </xsl:when>
+        <xsl:when test="$scolspec.value != ''">
+          <xsl:value-of select="$scolspec.value"/>
+        </xsl:when>
+        <xsl:otherwise></xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="namest.value">
+    <xsl:if test="$entry/@namest">
+      <xsl:variable name="namest" select="$entry/@namest"/>
+      <xsl:variable name="colspec"
+                    select="$tgroup/colspec[@colname=$namest]"/>
+
+      <xsl:variable name="inner.namest.value">
+        <xsl:call-template name="get-attribute">
+          <xsl:with-param name="element" select="$colspec"/>
+          <xsl:with-param name="attribute" select="$attribute"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$inner.namest.value">
+          <xsl:value-of select="$inner.namest.value"/>
+        </xsl:when>
+        <xsl:otherwise></xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="tgroup.value">
+    <xsl:call-template name="get-attribute">
+      <xsl:with-param name="element" select="$tgroup"/>
+      <xsl:with-param name="attribute" select="$attribute"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="tbody.value">
+    <xsl:call-template name="get-attribute">
+      <xsl:with-param name="element" select="$tbody"/>
+      <xsl:with-param name="attribute" select="$attribute"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="table.value">
+    <xsl:call-template name="get-attribute">
+      <xsl:with-param name="element" select="$table"/>
+      <xsl:with-param name="attribute" select="$attribute"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="default.value">
+    <!-- This section used to say that rowsep and colsep have defaults based -->
+    <!-- on the frame setting. Further reflection and closer examination of the -->
+    <!-- CALS spec reveals I was mistaken. The default is "1" for rowsep and colsep. -->
+    <!-- For everything else, the default is the tgroup value -->
+    <xsl:choose>
+      <xsl:when test="$tgroup.value != ''">
+        <xsl:value-of select="$tgroup.value"/>
+      </xsl:when>
+      <xsl:when test="$attribute = 'rowsep'">1</xsl:when>
+      <xsl:when test="$attribute = 'colsep'">1</xsl:when>
+      <xsl:otherwise><!-- empty --></xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="calc.colvalue">
+    <xsl:if test="$colnum &gt; 0">
+      <xsl:call-template name="colnum.colspec">
+        <xsl:with-param name="colnum" select="$colnum"/>
+        <xsl:with-param name="attribute" select="$attribute"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$entry.value != ''">
+      <xsl:value-of select="$entry.value"/>
+    </xsl:when>
+    <xsl:when test="$row.value != ''">
+      <xsl:value-of select="$row.value"/>
+    </xsl:when>
+    <xsl:when test="$span.value != ''">
+      <xsl:value-of select="$span.value"/>
+    </xsl:when>
+    <xsl:when test="$namest.value != ''">
+      <xsl:value-of select="$namest.value"/>
+    </xsl:when>
+    <xsl:when test="$calc.colvalue != ''">
+      <xsl:value-of select="$calc.colvalue"/>
+    </xsl:when>
+    <xsl:when test="$tbody.value != ''">
+      <xsl:value-of select="$tbody.value"/>
+    </xsl:when>
+    <xsl:when test="$tgroup.value != ''">
+      <xsl:value-of select="$tgroup.value"/>
+    </xsl:when>
+    <xsl:when test="$table.value != ''">
+      <xsl:value-of select="$table.value"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$default.value"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="colnum.colspec">
+  <xsl:param name="colnum" select="0"/>
+  <xsl:param name="attribute" select="'colname'"/>
+  <xsl:param name="colspec.ancestor" 
+             select="(ancestor::tgroup|ancestor::entrytbl)
+	             [position() = last()]"/>
+  <xsl:param name="colspecs" select="$colspec.ancestor/colspec"/>
+  <xsl:param name="count" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="not($colspecs) or $count &gt; $colnum">
+      <!-- nop -->
+    </xsl:when>
+    <xsl:when test="$colspecs[1]/@colnum">
+      <xsl:choose>
+        <xsl:when test="$colspecs[1]/@colnum = $colnum">
+          <xsl:call-template name="get-attribute">
+            <xsl:with-param name="element" select="$colspecs[1]"/>
+            <xsl:with-param name="attribute" select="$attribute"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="colnum.colspec">
+            <xsl:with-param name="colnum" select="$colnum"/>
+            <xsl:with-param name="attribute" select="$attribute"/>
+            <xsl:with-param name="colspecs"
+                            select="$colspecs[position()&gt;1]"/>
+            <xsl:with-param name="count"
+                            select="$colspecs[1]/@colnum+1"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$count = $colnum">
+          <xsl:call-template name="get-attribute">
+            <xsl:with-param name="element" select="$colspecs[1]"/>
+            <xsl:with-param name="attribute" select="$attribute"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="colnum.colspec">
+            <xsl:with-param name="colnum" select="$colnum"/>
+            <xsl:with-param name="attribute" select="$attribute"/>
+            <xsl:with-param name="colspecs"
+                            select="$colspecs[position()&gt;1]"/>
+            <xsl:with-param name="count" select="$count+1"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="get-attribute">
+  <xsl:param name="element" select="."/>
+  <xsl:param name="attribute" select="''"/>
+
+  <xsl:for-each select="$element/@*">
+    <xsl:if test="local-name(.) = $attribute">
+      <xsl:value-of select="."/>
+    </xsl:if>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="consume-row">
+  <xsl:param name="spans"/>
+
+  <xsl:if test="contains($spans,':')">
+    <xsl:value-of select="substring-before($spans,':') - 1"/>
+    <xsl:text>:</xsl:text>
+    <xsl:call-template name="consume-row">
+      <xsl:with-param name="spans" select="substring-after($spans,':')"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<!-- Returns the table style for the context element -->
+<xsl:template name="tabstyle">
+  <xsl:param name="node" select="."/>
+
+  <xsl:variable name="tgroup" select="$node/tgroup[1] | 
+                                      $node/ancestor-or-self::tgroup[1]"/>
+
+  <xsl:variable name="table" 
+                select="($node/ancestor-or-self::table | 
+                         $node/ancestor-or-self::informaltable)[1]"/>
+
+  <xsl:variable name="tabstyle">
+    <xsl:choose>
+      <xsl:when test="$table/@tabstyle != ''">
+        <xsl:value-of select="normalize-space($table/@tabstyle)"/>
+      </xsl:when>
+      <xsl:when test="$tgroup/@tgroupstyle != ''">
+        <xsl:value-of select="normalize-space($tgroup/@tgroupstyle)"/>
+      </xsl:when>
+      <xsl:otherwise>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:value-of select="$tabstyle"/>
+</xsl:template>
+
+</xsl:stylesheet>

+ 49 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/targetdatabase.dtd

@@ -0,0 +1,49 @@
+<!-- targetdatabase.dtd -->
+<!-- A DTD for managing cross reference target information -->
+
+<!ELEMENT targetset (targetsetinfo?, sitemap*, document*) >
+
+<!ELEMENT targetsetinfo ANY >
+
+<!ELEMENT sitemap (dir) >
+
+<!ELEMENT dir ((dir|document)*) >
+<!ATTLIST dir
+        name      CDATA   #REQUIRED
+>
+
+<!ELEMENT document (div*) >
+<!ATTLIST document
+        targetdoc CDATA   #REQUIRED
+        uri       CDATA   #IMPLIED
+        baseuri   CDATA   #IMPLIED
+        href      CDATA   #IMPLIED
+        dir       CDATA   #IMPLIED
+>
+
+<!ELEMENT div (ttl?, objttl?, xreftext?, (div|obj)*)>
+<!ATTLIST div
+        targetptr  CDATA   #IMPLIED
+        element   CDATA   #IMPLIED
+        name      CDATA   #IMPLIED
+        number    CDATA   #IMPLIED
+        href      CDATA   #IMPLIED
+        lang      CDATA   #IMPLIED
+        page      CDATA   #IMPLIED
+>
+        
+        
+<!ELEMENT ttl ANY >
+<!ELEMENT objttl ANY >
+<!ELEMENT xreftext ANY >
+
+<!ELEMENT obj (ttl?, objttl?, xreftext?)>
+<!ATTLIST obj
+        targetptr  CDATA   #IMPLIED
+        element   CDATA   #IMPLIED
+        name      CDATA   #IMPLIED
+        number    CDATA   #IMPLIED
+        href      CDATA   #IMPLIED
+        lang      CDATA   #IMPLIED
+        page      CDATA   #IMPLIED
+>

+ 272 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/targets.xsl

@@ -0,0 +1,272 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                exclude-result-prefixes="doc"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<!-- cross reference target collection  -->
+
+<doc:mode mode="collect.targets" xmlns="">
+<refpurpose>Collects information for potential cross reference targets</refpurpose>
+<refdescription id="collect.targets-desc">
+<para>Processing the root element in the
+<literal role="mode">collect.targets</literal> mode produces 
+a set of target database elements that can be used by
+the olink mechanism to resolve external cross references.
+The collection process is controlled by the <literal>
+collect.xref.targets</literal> parameter, which can be
+<literal>yes</literal> to collect targets and process
+the document for output, <literal>only</literal> to
+only collect the targets, and <literal>no</literal>
+(default) to not collect the targets and only process the document.
+</para>
+<para>
+A <literal>targets.filename</literal> parameter must be
+specified to receive the output if 
+<literal>collect.xref.targets</literal> is
+set to <literal>yes</literal> so as to
+redirect the target data to a file separate from the
+document output.
+</para>
+</refdescription>
+</doc:mode>
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="collect.targets">
+  <xsl:choose>
+    <xsl:when test="$collect.xref.targets = 'yes' and $targets.filename = ''">
+      <xsl:message>
+        Must specify a $targets.filename parameter when
+        $collect.xref.targets is set to 'yes'.
+        The xref targets were not collected.
+      </xsl:message>
+    </xsl:when> 
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$targets.filename">
+          <xsl:call-template name="write.chunk">
+            <xsl:with-param name="filename" select="$targets.filename"/>
+            <xsl:with-param name="method" select="'xml'"/>
+            <xsl:with-param name="encoding" select="'utf-8'"/>
+            <xsl:with-param name="omit-xml-declaration" select="'yes'"/>
+            <xsl:with-param name="doctype-public" select="''"/>
+            <xsl:with-param name="doctype-system" select="''"/>
+            <xsl:with-param name="indent" select="'no'"/>
+            <xsl:with-param name="quiet" select="0"/>
+            <xsl:with-param name="content">
+              <xsl:apply-templates select="." mode="olink.mode"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <!-- Else write to standard output -->
+          <xsl:apply-templates select="." mode="olink.mode"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="olink.href.target">
+  <xsl:param name="nd" select="."/>
+
+  <xsl:value-of select="$olink.base.uri"/>
+  <xsl:call-template name="href.target">
+    <xsl:with-param name="object" select="$nd"/>
+    <xsl:with-param name="context" select="NOTANODE"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- Templates for extracting cross reference information
+     from a document for use in an xref database.
+-->
+
+<xsl:template name="attrs">
+  <xsl:param name="nd" select="."/>
+
+  <xsl:attribute name="element">
+    <xsl:value-of select="local-name(.)"/>
+  </xsl:attribute>
+
+  <xsl:attribute name="href">
+    <xsl:call-template name="olink.href.target">
+      <xsl:with-param name="nd" select="$nd"/>
+    </xsl:call-template>
+  </xsl:attribute>
+
+  <xsl:variable name="num">
+    <xsl:apply-templates select="$nd" mode="label.markup">
+      <xsl:with-param name="verbose" select="0"/>
+    </xsl:apply-templates>
+  </xsl:variable>
+
+  <xsl:if test="$num">
+    <xsl:attribute name="number">
+      <xsl:value-of select="$num"/>
+    </xsl:attribute>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="$nd/@id">
+      <xsl:attribute name="targetptr">
+        <xsl:value-of select="$nd/@id"/>
+      </xsl:attribute>
+    </xsl:when>
+    <xsl:when test="$nd/@xml:id">
+      <xsl:attribute name="targetptr">
+        <xsl:value-of select="$nd/@xml:id"/>
+      </xsl:attribute>
+    </xsl:when>
+  </xsl:choose>
+
+  <xsl:if test="$nd/@lang">
+    <xsl:attribute name="lang">
+      <xsl:value-of select="$nd/@lang"/>
+    </xsl:attribute>
+  </xsl:if>
+
+</xsl:template>
+
+<xsl:template name="div">
+  <xsl:param name="nd" select="."/>
+
+  <div>
+    <xsl:call-template name="attrs">
+      <xsl:with-param name="nd" select="$nd"/>
+    </xsl:call-template>
+    <ttl>
+      <xsl:apply-templates select="$nd" mode="title.markup">
+        <xsl:with-param name="verbose" select="0"/>
+      </xsl:apply-templates>
+    </ttl>
+    <xreftext>
+      <xsl:choose>
+        <xsl:when test="$nd/@xreflabel">
+          <xsl:call-template name="xref.xreflabel">
+            <xsl:with-param name="target" select="$nd"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="$nd" mode="xref-to">
+            <xsl:with-param name="verbose" select="0"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xreftext>
+    <xsl:apply-templates mode="olink.mode"/>
+  </div>
+</xsl:template>
+
+<xsl:template name="obj">
+  <xsl:param name="nd" select="."/>
+
+  <obj>
+    <xsl:call-template name="attrs">
+      <xsl:with-param name="nd" select="$nd"/>
+    </xsl:call-template>
+    <ttl>
+      <xsl:apply-templates select="$nd" mode="title.markup">
+        <xsl:with-param name="verbose" select="0"/>
+      </xsl:apply-templates>
+    </ttl>
+    <xreftext>
+      <xsl:choose>
+        <xsl:when test="$nd/@xreflabel">
+          <xsl:call-template name="xref.xreflabel">
+            <xsl:with-param name="target" select="$nd"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="$nd" mode="xref-to">
+            <xsl:with-param name="verbose" select="0"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xreftext>
+  </obj>
+</xsl:template>
+
+<xsl:template match="text()|processing-instruction()|comment()"
+              mode="olink.mode">
+  <!-- nop -->
+</xsl:template>
+
+<!--
+<xsl:template match="*" mode="olink.mode">
+</xsl:template>
+-->
+
+<xsl:template match="set" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="book" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="preface|chapter|appendix" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="part|reference" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="article" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="bibliography|bibliodiv" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="biblioentry|bibliomixed" mode="olink.mode">
+  <xsl:call-template name="obj"/>
+</xsl:template>
+
+<xsl:template match="refentry" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="section|sect1|sect2|sect3|sect4|sect5" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="refsection|refsect1|refsect2|refsect3" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="figure|example|table" mode="olink.mode">
+  <xsl:call-template name="obj"/>
+  <xsl:apply-templates mode="olink.mode"/>
+</xsl:template>
+
+<xsl:template match="equation[title or info/title]" mode="olink.mode">
+  <xsl:call-template name="obj"/>
+</xsl:template>
+
+<xsl:template match="qandaset|qandaentry" mode="olink.mode">
+  <xsl:call-template name="div"/>
+</xsl:template>
+
+<xsl:template match="*" mode="olink.mode">
+  <xsl:if test="@id or @xml:id">
+    <xsl:call-template name="obj"/>
+  </xsl:if> 
+  <xsl:apply-templates mode="olink.mode"/>
+</xsl:template>
+
+</xsl:stylesheet>

+ 740 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/titles.xsl

@@ -0,0 +1,740 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                exclude-result-prefixes="doc"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<!-- title markup -->
+
+<doc:mode mode="title.markup" xmlns="">
+<refpurpose>Provides access to element titles</refpurpose>
+<refdescription id="title.markup-desc">
+<para>Processing an element in the
+<literal role="mode">title.markup</literal> mode produces the
+title of the element. This does not include the label.
+</para>
+</refdescription>
+</doc:mode>
+
+<xsl:template match="*" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:param name="verbose" select="1"/>
+  <xsl:choose>
+    <!-- * FIXME: this should handle other *info elements as well -->
+    <!-- * but this is good enough for now. -->
+    <xsl:when test="title|info/title">
+      <xsl:apply-templates select="title[1]|info/title[1]" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="local-name(.) = 'partintro'">
+      <!-- partintro's don't have titles, use the parent (part or reference)
+           title instead. -->
+      <xsl:apply-templates select="parent::*" mode="title.markup"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$verbose != 0">
+        <xsl:message>
+          <xsl:text>Request for title of element with no title: </xsl:text>
+          <xsl:value-of select="local-name(.)"/>
+          <xsl:choose>
+            <xsl:when test="@id">
+              <xsl:text> (id="</xsl:text>
+              <xsl:value-of select="@id"/>
+              <xsl:text>")</xsl:text>
+            </xsl:when>
+            <xsl:when test="@xml:id">
+              <xsl:text> (xml:id="</xsl:text>
+              <xsl:value-of select="@xml:id"/>
+              <xsl:text>")</xsl:text>
+            </xsl:when>
+          </xsl:choose>
+        </xsl:message>
+      </xsl:if>
+      <xsl:text>???TITLE???</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="title" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+
+  <xsl:choose>
+    <xsl:when test="$allow-anchors != 0">
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="no.anchor.mode"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- only occurs in HTML Tables! -->
+<xsl:template match="caption" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+
+  <xsl:choose>
+    <xsl:when test="$allow-anchors != 0">
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="no.anchor.mode"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="set" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="(setinfo/title|info/title|title)[1]"
+                       mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="book" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="(bookinfo/title|info/title|title)[1]"
+                       mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="part" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="(partinfo/title|info/title|docinfo/title|title)[1]"
+                       mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="preface|chapter|appendix" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+
+<!--
+  <xsl:message>
+    <xsl:value-of select="local-name(.)"/>
+    <xsl:text> </xsl:text>
+    <xsl:value-of select="$allow-anchors"/>
+  </xsl:message>
+-->
+
+  <xsl:variable name="title" select="(docinfo/title
+                                      |info/title
+                                      |prefaceinfo/title
+                                      |chapterinfo/title
+                                      |appendixinfo/title
+                                      |title)[1]"/>
+  <xsl:apply-templates select="$title" mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="dedication" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:choose>
+    <xsl:when test="title">
+      <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Dedication'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="colophon" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:choose>
+    <xsl:when test="title">
+      <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Colophon'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="article" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(artheader/title
+                                      |articleinfo/title
+                                      |info/title
+                                      |title)[1]"/>
+
+  <xsl:apply-templates select="$title" mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="reference" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="(referenceinfo/title|docinfo/title|info/title|title)[1]"
+                       mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="refentry" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="refmeta" select=".//refmeta"/>
+  <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
+  <xsl:variable name="refnamediv" select=".//refnamediv"/>
+  <xsl:variable name="refname" select="$refnamediv//refname"/>
+  <xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
+
+  <xsl:variable name="title">
+    <xsl:choose>
+      <xsl:when test="$refentrytitle">
+        <xsl:apply-templates select="$refentrytitle[1]" mode="title.markup"/>
+      </xsl:when>
+      <xsl:when test="$refdesc">
+        <xsl:apply-templates select="$refdesc" mode="title.markup"/>
+      </xsl:when>
+      <xsl:when test="$refname">
+        <xsl:apply-templates select="$refname[1]" mode="title.markup"/>
+      </xsl:when>
+      <xsl:otherwise>REFENTRY WITHOUT TITLE???</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:copy-of select="$title"/>
+</xsl:template>
+
+<xsl:template match="refentrytitle|refname|refdescriptor" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:choose>
+    <xsl:when test="$allow-anchors != 0">
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="no.anchor.mode"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="section
+                     |sect1|sect2|sect3|sect4|sect5
+                     |refsect1|refsect2|refsect3|refsection
+                     |simplesect"
+              mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(info/title
+                                      |sectioninfo/title
+                                      |sect1info/title
+                                      |sect2info/title
+                                      |sect3info/title
+                                      |sect4info/title
+                                      |sect5info/title
+                                      |refsect1info/title
+                                      |refsect2info/title
+                                      |refsect3info/title
+                                      |refsectioninfo/title
+                                      |title)[1]"/>
+
+  <xsl:apply-templates select="$title" mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="bridgehead" mode="title.markup">
+  <xsl:apply-templates mode="title.markup"/>
+</xsl:template>
+
+<xsl:template match="refsynopsisdiv" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:choose>
+    <xsl:when test="title">
+      <xsl:apply-templates select="title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="bibliography" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(bibliographyinfo/title|info/title|title)[1]"/>
+  <xsl:choose>
+    <xsl:when test="$title">
+      <xsl:apply-templates select="$title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Bibliography'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="glossary" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(glossaryinfo/title|info/title|title)[1]"/>
+  <xsl:choose>
+    <xsl:when test="$title">
+      <xsl:apply-templates select="$title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext.element.name">
+        <xsl:with-param name="element.name" select="local-name(.)"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="glossdiv" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(info/title|title)[1]"/>
+  <xsl:choose>
+    <xsl:when test="$title">
+      <xsl:apply-templates select="$title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>ERROR: glossdiv missing its required title</xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="glossentry" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="glossterm" mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="glossterm" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+
+  <xsl:choose>
+    <xsl:when test="$allow-anchors != 0">
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="no.anchor.mode"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="index" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(indexinfo/title|info/title|title)[1]"/>
+  <xsl:choose>
+    <xsl:when test="$title">
+      <xsl:apply-templates select="$title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Index'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="setindex" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(setindexinfo/title|info/title|title)[1]"/>
+  <xsl:choose>
+    <xsl:when test="$title">
+      <xsl:apply-templates select="$title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'SetIndex'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="figure|example|equation" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="title|info/title" mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="table" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="(title|caption)[1]" mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="procedure" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="title" mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="task" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="title" mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="sidebar" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:apply-templates select="(info/title|sidebarinfo/title|title)[1]"
+                       mode="title.markup">
+    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="abstract" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:choose>
+    <xsl:when test="title|info/title">
+      <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Abstract'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="caution|tip|warning|important|note" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(title|info/title)[1]"/>
+  <xsl:choose>
+    <xsl:when test="$title">
+      <xsl:apply-templates select="$title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key">
+          <xsl:choose>
+            <xsl:when test="local-name(.)='note'">Note</xsl:when>
+            <xsl:when test="local-name(.)='important'">Important</xsl:when>
+            <xsl:when test="local-name(.)='caution'">Caution</xsl:when>
+            <xsl:when test="local-name(.)='warning'">Warning</xsl:when>
+            <xsl:when test="local-name(.)='tip'">Tip</xsl:when>
+          </xsl:choose>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="question" mode="title.markup">
+  <!-- questions don't have titles -->
+  <xsl:text>Question</xsl:text>
+</xsl:template>
+
+<xsl:template match="answer" mode="title.markup">
+  <!-- answers don't have titles -->
+  <xsl:text>Answer</xsl:text>
+</xsl:template>
+
+<xsl:template match="qandaentry" mode="title.markup">
+  <!-- qandaentrys are represented by the first question in them -->
+  <xsl:text>Question</xsl:text>
+</xsl:template>
+
+<xsl:template match="qandaset" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:variable name="title" select="(info/title|
+                                      blockinfo/title|
+                                      title)[1]"/>
+  <xsl:choose>
+    <xsl:when test="$title">
+      <xsl:apply-templates select="$title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'QandASet'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:choose>
+    <xsl:when test="title">
+      <xsl:apply-templates select="title" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'LegalNotice'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="titleabbrev.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="titleabbrev">
+      <xsl:apply-templates select="titleabbrev[1]" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+        <xsl:with-param name="verbose" select="$verbose"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="book|preface|chapter|appendix" mode="titleabbrev.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:variable name="titleabbrev" select="(docinfo/titleabbrev
+                                           |bookinfo/titleabbrev
+                                           |info/titleabbrev
+                                           |prefaceinfo/titleabbrev
+                                           |chapterinfo/titleabbrev
+                                           |appendixinfo/titleabbrev
+                                           |titleabbrev)[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="$titleabbrev">
+      <xsl:apply-templates select="$titleabbrev" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+        <xsl:with-param name="verbose" select="$verbose"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="article" mode="titleabbrev.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:variable name="titleabbrev" select="(artheader/titleabbrev
+                                           |articleinfo/titleabbrev
+                                           |info/titleabbrev
+                                           |titleabbrev)[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="$titleabbrev">
+      <xsl:apply-templates select="$titleabbrev" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+        <xsl:with-param name="verbose" select="$verbose"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="section
+                     |sect1|sect2|sect3|sect4|sect5
+                     |refsect1|refsect2|refsect3
+                     |simplesect"
+              mode="titleabbrev.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:variable name="titleabbrev" select="(info/titleabbrev
+                                            |sectioninfo/titleabbrev
+                                            |sect1info/titleabbrev
+                                            |sect2info/titleabbrev
+                                            |sect3info/titleabbrev
+                                            |sect4info/titleabbrev
+                                            |sect5info/titleabbrev
+                                            |refsect1info/titleabbrev
+                                            |refsect2info/titleabbrev
+                                            |refsect3info/titleabbrev
+                                            |titleabbrev)[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="$titleabbrev">
+      <xsl:apply-templates select="$titleabbrev" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+        <xsl:with-param name="verbose" select="$verbose"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="titleabbrev" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+
+  <xsl:choose>
+    <xsl:when test="$allow-anchors != 0">
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="no.anchor.mode"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+<xsl:template match="*" mode="no.anchor.mode">
+  <!-- Switch to normal mode if no links -->
+  <xsl:choose>
+    <xsl:when test="descendant-or-self::footnote or
+                    descendant-or-self::anchor or
+                    descendant-or-self::ulink or
+                    descendant-or-self::link or
+                    descendant-or-self::olink or
+                    descendant-or-self::xref or
+                    descendant-or-self::indexterm">
+
+      <xsl:apply-templates mode="no.anchor.mode"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="."/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="footnote" mode="no.anchor.mode">
+  <!-- nop, suppressed -->
+</xsl:template>
+
+<xsl:template match="anchor" mode="no.anchor.mode">
+  <!-- nop, suppressed -->
+</xsl:template>
+
+<xsl:template match="ulink" mode="no.anchor.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="link" mode="no.anchor.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="olink" mode="no.anchor.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="no.anchor.mode">
+  <!-- nop, suppressed -->
+</xsl:template>
+
+<xsl:template match="xref" mode="no.anchor.mode">
+  <xsl:variable name="targets" select="key('id',@linkend)"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+  <xsl:variable name="refelem" select="local-name($target)"/>
+  
+  <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>XRef to nonexistent id: </xsl:text>
+        <xsl:value-of select="@linkend"/>
+      </xsl:message>
+      <xsl:text>???</xsl:text>
+    </xsl:when>
+
+    <xsl:when test="@endterm">
+      <xsl:variable name="etargets" select="key('id',@endterm)"/>
+      <xsl:variable name="etarget" select="$etargets[1]"/>
+      <xsl:choose>
+        <xsl:when test="count($etarget) = 0">
+          <xsl:message>
+            <xsl:value-of select="count($etargets)"/>
+            <xsl:text>Endterm points to nonexistent ID: </xsl:text>
+            <xsl:value-of select="@endterm"/>
+          </xsl:message>
+          <xsl:text>???</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="$etarget" mode="endterm"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+
+    <xsl:when test="$target/@xreflabel">
+      <xsl:call-template name="xref.xreflabel">
+        <xsl:with-param name="target" select="$target"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
+
+      <xsl:apply-templates select="$target" mode="xref-to">
+        <xsl:with-param name="referrer" select="."/>
+        <xsl:with-param name="xrefstyle">
+          <xsl:choose>
+            <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
+              <xsl:value-of select="@role"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="@xrefstyle"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+      </xsl:apply-templates>
+
+      <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ============================================================ -->
+
+</xsl:stylesheet>
+

+ 304 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/utility.xsl

@@ -0,0 +1,304 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                xmlns:dyn="http://exslt.org/dynamic"
+                xmlns:saxon="http://icl.com/saxon"
+                exclude-result-prefixes="doc dyn saxon"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<doc:reference xmlns="">
+<referenceinfo>
+<releaseinfo role="meta">
+$Id$
+</releaseinfo>
+<corpauthor>The DocBook Project Development Team</corpauthor>
+<copyright><year>2007</year>
+<holder>The DocBook Project</holder>
+</copyright>
+</referenceinfo>
+<title>Utility Template Reference</title>
+
+<partintro id="partintro">
+<title>Introduction</title>
+
+<para>This is technical reference documentation for the
+  miscellaneous utility templates in the DocBook XSL
+  Stylesheets.</para>
+
+<note>
+<para>These templates are defined in a separate file from the set
+  of “common” templates because some of the comment templates
+  reference DocBook XSL stylesheet parameters, requiring the
+  entire set of parameters to be imported/included in any
+  stylesheet that imports/includes the common templates.</para>
+<para>The utility templates don’t import or include any DocBook
+  XSL stylesheet parameters, so the utility templates can be used
+  without importing the whole set of parameters.</para>
+</note>
+
+<para>The following documentation is not intended to be
+  <quote>user</quote> documentation.  It is provided for developers
+  writing customization layers for the stylesheets, and for anyone
+  who's interested in <quote>how it works</quote>.</para>
+</partintro>
+</doc:reference>
+
+<!-- ====================================================================== -->
+
+<doc:template name="log.message" xmlns="">
+  <refpurpose>Logs/emits formatted notes and warnings</refpurpose>
+
+  <refdescription id="log.message-desc">
+    <para>The <function>log.message</function> template is a utility
+    template for logging/emitting formatted messages&#xa0;– that is,
+    notes and warnings, along with a given log “level” and an
+    identifier for the “source” that the message relates to.</para>
+  </refdescription>
+
+  <refparameter id="log.message-params">
+    <variablelist>
+      <varlistentry>
+        <term>level</term>
+        <listitem>
+          <para>Text to log/emit in the message-level field to
+            indicate the message level
+          (<literal>Note</literal> or
+          <literal>Warning</literal>)</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>source</term>
+        <listitem>
+          <para>Text to log/emit in the source field to identify the
+            “source” to which the notification/warning relates.
+            This can be any arbitrary string, but because the
+            message lacks line and column numbers to identify the
+            exact part of the source document to which it
+            relates, the intention is that the value you pass
+            into the <literal>source</literal> parameter should
+            give the user some way to identify the portion of
+            their source document on which to take potentially
+            take action in response to the log message (for
+            example, to edit, change, or add content).</para>
+          <para>So the <literal>source</literal> value should be,
+            for example, an ID, book/chapter/article title, title
+            of some formal object, or even a string giving an
+            XPath expression.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>context-desc</term>
+        <listitem>
+          <para>Text to log/emit in the context-description field to
+            describe the context for the message.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>context-desc-field-length</term>
+        <listitem>
+          <para>Specifies length of the context-description field
+            (in characters); default is 12</para>
+          <para>If the text specified by the
+            <literal>context-desc</literal> parameter is longer
+            than the number of characters specified in
+            <literal>context-desc-field-length</literal>, it is
+            truncated to <literal>context-desc-field-length</literal>
+            (12 characters by default).</para>
+          <para>If the specified text is shorter than
+            <literal>context-desc-field-length</literal>,
+          it is right-padded out to
+          <literal>context-desc-field-length</literal> (12 by
+          default).</para>
+        <para>If no value has been specified for the
+          <literal>context-desc</literal> parameter, the field is
+          left empty and the text of the log message begins with
+          the value of the <literal>message</literal>
+          parameter.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>message</term>
+        <listitem>
+          <para>Text to log/emit in the actual message field</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>message-field-length</term>
+        <listitem>
+          <para>Specifies length of the message
+            field (in characters); default is 45</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refparameter>
+  <refreturn id="log.message-returns">
+  <para>Outputs a message (generally, to standard error).</para></refreturn>
+</doc:template>
+<xsl:template name="log.message">
+  <xsl:param name="level"/>
+  <xsl:param name="source"/>
+  <xsl:param name="context-desc"/>
+  <xsl:param name="context-desc-field-length">12</xsl:param>
+  <xsl:param name="context-desc-padded">
+    <xsl:if test="not($context-desc = '')">
+      <xsl:call-template name="pad-string">
+        <xsl:with-param name="leftRight">right</xsl:with-param>
+        <xsl:with-param name="padVar"
+          select="substring($context-desc, 1, $context-desc-field-length)"/>
+        <xsl:with-param name="length" select="$context-desc-field-length"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:param>
+  <xsl:param name="message"/>
+  <xsl:param name="message-field-length" select="45"/>
+  <xsl:param name="message-padded">
+    <xsl:variable name="spaces-for-blank-level">
+      <!-- * if the level field is blank, we'll need to pad out -->
+      <!-- * the message field with spaces to compensate -->
+      <xsl:choose>
+        <xsl:when test="$level = ''">
+          <xsl:value-of select="4 + 2"/>
+          <!-- * 4 = hard-coded length of comment text ("Note" or "Warn") -->
+          <!-- * + 2 = length of colon-plus-space separator ": " -->
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="0"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="spaces-for-blank-context-desc">
+      <!-- * if the context-description field is blank, we'll need -->
+      <!-- * to pad out the message field with spaces to compensate -->
+      <xsl:choose>
+        <xsl:when test="$context-desc = ''">
+          <xsl:value-of select="$context-desc-field-length + 2"/>
+          <!-- * + 2 = length of colon-plus-space separator ": " -->
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="0"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="extra-spaces"
+      select="$spaces-for-blank-level + $spaces-for-blank-context-desc"/>
+    <xsl:call-template name="pad-string">
+      <xsl:with-param name="leftRight">right</xsl:with-param>
+      <xsl:with-param name="padVar"
+        select="substring($message, 1, ($message-field-length + $extra-spaces))"/>
+      <xsl:with-param name="length"
+        select="$message-field-length + $extra-spaces"/>
+    </xsl:call-template>
+  </xsl:param>
+  <!-- * emit the actual log message -->
+  <xsl:message>
+    <xsl:if test="not($level = '')">
+      <xsl:value-of select="$level"/>
+      <xsl:text>: </xsl:text>
+    </xsl:if>
+    <xsl:if test="not($context-desc = '')">
+      <xsl:value-of select="$context-desc-padded"/>
+      <xsl:text>: </xsl:text>
+    </xsl:if>
+    <xsl:value-of select="$message-padded"/>
+    <xsl:text>  </xsl:text>
+    <xsl:value-of select="$source"/>
+  </xsl:message>
+</xsl:template>
+
+<!-- ===================================== -->
+<doc:template name="get.doc.title" xmlns="">
+  <refpurpose>Gets a title from the current document</refpurpose>
+  <refdescription id="get.doc.title-desc">
+    <para>The <function>get.doc.title</function> template is a
+      utility template for returning the first title found in the
+      current document.</para>
+  </refdescription>
+  <refreturn id="get.doc.title-returns">
+  <para>Returns a string containing some identifying title for the
+    current document .</para></refreturn>
+</doc:template>
+<xsl:template name="get.doc.title">
+  <xsl:choose>
+    <xsl:when test="//*[local-name() = 'title'
+      or local-name() = 'refname']">
+      <xsl:value-of select="//*[local-name() = 'title'
+        or local-name() = 'refname'][1]"/>
+    </xsl:when>
+    <xsl:when test="substring(local-name(*[1]),
+      string-length(local-name(*[1])-3) = 'info')
+      and *[1]/*[local-name() = 'title']">
+      <xsl:value-of select="*[1]/*[local-name() = 'title'][1]"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ===================================== -->
+<doc:template name="pad-string" xmlns="">
+  <refpurpose>Right-pads or left-pads a string out to a certain length</refpurpose>
+  <refdescription id="pad-string-desc">
+    <para>This function takes string <parameter>padVar</parameter> and
+      pads it out in the direction <parameter>rightLeft</parameter> to
+      the string-length <parameter>length</parameter>, using string
+      <parameter>padChar</parameter> (a space character by default) as
+      the padding string (note that <parameter>padChar</parameter> can
+      be a string; it is not limited to just being a single
+      character).</para>
+    <note>
+      <para>This function began as a copy of Nate Austin's
+        <function>prepend-pad</function> function in the <ulink
+          url="http://www.dpawson.co.uk/xsl/sect2/padding.html" >Padding
+          Content</ulink> section of Dave Pawson's <ulink
+          url="http://www.dpawson.co.uk/xsl/index.html" >XSLT
+          FAQ</ulink>.</para>
+    </note>
+  </refdescription>
+  <refreturn id="pad-string-returns">
+  <para>Returns a (padded) string.</para></refreturn>
+</doc:template>
+<xsl:template name="pad-string">
+  <!-- * recursive template to right/left pad the value with -->
+  <!-- * whatever padChar is passed in -->
+  <xsl:param name="padChar" select="' '"/>
+  <xsl:param name="leftRight">left</xsl:param>
+  <xsl:param name="padVar"/>
+  <xsl:param name="length"/>
+  <xsl:choose>
+    <xsl:when test="string-length($padVar) &lt; $length">
+      <xsl:call-template name="pad-string">
+        <xsl:with-param name="padChar" select="$padChar"/>
+        <xsl:with-param name="leftRight" select="$leftRight"/>
+        <xsl:with-param name="padVar">
+          <xsl:choose>
+            <!-- * determine whether string should be -->
+            <!-- * right- or left-padded -->
+            <xsl:when test="$leftRight = 'left'">
+              <!-- * pad it to left -->
+              <xsl:value-of select="concat($padChar,$padVar)"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <!-- * otherwise, right-pad the string -->
+              <xsl:value-of select="concat($padVar,$padChar)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+        <xsl:with-param name="length" select="$length"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of 
+        select="substring($padVar,string-length($padVar) - $length + 1)"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 647 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_cn.xml

@@ -0,0 +1,647 @@
+<?xml version="1.0" encoding="utf-8"?>
+<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="zh_cn" english-language-name="Chinese Simplified">
+
+<!-- * This file is generated automatically. -->
+<!-- * To submit changes to this file upstream (to the DocBook Project) -->
+<!-- * do not submit an edited version of this file. Instead, submit an -->
+<!-- * edited version of the source file at the following location: -->
+<!-- * -->
+<!-- *  https://svn.sourceforge.net/svnroot/docbook/trunk/gentext/locale/zh_cn.xml -->
+<!-- * -->
+<!-- * E-mail the edited zh_cn.xml source file to: -->
+<!-- * -->
+<!-- *  docbook-developers@lists.sourceforge.net -->
+
+<!-- ******************************************************************** -->
+
+<!-- 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. -->
+
+<!-- ******************************************************************** -->
+
+<l:gentext key="Abstract" text="摘要"/>
+<l:gentext key="abstract" text="摘要"/>
+<l:gentext key="Answer" text="答:"/>
+<l:gentext key="answer" text="答:"/>
+<l:gentext key="Appendix" text="附录"/>
+<l:gentext key="appendix" text="附录"/>
+<l:gentext key="Article" text="文章"/>
+<l:gentext key="article" text="文章"/>
+<l:gentext key="Author" text="Author" lang="en"/>
+<l:gentext key="Bibliography" text="参考书目"/>
+<l:gentext key="bibliography" text="参考书目"/>
+<l:gentext key="Book" text="书"/>
+<l:gentext key="book" text="书"/>
+<l:gentext key="CAUTION" text="小心"/>
+<l:gentext key="Caution" text="小心"/>
+<l:gentext key="caution" text="小心"/>
+<l:gentext key="Chapter" text="章"/>
+<l:gentext key="chapter" text="章"/>
+<l:gentext key="Colophon" text="Colophon"/>
+<l:gentext key="colophon" text="Colophon"/>
+<l:gentext key="Copyright" text="版权"/>
+<l:gentext key="copyright" text="版权"/>
+<l:gentext key="Dedication" text="题词"/>
+<l:gentext key="dedication" text="题词"/>
+<l:gentext key="Edition" text="版"/>
+<l:gentext key="edition" text="版"/>
+<l:gentext key="Editor" text="编者"/>
+<l:gentext key="Equation" text="公式"/>
+<l:gentext key="equation" text="公式"/>
+<l:gentext key="Example" text="例"/>
+<l:gentext key="example" text="例"/>
+<l:gentext key="Figure" text="图"/>
+<l:gentext key="figure" text="图"/>
+<l:gentext key="Glossary" text="术语表"/>
+<l:gentext key="glossary" text="术语表"/>
+<l:gentext key="GlossSee" text="见"/>
+<l:gentext key="glosssee" text="见"/>
+<l:gentext key="GlossSeeAlso" text="参见"/>
+<l:gentext key="glossseealso" text="参见"/>
+<l:gentext key="IMPORTANT" text="重要"/>
+<l:gentext key="important" text="重要"/>
+<l:gentext key="Important" text="重要"/>
+<l:gentext key="Index" text="索引"/>
+<l:gentext key="index" text="索引"/>
+<l:gentext key="ISBN" text="ISBN"/>
+<l:gentext key="isbn" text="ISBN"/>
+<l:gentext key="LegalNotice" text="法律通告"/>
+<l:gentext key="legalnotice" text="法律通告"/>
+<l:gentext key="MsgAud" text="受众"/>
+<l:gentext key="msgaud" text="受众"/>
+<l:gentext key="MsgLevel" text="级别"/>
+<l:gentext key="msglevel" text="级别"/>
+<l:gentext key="MsgOrig" text="出处"/>
+<l:gentext key="msgorig" text="出处"/>
+<l:gentext key="NOTE" text="注意"/>
+<l:gentext key="Note" text="注意"/>
+<l:gentext key="note" text="注意"/>
+<l:gentext key="Part" text="部分"/>
+<l:gentext key="part" text="部分"/>
+<l:gentext key="Preface" text="前言"/>
+<l:gentext key="preface" text="前言"/>
+<l:gentext key="Procedure" text="过程"/>
+<l:gentext key="procedure" text="过程"/>
+<l:gentext key="ProductionSet" text="产品"/>
+<l:gentext key="PubDate" text="出版日期"/>
+<l:gentext key="pubdate" text="出版日期"/>
+<l:gentext key="Published" text="出版方"/>
+<l:gentext key="published" text="出版方"/>
+<l:gentext key="Publisher" text="出版者"/>
+<l:gentext key="Qandadiv" text="质保"/>
+<l:gentext key="qandadiv" text="质保"/>
+<l:gentext key="QandASet" text="常见问题"/>
+<l:gentext key="Question" text="问:"/>
+<l:gentext key="question" text="问:"/>
+<l:gentext key="RefEntry" text=""/>
+<l:gentext key="refentry" text=""/>
+<l:gentext key="Reference" text="参考"/>
+<l:gentext key="reference" text="参考"/>
+<l:gentext key="References" text="参考"/>
+<l:gentext key="RefName" text="名称"/>
+<l:gentext key="refname" text="名称"/>
+<l:gentext key="RefSection" text=""/>
+<l:gentext key="refsection" text=""/>
+<l:gentext key="RefSynopsisDiv" text="大纲"/>
+<l:gentext key="refsynopsisdiv" text="大纲"/>
+<l:gentext key="RevHistory" text="修订历史"/>
+<l:gentext key="revhistory" text="修订历史"/>
+<l:gentext key="revision" text="修订"/>
+<l:gentext key="Revision" text="修订"/>
+<l:gentext key="sect1" text="节"/>
+<l:gentext key="sect2" text="节"/>
+<l:gentext key="sect3" text="节"/>
+<l:gentext key="sect4" text="节"/>
+<l:gentext key="sect5" text="节"/>
+<l:gentext key="section" text="节"/>
+<l:gentext key="Section" text="节"/>
+<l:gentext key="see" text="见"/>
+<l:gentext key="See" text="见"/>
+<l:gentext key="seealso" text="参见"/>
+<l:gentext key="Seealso" text="参见"/>
+<l:gentext key="SeeAlso" text="参见"/>
+<l:gentext key="set" text="Set"/>
+<l:gentext key="Set" text="Set"/>
+<l:gentext key="setindex" text="Set Index"/>
+<l:gentext key="SetIndex" text="Set Index"/>
+<l:gentext key="Sidebar" text=""/>
+<l:gentext key="sidebar" text="sidebar"/>
+<l:gentext key="step" text="步骤"/>
+<l:gentext key="Step" text="步骤"/>
+<l:gentext key="table" text="表"/>
+<l:gentext key="Table" text="表"/>
+<l:gentext key="task" text="任务"/>
+<l:gentext key="Task" text="任务"/>
+<l:gentext key="tip" text="提示"/>
+<l:gentext key="TIP" text="提示"/>
+<l:gentext key="Tip" text="提示"/>
+<l:gentext key="Warning" text="警告"/>
+<l:gentext key="warning" text="警告"/>
+<l:gentext key="WARNING" text="警告"/>
+<l:gentext key="and" text="和"/>
+<l:gentext key="by" text="由"/>
+<l:gentext key="Edited" text="编辑时间"/>
+<l:gentext key="edited" text="编辑时间"/>
+<l:gentext key="Editedby" text="编辑者"/>
+<l:gentext key="editedby" text="编辑者"/>
+<l:gentext key="in" text="于"/>
+<l:gentext key="lastlistcomma" text=""/>
+<l:gentext key="listcomma" text="、"/>
+<l:gentext key="nonexistantelement" text="不存在的元素"/>
+<l:gentext key="notes" text="备注"/>
+<l:gentext key="Notes" text="备注"/>
+<l:gentext key="Pgs" text="页"/>
+<l:gentext key="pgs" text="页"/>
+<l:gentext key="Revisedby" text="修订者:"/>
+<l:gentext key="revisedby" text="修订者:"/>
+<l:gentext key="TableNotes" text="表注"/>
+<l:gentext key="tablenotes" text="表注"/>
+<l:gentext key="TableofContents" text="目录"/>
+<l:gentext key="tableofcontents" text="目录"/>
+<l:gentext key="unexpectedelementname" text="未预期的名称"/>
+<l:gentext key="unsupported" text="不支持"/>
+<l:gentext key="xrefto" text="xref to"/>
+<l:gentext key="Authors" text="作者"/>
+<l:gentext key="copyeditor" text="版权编辑"/>
+<l:gentext key="graphicdesigner" text="美术编辑"/>
+<l:gentext key="productioneditor" text="产品编辑"/>
+<l:gentext key="technicaleditor" text="技术编辑"/>
+<l:gentext key="translator" text="译者"/>
+<l:gentext key="listofequations" text="公式清单"/>
+<l:gentext key="ListofEquations" text="公式清单"/>
+<l:gentext key="ListofExamples" text="范例清单"/>
+<l:gentext key="listofexamples" text="范例清单"/>
+<l:gentext key="ListofFigures" text="插图清单"/>
+<l:gentext key="listoffigures" text="插图清单"/>
+<l:gentext key="ListofProcedures" text="过程清单"/>
+<l:gentext key="listofprocedures" text="过程清单"/>
+<l:gentext key="listoftables" text="表格清单"/>
+<l:gentext key="ListofTables" text="表格清单"/>
+<l:gentext key="ListofUnknown" text="未知清单"/>
+<l:gentext key="listofunknown" text="未知清单"/>
+<l:gentext key="nav-home" text="起始页"/>
+<l:gentext key="nav-next" text="下一页"/>
+<l:gentext key="nav-next-sibling" text="快进"/>
+<l:gentext key="nav-prev" text="上一页"/>
+<l:gentext key="nav-prev-sibling" text="快退"/>
+<l:gentext key="nav-up" text="上一级"/>
+<l:gentext key="nav-toc" text="目录"/>
+<l:gentext key="Draft" text="草稿"/>
+<l:gentext key="above" text="以上"/>
+<l:gentext key="below" text="以下"/>
+<l:gentext key="sectioncalled" text="一节"/>
+<l:gentext key="index symbols" text="符号"/>
+<l:gentext key="lowercase.alpha" text="abcdefghijklmnopqrstuvwxyz"/>
+<l:gentext key="uppercase.alpha" text="ABCDEFGHIJKLMNOPQRSTUVWXYZ"/>
+<l:gentext key="normalize.sort.input" text="AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ" lang="en"/>
+<l:gentext key="normalize.sort.output" text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ" lang="en"/>
+<l:dingbat key="startquote" text="“"/>
+<l:dingbat key="endquote" text="”"/>
+<l:dingbat key="nestedstartquote" text="‘"/>
+<l:dingbat key="nestedendquote" text="’"/>
+<l:dingbat key="singlestartquote" text="‘"/>
+<l:dingbat key="singleendquote" text="’"/>
+<l:dingbat key="bullet" text="·"/>
+<l:gentext key="hyphenation-character" text="-"/>
+<l:gentext key="hyphenation-push-character-count" text="2"/>
+<l:gentext key="hyphenation-remain-character-count" text="2"/>
+<l:context name="styles"><l:template name="person-name" text="first-last"/>
+</l:context>
+<l:context name="title"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="%t"/>
+<l:template name="appendix" text="附录 %n. %t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="biblioentry" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliolist" text="%t"/>
+<l:template name="bibliomixed" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="第 %n 章 %t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="公式 %n. %t"/>
+<l:template name="example" text="例 %n. %t"/>
+<l:template name="figure" text="图 %n. %t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="glosslist" text="%t"/>
+<l:template name="glossentry" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text=""/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="第 %n 部分 %t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="procedure.formal" text="过程 %n. %t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="productionset.formal" text="产品 %n"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="%t"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="%t"/>
+<l:template name="refentry" text="%t"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsection" text="%t"/>
+<l:template name="refsect1" text="%t"/>
+<l:template name="refsect2" text="%t"/>
+<l:template name="refsect3" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="refsynopsisdivinfo" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="step" text="%t"/>
+<l:template name="table" text="表 %n. %t"/>
+<l:template name="task" text="%t"/>
+<l:template name="tasksummary" text="%t" lang="en"/>
+<l:template name="taskprerequisites" text="%t" lang="en"/>
+<l:template name="taskrelated" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text=""/>
+<l:template name="warning" text="%t"/>
+</l:context>
+<l:context name="title-unnumbered"><l:template name="appendix" text="%t"/>
+<l:template name="article/appendix" text="%t"/>
+<l:template name="bridgehead" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="sect1" text="%t"/>
+<l:template name="sect2" text="%t"/>
+<l:template name="sect3" text="%t"/>
+<l:template name="sect4" text="%t"/>
+<l:template name="sect5" text="%t"/>
+<l:template name="section" text="%t"/>
+<l:template name="simplesect" text="%t"/>
+<l:template name="part" text="%t" lang="en"/>
+</l:context>
+<l:context name="title-numbered"><l:template name="appendix" text="附录 %n. %t"/>
+<l:template name="article/appendix" text="%n. %t"/>
+<l:template name="bridgehead" text="%n. %t"/>
+<l:template name="chapter" text="第 %n 章 %t"/>
+<l:template name="part" text="部分 %n. %t"/>
+<l:template name="sect1" text="%n. %t"/>
+<l:template name="sect2" text="%n. %t"/>
+<l:template name="sect3" text="%n. %t"/>
+<l:template name="sect4" text="%n. %t"/>
+<l:template name="sect5" text="%n. %t"/>
+<l:template name="section" text="%n. %t"/>
+<l:template name="simplesect" text="%t"/>
+</l:context>
+<l:context name="subtitle"><l:template name="appendix" text="%s"/>
+<l:template name="article" text="%s"/>
+<l:template name="bibliodiv" text="%s"/>
+<l:template name="biblioentry" text="%s"/>
+<l:template name="bibliography" text="%s"/>
+<l:template name="bibliomixed" text="%s"/>
+<l:template name="bibliomset" text="%s"/>
+<l:template name="biblioset" text="%s"/>
+<l:template name="book" text="%s"/>
+<l:template name="chapter" text="%s"/>
+<l:template name="colophon" text="%s"/>
+<l:template name="dedication" text="%s"/>
+<l:template name="glossary" text="%s"/>
+<l:template name="glossdiv" text="%s"/>
+<l:template name="index" text="%s"/>
+<l:template name="indexdiv" text="%s"/>
+<l:template name="lot" text="%s"/>
+<l:template name="part" text="%s"/>
+<l:template name="partintro" text="%s"/>
+<l:template name="preface" text="%s"/>
+<l:template name="refentry" text="%s"/>
+<l:template name="reference" text="%s"/>
+<l:template name="refsection" text="%s"/>
+<l:template name="refsect1" text="%s"/>
+<l:template name="refsect2" text="%s"/>
+<l:template name="refsect3" text="%s"/>
+<l:template name="refsynopsisdiv" text="%s"/>
+<l:template name="sect1" text="%s"/>
+<l:template name="sect2" text="%s"/>
+<l:template name="sect3" text="%s"/>
+<l:template name="sect4" text="%s"/>
+<l:template name="sect5" text="%s"/>
+<l:template name="section" text="%s"/>
+<l:template name="set" text="%s"/>
+<l:template name="setindex" text="%s"/>
+<l:template name="sidebar" text="%s"/>
+<l:template name="simplesect" text="%s"/>
+<l:template name="toc" text="%s"/>
+</l:context>
+<l:context name="xref"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="答: %n"/>
+<l:template name="appendix" text="%t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="constraintdef" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="%t"/>
+<l:template name="example" text="%t"/>
+<l:template name="figure" text="%t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text="%n"/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="%t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="问: %n"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="问: %n"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="table" text="%t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="%n"/>
+<l:template name="warning" text="%t"/>
+<l:template name="olink.document.citation" text=" in %o" lang="en"/>
+<l:template name="olink.page.citation" text=" (page %p)" lang="en"/>
+<l:template name="page.citation" text=" [%p]"/>
+<l:template name="page" text="(第 %p 页)"/>
+<l:template name="docname" text=" in %o" lang="en"/>
+<l:template name="docnamelong" text=" in the document titled %o" lang="en"/>
+<l:template name="pageabbrev" text="(第 %p 页)"/>
+<l:template name="Page" text="第 %p 页"/>
+<l:template name="bridgehead" text="“%t”一节"/>
+<l:template name="refsection" text="“%t”一节"/>
+<l:template name="refsect1" text="“%t”一节"/>
+<l:template name="refsect2" text="“%t”一节"/>
+<l:template name="refsect3" text="“%t”一节"/>
+<l:template name="sect1" text="“%t”一节"/>
+<l:template name="sect2" text="“%t”一节"/>
+<l:template name="sect3" text="“%t”一节"/>
+<l:template name="sect4" text="“%t”一节"/>
+<l:template name="sect5" text="“%t”一节"/>
+<l:template name="section" text="“%t”一节"/>
+<l:template name="simplesect" text="“%t”一节"/>
+</l:context>
+<l:context name="xref-number"><l:template name="answer" text="答: %n"/>
+<l:template name="appendix" text="附录 %n"/>
+<l:template name="bridgehead" text="第 %n 节"/>
+<l:template name="chapter" text="第 %n 章"/>
+<l:template name="equation" text="公式 %n"/>
+<l:template name="example" text="例 %n"/>
+<l:template name="figure" text="图 %n"/>
+<l:template name="part" text="第 %n 部分"/>
+<l:template name="procedure" text="过程 %n"/>
+<l:template name="productionset" text="产品 %n"/>
+<l:template name="qandadiv" text="质保 %n"/>
+<l:template name="qandaentry" text="问: %n"/>
+<l:template name="question" text="问: %n"/>
+<l:template name="sect1" text="第 %n 节"/>
+<l:template name="sect2" text="第 %n 节"/>
+<l:template name="sect3" text="第 %n 节"/>
+<l:template name="sect4" text="第 %n 节"/>
+<l:template name="sect5" text="第 %n 节"/>
+<l:template name="section" text="第 %n 节"/>
+<l:template name="table" text="表 %n"/>
+</l:context>
+<l:context name="xref-number-and-title"><l:template name="appendix" text="附录 %n, %t"/>
+<l:template name="bridgehead" text="第 %n 节 “%t”"/>
+<l:template name="chapter" text="第 %n 章 %t"/>
+<l:template name="equation" text="公式 %n “%t”"/>
+<l:template name="example" text="例 %n “%t”"/>
+<l:template name="figure" text="图 %n “%t”"/>
+<l:template name="part" text="第 %n 部分 “%t”"/>
+<l:template name="procedure" text="过程 %n, “%t”"/>
+<l:template name="productionset" text="产品 %n, “%t”"/>
+<l:template name="qandadiv" text="质保 %n, “%t”"/>
+<l:template name="refsect1" text="“%t”一节"/>
+<l:template name="refsect2" text="“%t”一节"/>
+<l:template name="refsect3" text="“%t”一节"/>
+<l:template name="refsection" text="“%t”一节"/>
+<l:template name="sect1" text="第 %n 节 “%t”"/>
+<l:template name="sect2" text="第 %n 节 “%t”"/>
+<l:template name="sect3" text="第 %n 节 “%t”"/>
+<l:template name="sect4" text="第 %n 节 “%t”"/>
+<l:template name="sect5" text="第 %n 节 “%t”"/>
+<l:template name="section" text="第 %n 节 “%t”"/>
+<l:template name="simplesect" text="“%t”一节"/>
+<l:template name="table" text="表 %n “%t”"/>
+</l:context>
+<l:context name="authorgroup"><l:template name="sep" text="、"/>
+<l:template name="sep2" text="和"/>
+<l:template name="seplast" text="和"/>
+</l:context>
+<l:context name="glossary"><l:template name="see" text="见%t"/>
+<l:template name="seealso" text="参见%t"/>
+</l:context>
+<l:context name="msgset"><l:template name="MsgAud" text="受众:"/>
+<l:template name="MsgLevel" text="级别:"/>
+<l:template name="MsgOrig" text="出处:"/>
+</l:context>
+<l:context name="datetime"><l:template name="format" text="Y-m-d"/>
+</l:context>
+<l:context name="termdef"><l:template name="prefix" text="[Definition: " lang="en"/>
+<l:template name="suffix" text="]" lang="en"/>
+</l:context>
+<l:context name="datetime-full"><l:template name="January" text="一月"/>
+<l:template name="February" text="二月"/>
+<l:template name="March" text="三月"/>
+<l:template name="April" text="四月"/>
+<l:template name="May" text="五月"/>
+<l:template name="June" text="六月"/>
+<l:template name="July" text="七月"/>
+<l:template name="August" text="八月"/>
+<l:template name="September" text="九月"/>
+<l:template name="October" text="十月"/>
+<l:template name="November" text="十一月"/>
+<l:template name="December" text="十二月"/>
+<l:template name="Monday" text="星期一"/>
+<l:template name="Tuesday" text="星期二"/>
+<l:template name="Wednesday" text="星期三"/>
+<l:template name="Thursday" text="星期四"/>
+<l:template name="Friday" text="星期五"/>
+<l:template name="Saturday" text="星期六"/>
+<l:template name="Sunday" text="星期日"/>
+</l:context>
+<l:context name="datetime-abbrev"><l:template name="Jan" text="一月"/>
+<l:template name="Feb" text="二月"/>
+<l:template name="Mar" text="三月"/>
+<l:template name="Apr" text="四月"/>
+<l:template name="May" text="五月"/>
+<l:template name="Jun" text="六月"/>
+<l:template name="Jul" text="七月"/>
+<l:template name="Aug" text="八月"/>
+<l:template name="Sep" text="九月"/>
+<l:template name="Oct" text="十月"/>
+<l:template name="Nov" text="十一月"/>
+<l:template name="Dec" text="十二月"/>
+<l:template name="Mon" text="周一"/>
+<l:template name="Tue" text="周二"/>
+<l:template name="Wed" text="周三"/>
+<l:template name="Thu" text="周四"/>
+<l:template name="Fri" text="周五"/>
+<l:template name="Sat" text="周六"/>
+<l:template name="Sun" text="周日"/>
+</l:context>
+<l:context name="htmlhelp"><l:template name="langcode" text="0x0804 Chinese (CHINA)"/>
+</l:context>
+<l:context name="index"><l:template name="term-separator" text=", " lang="en"/>
+<l:template name="number-separator" text=", " lang="en"/>
+<l:template name="range-separator" text="-" lang="en"/>
+</l:context>
+<l:context name="iso690"><l:template name="lastfirst.sep" text=", " lang="en"/>
+<l:template name="alt.person.two.sep" text=" – " lang="en"/>
+<l:template name="alt.person.last.sep" text=" – " lang="en"/>
+<l:template name="alt.person.more.sep" text=" – " lang="en"/>
+<l:template name="primary.editor" text=" (ed.)" lang="en"/>
+<l:template name="primary.many" text=", et al." lang="en"/>
+<l:template name="primary.sep" text=". " lang="en"/>
+<l:template name="submaintitle.sep" text=": " lang="en"/>
+<l:template name="title.sep" text=". " lang="en"/>
+<l:template name="othertitle.sep" text=", " lang="en"/>
+<l:template name="medium1" text=" [" lang="en"/>
+<l:template name="medium2" text="]" lang="en"/>
+<l:template name="secondary.person.sep" text="; " lang="en"/>
+<l:template name="secondary.sep" text=". " lang="en"/>
+<l:template name="respons.sep" text=". " lang="en"/>
+<l:template name="edition.sep" text=". " lang="en"/>
+<l:template name="edition.serial.sep" text=", " lang="en"/>
+<l:template name="issuing.range" text="-" lang="en"/>
+<l:template name="issuing.div" text=", " lang="en"/>
+<l:template name="issuing.sep" text=". " lang="en"/>
+<l:template name="partnr.sep" text=". " lang="en"/>
+<l:template name="placepubl.sep" text=": " lang="en"/>
+<l:template name="publyear.sep" text=", " lang="en"/>
+<l:template name="pubinfo.sep" text=". " lang="en"/>
+<l:template name="spec.pubinfo.sep" text=", " lang="en"/>
+<l:template name="upd.sep" text=", " lang="en"/>
+<l:template name="datecit1" text=" [cited " lang="en"/>
+<l:template name="datecit2" text="]" lang="en"/>
+<l:template name="extent.sep" text=". " lang="en"/>
+<l:template name="locs.sep" text=", " lang="en"/>
+<l:template name="location.sep" text=". " lang="en"/>
+<l:template name="serie.sep" text=". " lang="en"/>
+<l:template name="notice.sep" text=". " lang="en"/>
+<l:template name="access" text="Available " lang="en"/>
+<l:template name="acctoo" text="Also available " lang="en"/>
+<l:template name="onwww" text="from World Wide Web" lang="en"/>
+<l:template name="oninet" text="from Internet" lang="en"/>
+<l:template name="access.end" text=": " lang="en"/>
+<l:template name="link1" text="&lt;" lang="en"/>
+<l:template name="link2" text="&gt;" lang="en"/>
+<l:template name="access.sep" text=". " lang="en"/>
+<l:template name="isbn" text="ISBN " lang="en"/>
+<l:template name="issn" text="ISSN " lang="en"/>
+<l:template name="stdnum.sep" text=". " lang="en"/>
+<l:template name="patcountry.sep" text=". " lang="en"/>
+<l:template name="pattype.sep" text=", " lang="en"/>
+<l:template name="patnum.sep" text=". " lang="en"/>
+<l:template name="patdate.sep" text=". " lang="en"/>
+</l:context><l:letters><l:l i="-1"/>
+<l:l i="0">其它</l:l>
+<l:l i="10">A</l:l>
+<l:l i="10">a</l:l>
+<l:l i="20">B</l:l>
+<l:l i="20">b</l:l>
+<l:l i="30">C</l:l>
+<l:l i="30">c</l:l>
+<l:l i="40">D</l:l>
+<l:l i="40">d</l:l>
+<l:l i="50">E</l:l>
+<l:l i="50">e</l:l>
+<l:l i="60">F</l:l>
+<l:l i="60">f</l:l>
+<l:l i="70">G</l:l>
+<l:l i="70">g</l:l>
+<l:l i="80">H</l:l>
+<l:l i="80">h</l:l>
+<l:l i="90">I</l:l>
+<l:l i="90">i</l:l>
+<l:l i="100">J</l:l>
+<l:l i="100">j</l:l>
+<l:l i="110">K</l:l>
+<l:l i="110">k</l:l>
+<l:l i="120">L</l:l>
+<l:l i="120">l</l:l>
+<l:l i="130">M</l:l>
+<l:l i="130">m</l:l>
+<l:l i="140">N</l:l>
+<l:l i="140">n</l:l>
+<l:l i="150">O</l:l>
+<l:l i="150">o</l:l>
+<l:l i="160">P</l:l>
+<l:l i="160">p</l:l>
+<l:l i="170">Q</l:l>
+<l:l i="170">q</l:l>
+<l:l i="180">R</l:l>
+<l:l i="180">r</l:l>
+<l:l i="190">S</l:l>
+<l:l i="190">s</l:l>
+<l:l i="200">T</l:l>
+<l:l i="200">t</l:l>
+<l:l i="210">U</l:l>
+<l:l i="210">u</l:l>
+<l:l i="220">V</l:l>
+<l:l i="220">v</l:l>
+<l:l i="230">W</l:l>
+<l:l i="230">w</l:l>
+<l:l i="240">X</l:l>
+<l:l i="240">x</l:l>
+<l:l i="250">Y</l:l>
+<l:l i="250">y</l:l>
+<l:l i="260">Z</l:l>
+<l:l i="260">z</l:l>
+</l:letters>
+</l:l10n>

+ 1216 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_tw.xml

@@ -0,0 +1,1216 @@
+<?xml version="1.0" encoding="utf-8"?>
+<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="zh_tw" english-language-name="Chinese (Taiwan)">
+
+<!-- * This file is generated automatically. -->
+<!-- * To submit changes to this file upstream (to the DocBook Project) -->
+<!-- * do not submit an edited version of this file. Instead, submit an -->
+<!-- * edited version of the source file at the following location: -->
+<!-- * -->
+<!-- *  https://svn.sourceforge.net/svnroot/docbook/trunk/gentext/locale/zh_tw.xml -->
+<!-- * -->
+<!-- * E-mail the edited zh_tw.xml source file to: -->
+<!-- * -->
+<!-- *  docbook-developers@lists.sourceforge.net -->
+
+<!-- ******************************************************************** -->
+
+<!-- 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. -->
+
+<!-- ******************************************************************** -->
+
+<l:gentext key="Abstract" text="摘要"/>
+<l:gentext key="abstract" text="摘要"/>
+<l:gentext key="Answer" text="答:"/>
+<l:gentext key="answer" text="答:"/>
+<l:gentext key="Appendix" text="附錄"/>
+<l:gentext key="appendix" text="附錄"/>
+<l:gentext key="Article" text="文章"/>
+<l:gentext key="article" text="文章"/>
+<l:gentext key="Author" text="Author" lang="en"/>
+<l:gentext key="Bibliography" text="參考文獻"/>
+<l:gentext key="bibliography" text="參考文獻"/>
+<l:gentext key="Book" text="書目"/>
+<l:gentext key="book" text="書目"/>
+<l:gentext key="CAUTION" text="注意"/>
+<l:gentext key="Caution" text="注意"/>
+<l:gentext key="caution" text="注意"/>
+<l:gentext key="Chapter" text="章"/>
+<l:gentext key="chapter" text="章"/>
+<l:gentext key="Colophon" text="版本記錄"/>
+<l:gentext key="colophon" text="版本記錄"/>
+<l:gentext key="Copyright" text="版權"/>
+<l:gentext key="copyright" text="版權"/>
+<l:gentext key="Dedication" text="奉獻"/>
+<l:gentext key="dedication" text="奉獻"/>
+<l:gentext key="Edition" text="版"/>
+<l:gentext key="edition" text="版"/>
+<l:gentext key="Editor" text="Editor" lang="en"/>
+<l:gentext key="Equation" text="方程式"/>
+<l:gentext key="equation" text="方程式"/>
+<l:gentext key="Example" text="範例"/>
+<l:gentext key="example" text="範例"/>
+<l:gentext key="Figure" text="圖形"/>
+<l:gentext key="figure" text="圖形"/>
+<l:gentext key="Glossary" text="小辭彙"/>
+<l:gentext key="glossary" text="小辭彙"/>
+<l:gentext key="GlossSee" text="參見"/>
+<l:gentext key="glosssee" text="參見"/>
+<l:gentext key="GlossSeeAlso" text="另參見"/>
+<l:gentext key="glossseealso" text="另參見"/>
+<l:gentext key="IMPORTANT" text="重要"/>
+<l:gentext key="important" text="重要"/>
+<l:gentext key="Important" text="重要"/>
+<l:gentext key="Index" text="索引"/>
+<l:gentext key="index" text="索引"/>
+<l:gentext key="ISBN" text="ISBN"/>
+<l:gentext key="isbn" text="ISBN"/>
+<l:gentext key="LegalNotice" text="法律聲明"/>
+<l:gentext key="legalnotice" text="法律聲明"/>
+<l:gentext key="MsgAud" text="讀者"/>
+<l:gentext key="msgaud" text="讀者"/>
+<l:gentext key="MsgLevel" text="程度"/>
+<l:gentext key="msglevel" text="程度"/>
+<l:gentext key="MsgOrig" text="出處"/>
+<l:gentext key="msgorig" text="出處"/>
+<l:gentext key="NOTE" text="注"/>
+<l:gentext key="Note" text="注"/>
+<l:gentext key="note" text="注"/>
+<l:gentext key="Part" text="部"/>
+<l:gentext key="part" text="部"/>
+<l:gentext key="Preface" text="序言"/>
+<l:gentext key="preface" text="序言"/>
+<l:gentext key="Procedure" text="過程"/>
+<l:gentext key="procedure" text="過程"/>
+<l:gentext key="ProductionSet" text="Production"/>
+<l:gentext key="PubDate" text="Publication Date" lang="en"/>
+<l:gentext key="pubdate" text="Publication date" lang="en"/>
+<l:gentext key="Published" text="出版"/>
+<l:gentext key="published" text="出版"/>
+<l:gentext key="Publisher" text="Publisher" lang="en"/>
+<l:gentext key="Qandadiv" text="問:且答:"/>
+<l:gentext key="qandadiv" text="問:且答:"/>
+<l:gentext key="QandASet" text="Frequently Asked Questions" lang="en"/>
+<l:gentext key="Question" text="問:"/>
+<l:gentext key="question" text="問:"/>
+<l:gentext key="RefEntry" text="參照項目"/>
+<l:gentext key="refentry" text="參照項目"/>
+<l:gentext key="Reference" text="參考"/>
+<l:gentext key="reference" text="參考"/>
+<l:gentext key="References" text="References" lang="en"/>
+<l:gentext key="RefName" text="參考名"/>
+<l:gentext key="refname" text="參考名"/>
+<l:gentext key="RefSection" text="參照章節"/>
+<l:gentext key="refsection" text="參照章節"/>
+<l:gentext key="RefSynopsisDiv" text="大綱"/>
+<l:gentext key="refsynopsisdiv" text="大綱"/>
+<l:gentext key="RevHistory" text="修訂記錄"/>
+<l:gentext key="revhistory" text="修訂記錄"/>
+<l:gentext key="revision" text="修訂"/>
+<l:gentext key="Revision" text="修訂"/>
+<l:gentext key="sect1" text="Section"/>
+<l:gentext key="sect2" text="Section"/>
+<l:gentext key="sect3" text="Section"/>
+<l:gentext key="sect4" text="Section"/>
+<l:gentext key="sect5" text="Section"/>
+<l:gentext key="section" text="節"/>
+<l:gentext key="Section" text="節"/>
+<l:gentext key="see" text="見"/>
+<l:gentext key="See" text="見"/>
+<l:gentext key="seealso" text="另見"/>
+<l:gentext key="Seealso" text="另見"/>
+<l:gentext key="SeeAlso" text="另見"/>
+<l:gentext key="set" text="Set"/>
+<l:gentext key="Set" text="Set"/>
+<l:gentext key="setindex" text="Set Index"/>
+<l:gentext key="SetIndex" text="Set Index"/>
+<l:gentext key="Sidebar" text=""/>
+<l:gentext key="sidebar" text=""/>
+<l:gentext key="step" text="步驟"/>
+<l:gentext key="Step" text="步驟"/>
+<l:gentext key="table" text="表格"/>
+<l:gentext key="Table" text="表格"/>
+<l:gentext key="task" text="Task" lang="en"/>
+<l:gentext key="Task" text="Task" lang="en"/>
+<l:gentext key="tip" text="提示"/>
+<l:gentext key="TIP" text="提示"/>
+<l:gentext key="Tip" text="提示"/>
+<l:gentext key="Warning" text="警告"/>
+<l:gentext key="warning" text="警告"/>
+<l:gentext key="WARNING" text="警告"/>
+<l:gentext key="and" text="且"/>
+<l:gentext key="by" text="由"/>
+<l:gentext key="Edited" text="編輯"/>
+<l:gentext key="edited" text="編輯"/>
+<l:gentext key="Editedby" text="編輯"/>
+<l:gentext key="editedby" text="編輯"/>
+<l:gentext key="in" text="在"/>
+<l:gentext key="lastlistcomma" text=","/>
+<l:gentext key="listcomma" text=","/>
+<l:gentext key="nonexistantelement" text="不存在的元素"/>
+<l:gentext key="notes" text="注"/>
+<l:gentext key="Notes" text="注"/>
+<l:gentext key="Pgs" text="頁"/>
+<l:gentext key="pgs" text="頁"/>
+<l:gentext key="Revisedby" text="修訂"/>
+<l:gentext key="revisedby" text="修訂"/>
+<l:gentext key="TableNotes" text="注釋"/>
+<l:gentext key="tablenotes" text="注釋"/>
+<l:gentext key="TableofContents" text="內容目錄"/>
+<l:gentext key="tableofcontents" text="內容目錄"/>
+<l:gentext key="unexpectedelementname" text="非預期的元素名"/>
+<l:gentext key="unsupported" text="未支援"/>
+<l:gentext key="xrefto" text="參照"/>
+<l:gentext key="Authors" text="Authors" lang="en"/>
+<l:gentext key="copyeditor" text="Copy Editor" lang="en"/>
+<l:gentext key="graphicdesigner" text="Graphic Designer" lang="en"/>
+<l:gentext key="productioneditor" text="Production Editor" lang="en"/>
+<l:gentext key="technicaleditor" text="Technical Editor" lang="en"/>
+<l:gentext key="translator" text="Translator" lang="en"/>
+<l:gentext key="listofequations" text="公式目錄"/>
+<l:gentext key="ListofEquations" text="公式目錄"/>
+<l:gentext key="ListofExamples" text="範例目錄"/>
+<l:gentext key="listofexamples" text="範例目錄"/>
+<l:gentext key="ListofFigures" text="附圖目錄"/>
+<l:gentext key="listoffigures" text="附圖目錄"/>
+<l:gentext key="ListofProcedures" text="List of Procedures" lang="en"/>
+<l:gentext key="listofprocedures" text="List of Procedures" lang="en"/>
+<l:gentext key="listoftables" text="附表目錄"/>
+<l:gentext key="ListofTables" text="附表目錄"/>
+<l:gentext key="ListofUnknown" text="其它內容目錄"/>
+<l:gentext key="listofunknown" text="其它內容目錄"/>
+<l:gentext key="nav-home" text="內容"/>
+<l:gentext key="nav-next" text="下一頁"/>
+<l:gentext key="nav-next-sibling" text="快速向後"/>
+<l:gentext key="nav-prev" text="前一頁"/>
+<l:gentext key="nav-prev-sibling" text="快速向前"/>
+<l:gentext key="nav-up" text="上一層"/>
+<l:gentext key="nav-toc" text="ToC" lang="en"/>
+<l:gentext key="Draft" text="Draft"/>
+<l:gentext key="above" text="above"/>
+<l:gentext key="below" text="below"/>
+<l:gentext key="sectioncalled" text="the section called"/>
+<l:gentext key="index symbols" text="Symbols"/>
+<l:gentext key="lowercase.alpha" text="abcdefghijklmnopqrstuvwxyz" lang="en"/>
+<l:gentext key="uppercase.alpha" text="ABCDEFGHIJKLMNOPQRSTUVWXYZ" lang="en"/>
+<l:gentext key="normalize.sort.input" text="AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ" lang="en"/>
+<l:gentext key="normalize.sort.output" text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ" lang="en"/>
+<l:dingbat key="startquote" text="“"/>
+<l:dingbat key="endquote" text="”"/>
+<l:dingbat key="nestedstartquote" text="‘"/>
+<l:dingbat key="nestedendquote" text="’"/>
+<l:dingbat key="singlestartquote" text="‘" lang="en"/>
+<l:dingbat key="singleendquote" text="’" lang="en"/>
+<l:dingbat key="bullet" text="•"/>
+<l:gentext key="hyphenation-character" text="-" lang="en"/>
+<l:gentext key="hyphenation-push-character-count" text="2" lang="en"/>
+<l:gentext key="hyphenation-remain-character-count" text="2" lang="en"/>
+<l:context name="styles"><l:template name="person-name" text="first-last"/>
+</l:context>
+<l:context name="title"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="%t"/>
+<l:template name="appendix" text="附錄 %n. %t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="biblioentry" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliolist" text="%t" lang="en"/>
+<l:template name="bibliomixed" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="章 %n. %t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="方程式 %n. %t"/>
+<l:template name="example" text="範例 %n. %t"/>
+<l:template name="figure" text="圖形 %n. %t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="glosslist" text="%t" lang="en"/>
+<l:template name="glossentry" text="%t" lang="en"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text=""/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="部 %n. %t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="procedure.formal" text="過程 %n. %t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="productionset.formal" text="Production %n"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="%t"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="%t"/>
+<l:template name="refentry" text="%t"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsection" text="%t" lang="en"/>
+<l:template name="refsect1" text="%t"/>
+<l:template name="refsect2" text="%t"/>
+<l:template name="refsect3" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="refsynopsisdivinfo" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="step" text="%t"/>
+<l:template name="table" text="表格 %n. %t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tasksummary" text="%t" lang="en"/>
+<l:template name="taskprerequisites" text="%t" lang="en"/>
+<l:template name="taskrelated" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="" lang="en"/>
+<l:template name="warning" text="%t"/>
+</l:context>
+<l:context name="title-unnumbered"><l:template name="appendix" text="%t"/>
+<l:template name="article/appendix" text="%t" lang="en"/>
+<l:template name="bridgehead" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="sect1" text="%t"/>
+<l:template name="sect2" text="%t"/>
+<l:template name="sect3" text="%t"/>
+<l:template name="sect4" text="%t"/>
+<l:template name="sect5" text="%t"/>
+<l:template name="section" text="%t"/>
+<l:template name="simplesect" text="%t"/>
+<l:template name="part" text="%t" lang="en"/>
+</l:context>
+<l:context name="title-numbered"><l:template name="appendix" text="附錄 %n. %t"/>
+<l:template name="article/appendix" text="%n. %t" lang="en"/>
+<l:template name="bridgehead" text="%t"/>
+<l:template name="chapter" text="章 %n. %t"/>
+<l:template name="part" text="部 %n. %t"/>
+<l:template name="sect1" text="%n. %t"/>
+<l:template name="sect2" text="%n. %t"/>
+<l:template name="sect3" text="%n. %t"/>
+<l:template name="sect4" text="%n. %t"/>
+<l:template name="sect5" text="%n. %t"/>
+<l:template name="section" text="%n. %t"/>
+<l:template name="simplesect" text="%n. %t"/>
+</l:context>
+<l:context name="subtitle"><l:template name="appendix" text="%s"/>
+<l:template name="article" text="%s"/>
+<l:template name="bibliodiv" text="%s"/>
+<l:template name="biblioentry" text="%s"/>
+<l:template name="bibliography" text="%s"/>
+<l:template name="bibliomixed" text="%s"/>
+<l:template name="bibliomset" text="%s"/>
+<l:template name="biblioset" text="%s"/>
+<l:template name="book" text="%s"/>
+<l:template name="chapter" text="%s"/>
+<l:template name="colophon" text="%s"/>
+<l:template name="dedication" text="%s"/>
+<l:template name="glossary" text="%s"/>
+<l:template name="glossdiv" text="%s"/>
+<l:template name="index" text="%s"/>
+<l:template name="indexdiv" text="%s"/>
+<l:template name="lot" text="%s"/>
+<l:template name="part" text="%s"/>
+<l:template name="partintro" text="%s"/>
+<l:template name="preface" text="%s"/>
+<l:template name="refentry" text="%s"/>
+<l:template name="reference" text="%s"/>
+<l:template name="refsection" text="%s" lang="en"/>
+<l:template name="refsect1" text="%s"/>
+<l:template name="refsect2" text="%s"/>
+<l:template name="refsect3" text="%s"/>
+<l:template name="refsynopsisdiv" text="%s"/>
+<l:template name="sect1" text="%s"/>
+<l:template name="sect2" text="%s"/>
+<l:template name="sect3" text="%s"/>
+<l:template name="sect4" text="%s"/>
+<l:template name="sect5" text="%s"/>
+<l:template name="section" text="%s"/>
+<l:template name="set" text="%s"/>
+<l:template name="setindex" text="%s"/>
+<l:template name="sidebar" text="%s"/>
+<l:template name="simplesect" text="%s"/>
+<l:template name="toc" text="%s"/>
+</l:context>
+<l:context name="xref"><l:template name="abstract" text="%t"/>
+<l:template name="answer" text="答: %n"/>
+<l:template name="appendix" text="%t"/>
+<l:template name="article" text="%t"/>
+<l:template name="authorblurb" text="%t"/>
+<l:template name="bibliodiv" text="%t"/>
+<l:template name="bibliography" text="%t"/>
+<l:template name="bibliomset" text="%t"/>
+<l:template name="biblioset" text="%t"/>
+<l:template name="blockquote" text="%t"/>
+<l:template name="book" text="%t"/>
+<l:template name="calloutlist" text="%t"/>
+<l:template name="caution" text="%t"/>
+<l:template name="chapter" text="%t"/>
+<l:template name="colophon" text="%t"/>
+<l:template name="constraintdef" text="%t"/>
+<l:template name="dedication" text="%t"/>
+<l:template name="equation" text="%t"/>
+<l:template name="example" text="%t"/>
+<l:template name="figure" text="%t"/>
+<l:template name="foil" text="%t" lang="en"/>
+<l:template name="foilgroup" text="%t" lang="en"/>
+<l:template name="formalpara" text="%t"/>
+<l:template name="glossary" text="%t"/>
+<l:template name="glossdiv" text="%t"/>
+<l:template name="important" text="%t"/>
+<l:template name="index" text="%t"/>
+<l:template name="indexdiv" text="%t"/>
+<l:template name="itemizedlist" text="%t"/>
+<l:template name="legalnotice" text="%t"/>
+<l:template name="listitem" text="%n"/>
+<l:template name="lot" text="%t"/>
+<l:template name="msg" text="%t"/>
+<l:template name="msgexplan" text="%t"/>
+<l:template name="msgmain" text="%t"/>
+<l:template name="msgrel" text="%t"/>
+<l:template name="msgset" text="%t"/>
+<l:template name="msgsub" text="%t"/>
+<l:template name="note" text="%t"/>
+<l:template name="orderedlist" text="%t"/>
+<l:template name="part" text="%t"/>
+<l:template name="partintro" text="%t"/>
+<l:template name="preface" text="%t"/>
+<l:template name="procedure" text="%t"/>
+<l:template name="productionset" text="%t"/>
+<l:template name="qandadiv" text="%t"/>
+<l:template name="qandaentry" text="問: %n"/>
+<l:template name="qandaset" text="%t"/>
+<l:template name="question" text="問: %n"/>
+<l:template name="reference" text="%t"/>
+<l:template name="refsynopsisdiv" text="%t"/>
+<l:template name="segmentedlist" text="%t"/>
+<l:template name="set" text="%t"/>
+<l:template name="setindex" text="%t"/>
+<l:template name="sidebar" text="%t"/>
+<l:template name="table" text="%t"/>
+<l:template name="task" text="%t" lang="en"/>
+<l:template name="tip" text="%t"/>
+<l:template name="toc" text="%t"/>
+<l:template name="variablelist" text="%t"/>
+<l:template name="varlistentry" text="%n"/>
+<l:template name="warning" text="%t"/>
+<l:template name="olink.document.citation" text=" in %o" lang="en"/>
+<l:template name="olink.page.citation" text=" (page %p)" lang="en"/>
+<l:template name="page.citation" text=" [%p]"/>
+<l:template name="page" text="(page %p)" lang="en"/>
+<l:template name="docname" text=" in %o" lang="en"/>
+<l:template name="docnamelong" text=" in the document titled %o" lang="en"/>
+<l:template name="pageabbrev" text="(p. %p)" lang="en"/>
+<l:template name="Page" text="Page %p" lang="en"/>
+<l:template name="bridgehead" text="“%t”"/>
+<l:template name="refsection" text="“%t”"/>
+<l:template name="refsect1" text="“%t”"/>
+<l:template name="refsect2" text="“%t”"/>
+<l:template name="refsect3" text="“%t”"/>
+<l:template name="sect1" text="“%t”"/>
+<l:template name="sect2" text="“%t”"/>
+<l:template name="sect3" text="“%t”"/>
+<l:template name="sect4" text="“%t”"/>
+<l:template name="sect5" text="“%t”"/>
+<l:template name="section" text="“%t”"/>
+<l:template name="simplesect" text="“%t”"/>
+</l:context>
+<l:context name="xref-number"><l:template name="answer" text="答: %n"/>
+<l:template name="appendix" text="附錄 %n"/>
+<l:template name="bridgehead" text="節 %n"/>
+<l:template name="chapter" text="章 %n"/>
+<l:template name="equation" text="方程式 %n"/>
+<l:template name="example" text="範例 %n"/>
+<l:template name="figure" text="圖形 %n"/>
+<l:template name="part" text="部 %n"/>
+<l:template name="procedure" text="過程 %n"/>
+<l:template name="productionset" text="Production %n"/>
+<l:template name="qandadiv" text="問:且答: %n"/>
+<l:template name="qandaentry" text="問: %n"/>
+<l:template name="question" text="問: %n"/>
+<l:template name="sect1" text="節 %n"/>
+<l:template name="sect2" text="節 %n"/>
+<l:template name="sect3" text="節 %n"/>
+<l:template name="sect4" text="節 %n"/>
+<l:template name="sect5" text="節 %n"/>
+<l:template name="section" text="節 %n"/>
+<l:template name="table" text="表格 %n"/>
+</l:context>
+<l:context name="xref-number-and-title"><l:template name="appendix" text="附錄 %n, %t"/>
+<l:template name="bridgehead" text="節 %n, “%t”"/>
+<l:template name="chapter" text="章 %n, %t"/>
+<l:template name="equation" text="方程式 %n, “%t”"/>
+<l:template name="example" text="範例 %n, “%t”"/>
+<l:template name="figure" text="圖形 %n, “%t”"/>
+<l:template name="part" text="部 %n, “%t”"/>
+<l:template name="procedure" text="過程 %n, “%t”"/>
+<l:template name="productionset" text="Production %n, “%t”"/>
+<l:template name="qandadiv" text="問:且答: %n, “%t”"/>
+<l:template name="refsect1" text="the section called “%t”"/>
+<l:template name="refsect2" text="the section called “%t”"/>
+<l:template name="refsect3" text="the section called “%t”"/>
+<l:template name="refsection" text="the section called “%t”"/>
+<l:template name="sect1" text="節 %n, “%t”"/>
+<l:template name="sect2" text="節 %n, “%t”"/>
+<l:template name="sect3" text="節 %n, “%t”"/>
+<l:template name="sect4" text="節 %n, “%t”"/>
+<l:template name="sect5" text="節 %n, “%t”"/>
+<l:template name="section" text="節 %n, “%t”"/>
+<l:template name="simplesect" text="the section called “%t”"/>
+<l:template name="table" text="表格 %n, “%t”"/>
+</l:context>
+<l:context name="authorgroup"><l:template name="sep" text=", "/>
+<l:template name="sep2" text=" 且 "/>
+<l:template name="seplast" text=", 且 "/>
+</l:context>
+<l:context name="glossary"><l:template name="see" text="參見 %t"/>
+<l:template name="seealso" text="另參見 %t"/>
+</l:context>
+<l:context name="msgset"><l:template name="MsgAud" text="讀者: "/>
+<l:template name="MsgLevel" text="程度: "/>
+<l:template name="MsgOrig" text="出處: "/>
+</l:context>
+<l:context name="datetime"><l:template name="format" text="m/d/Y" lang="en"/>
+</l:context>
+<l:context name="termdef"><l:template name="prefix" text="[Definition: " lang="en"/>
+<l:template name="suffix" text="]" lang="en"/>
+</l:context>
+<l:context name="datetime-full"><l:template name="January" text="January" lang="en"/>
+<l:template name="February" text="February" lang="en"/>
+<l:template name="March" text="March" lang="en"/>
+<l:template name="April" text="April" lang="en"/>
+<l:template name="May" text="May" lang="en"/>
+<l:template name="June" text="June" lang="en"/>
+<l:template name="July" text="July" lang="en"/>
+<l:template name="August" text="August" lang="en"/>
+<l:template name="September" text="September" lang="en"/>
+<l:template name="October" text="October" lang="en"/>
+<l:template name="November" text="November" lang="en"/>
+<l:template name="December" text="December" lang="en"/>
+<l:template name="Monday" text="Monday" lang="en"/>
+<l:template name="Tuesday" text="Tuesday" lang="en"/>
+<l:template name="Wednesday" text="Wednesday" lang="en"/>
+<l:template name="Thursday" text="Thursday" lang="en"/>
+<l:template name="Friday" text="Friday" lang="en"/>
+<l:template name="Saturday" text="Saturday" lang="en"/>
+<l:template name="Sunday" text="Sunday" lang="en"/>
+</l:context>
+<l:context name="datetime-abbrev"><l:template name="Jan" text="Jan" lang="en"/>
+<l:template name="Feb" text="Feb" lang="en"/>
+<l:template name="Mar" text="Mar" lang="en"/>
+<l:template name="Apr" text="Apr" lang="en"/>
+<l:template name="May" text="May" lang="en"/>
+<l:template name="Jun" text="Jun" lang="en"/>
+<l:template name="Jul" text="Jul" lang="en"/>
+<l:template name="Aug" text="Aug" lang="en"/>
+<l:template name="Sep" text="Sep" lang="en"/>
+<l:template name="Oct" text="Oct" lang="en"/>
+<l:template name="Nov" text="Nov" lang="en"/>
+<l:template name="Dec" text="Dec" lang="en"/>
+<l:template name="Mon" text="Mon" lang="en"/>
+<l:template name="Tue" text="Tue" lang="en"/>
+<l:template name="Wed" text="Wed" lang="en"/>
+<l:template name="Thu" text="Thu" lang="en"/>
+<l:template name="Fri" text="Fri" lang="en"/>
+<l:template name="Sat" text="Sat" lang="en"/>
+<l:template name="Sun" text="Sun" lang="en"/>
+</l:context>
+<l:context name="htmlhelp"><l:template name="langcode" text="0x0404 Chinese (TAIWAN)"/>
+</l:context>
+<l:context name="index"><l:template name="term-separator" text=", " lang="en"/>
+<l:template name="number-separator" text=", " lang="en"/>
+<l:template name="range-separator" text="-" lang="en"/>
+</l:context>
+<l:context name="iso690"><l:template name="lastfirst.sep" text=", " lang="en"/>
+<l:template name="alt.person.two.sep" text=" – " lang="en"/>
+<l:template name="alt.person.last.sep" text=" – " lang="en"/>
+<l:template name="alt.person.more.sep" text=" – " lang="en"/>
+<l:template name="primary.editor" text=" (ed.)" lang="en"/>
+<l:template name="primary.many" text=", et al." lang="en"/>
+<l:template name="primary.sep" text=". " lang="en"/>
+<l:template name="submaintitle.sep" text=": " lang="en"/>
+<l:template name="title.sep" text=". " lang="en"/>
+<l:template name="othertitle.sep" text=", " lang="en"/>
+<l:template name="medium1" text=" [" lang="en"/>
+<l:template name="medium2" text="]" lang="en"/>
+<l:template name="secondary.person.sep" text="; " lang="en"/>
+<l:template name="secondary.sep" text=". " lang="en"/>
+<l:template name="respons.sep" text=". " lang="en"/>
+<l:template name="edition.sep" text=". " lang="en"/>
+<l:template name="edition.serial.sep" text=", " lang="en"/>
+<l:template name="issuing.range" text="-" lang="en"/>
+<l:template name="issuing.div" text=", " lang="en"/>
+<l:template name="issuing.sep" text=". " lang="en"/>
+<l:template name="partnr.sep" text=". " lang="en"/>
+<l:template name="placepubl.sep" text=": " lang="en"/>
+<l:template name="publyear.sep" text=", " lang="en"/>
+<l:template name="pubinfo.sep" text=". " lang="en"/>
+<l:template name="spec.pubinfo.sep" text=", " lang="en"/>
+<l:template name="upd.sep" text=", " lang="en"/>
+<l:template name="datecit1" text=" [cited " lang="en"/>
+<l:template name="datecit2" text="]" lang="en"/>
+<l:template name="extent.sep" text=". " lang="en"/>
+<l:template name="locs.sep" text=", " lang="en"/>
+<l:template name="location.sep" text=". " lang="en"/>
+<l:template name="serie.sep" text=". " lang="en"/>
+<l:template name="notice.sep" text=". " lang="en"/>
+<l:template name="access" text="Available " lang="en"/>
+<l:template name="acctoo" text="Also available " lang="en"/>
+<l:template name="onwww" text="from World Wide Web" lang="en"/>
+<l:template name="oninet" text="from Internet" lang="en"/>
+<l:template name="access.end" text=": " lang="en"/>
+<l:template name="link1" text="&lt;" lang="en"/>
+<l:template name="link2" text="&gt;" lang="en"/>
+<l:template name="access.sep" text=". " lang="en"/>
+<l:template name="isbn" text="ISBN " lang="en"/>
+<l:template name="issn" text="ISSN " lang="en"/>
+<l:template name="stdnum.sep" text=". " lang="en"/>
+<l:template name="patcountry.sep" text=". " lang="en"/>
+<l:template name="pattype.sep" text=", " lang="en"/>
+<l:template name="patnum.sep" text=". " lang="en"/>
+<l:template name="patdate.sep" text=". " lang="en"/>
+</l:context><l:letters lang="en"><l:l i="-1"/>
+<l:l i="0">Symbols</l:l>
+<l:l i="10">A</l:l>
+<l:l i="10">a</l:l>
+<l:l i="10">À</l:l>
+<l:l i="10">à</l:l>
+<l:l i="10">Á</l:l>
+<l:l i="10">á</l:l>
+<l:l i="10">Â</l:l>
+<l:l i="10">â</l:l>
+<l:l i="10">Ã</l:l>
+<l:l i="10">ã</l:l>
+<l:l i="10">Ä</l:l>
+<l:l i="10">ä</l:l>
+<l:l i="10">Å</l:l>
+<l:l i="10">å</l:l>
+<l:l i="10">Ā</l:l>
+<l:l i="10">ā</l:l>
+<l:l i="10">Ă</l:l>
+<l:l i="10">ă</l:l>
+<l:l i="10">Ą</l:l>
+<l:l i="10">ą</l:l>
+<l:l i="10">Ǎ</l:l>
+<l:l i="10">ǎ</l:l>
+<l:l i="10">Ǟ</l:l>
+<l:l i="10">ǟ</l:l>
+<l:l i="10">Ǡ</l:l>
+<l:l i="10">ǡ</l:l>
+<l:l i="10">Ǻ</l:l>
+<l:l i="10">ǻ</l:l>
+<l:l i="10">Ȁ</l:l>
+<l:l i="10">ȁ</l:l>
+<l:l i="10">Ȃ</l:l>
+<l:l i="10">ȃ</l:l>
+<l:l i="10">Ȧ</l:l>
+<l:l i="10">ȧ</l:l>
+<l:l i="10">Ḁ</l:l>
+<l:l i="10">ḁ</l:l>
+<l:l i="10">ẚ</l:l>
+<l:l i="10">Ạ</l:l>
+<l:l i="10">ạ</l:l>
+<l:l i="10">Ả</l:l>
+<l:l i="10">ả</l:l>
+<l:l i="10">Ấ</l:l>
+<l:l i="10">ấ</l:l>
+<l:l i="10">Ầ</l:l>
+<l:l i="10">ầ</l:l>
+<l:l i="10">Ẩ</l:l>
+<l:l i="10">ẩ</l:l>
+<l:l i="10">Ẫ</l:l>
+<l:l i="10">ẫ</l:l>
+<l:l i="10">Ậ</l:l>
+<l:l i="10">ậ</l:l>
+<l:l i="10">Ắ</l:l>
+<l:l i="10">ắ</l:l>
+<l:l i="10">Ằ</l:l>
+<l:l i="10">ằ</l:l>
+<l:l i="10">Ẳ</l:l>
+<l:l i="10">ẳ</l:l>
+<l:l i="10">Ẵ</l:l>
+<l:l i="10">ẵ</l:l>
+<l:l i="10">Ặ</l:l>
+<l:l i="10">ặ</l:l>
+<l:l i="20">B</l:l>
+<l:l i="20">b</l:l>
+<l:l i="20">ƀ</l:l>
+<l:l i="20">Ɓ</l:l>
+<l:l i="20">ɓ</l:l>
+<l:l i="20">Ƃ</l:l>
+<l:l i="20">ƃ</l:l>
+<l:l i="20">Ḃ</l:l>
+<l:l i="20">ḃ</l:l>
+<l:l i="20">Ḅ</l:l>
+<l:l i="20">ḅ</l:l>
+<l:l i="20">Ḇ</l:l>
+<l:l i="20">ḇ</l:l>
+<l:l i="30">C</l:l>
+<l:l i="30">c</l:l>
+<l:l i="30">Ç</l:l>
+<l:l i="30">ç</l:l>
+<l:l i="30">Ć</l:l>
+<l:l i="30">ć</l:l>
+<l:l i="30">Ĉ</l:l>
+<l:l i="30">ĉ</l:l>
+<l:l i="30">Ċ</l:l>
+<l:l i="30">ċ</l:l>
+<l:l i="30">Č</l:l>
+<l:l i="30">č</l:l>
+<l:l i="30">Ƈ</l:l>
+<l:l i="30">ƈ</l:l>
+<l:l i="30">ɕ</l:l>
+<l:l i="30">Ḉ</l:l>
+<l:l i="30">ḉ</l:l>
+<l:l i="40">D</l:l>
+<l:l i="40">d</l:l>
+<l:l i="40">Ď</l:l>
+<l:l i="40">ď</l:l>
+<l:l i="40">Đ</l:l>
+<l:l i="40">đ</l:l>
+<l:l i="40">Ɗ</l:l>
+<l:l i="40">ɗ</l:l>
+<l:l i="40">Ƌ</l:l>
+<l:l i="40">ƌ</l:l>
+<l:l i="40">Dž</l:l>
+<l:l i="40">Dz</l:l>
+<l:l i="40">ȡ</l:l>
+<l:l i="40">ɖ</l:l>
+<l:l i="40">Ḋ</l:l>
+<l:l i="40">ḋ</l:l>
+<l:l i="40">Ḍ</l:l>
+<l:l i="40">ḍ</l:l>
+<l:l i="40">Ḏ</l:l>
+<l:l i="40">ḏ</l:l>
+<l:l i="40">Ḑ</l:l>
+<l:l i="40">ḑ</l:l>
+<l:l i="40">Ḓ</l:l>
+<l:l i="40">ḓ</l:l>
+<l:l i="50">E</l:l>
+<l:l i="50">e</l:l>
+<l:l i="50">È</l:l>
+<l:l i="50">è</l:l>
+<l:l i="50">É</l:l>
+<l:l i="50">é</l:l>
+<l:l i="50">Ê</l:l>
+<l:l i="50">ê</l:l>
+<l:l i="50">Ë</l:l>
+<l:l i="50">ë</l:l>
+<l:l i="50">Ē</l:l>
+<l:l i="50">ē</l:l>
+<l:l i="50">Ĕ</l:l>
+<l:l i="50">ĕ</l:l>
+<l:l i="50">Ė</l:l>
+<l:l i="50">ė</l:l>
+<l:l i="50">Ę</l:l>
+<l:l i="50">ę</l:l>
+<l:l i="50">Ě</l:l>
+<l:l i="50">ě</l:l>
+<l:l i="50">Ȅ</l:l>
+<l:l i="50">ȅ</l:l>
+<l:l i="50">Ȇ</l:l>
+<l:l i="50">ȇ</l:l>
+<l:l i="50">Ȩ</l:l>
+<l:l i="50">ȩ</l:l>
+<l:l i="50">Ḕ</l:l>
+<l:l i="50">ḕ</l:l>
+<l:l i="50">Ḗ</l:l>
+<l:l i="50">ḗ</l:l>
+<l:l i="50">Ḙ</l:l>
+<l:l i="50">ḙ</l:l>
+<l:l i="50">Ḛ</l:l>
+<l:l i="50">ḛ</l:l>
+<l:l i="50">Ḝ</l:l>
+<l:l i="50">ḝ</l:l>
+<l:l i="50">Ẹ</l:l>
+<l:l i="50">ẹ</l:l>
+<l:l i="50">Ẻ</l:l>
+<l:l i="50">ẻ</l:l>
+<l:l i="50">Ẽ</l:l>
+<l:l i="50">ẽ</l:l>
+<l:l i="50">Ế</l:l>
+<l:l i="50">ế</l:l>
+<l:l i="50">Ề</l:l>
+<l:l i="50">ề</l:l>
+<l:l i="50">Ể</l:l>
+<l:l i="50">ể</l:l>
+<l:l i="50">Ễ</l:l>
+<l:l i="50">ễ</l:l>
+<l:l i="50">Ệ</l:l>
+<l:l i="50">ệ</l:l>
+<l:l i="60">F</l:l>
+<l:l i="60">f</l:l>
+<l:l i="60">Ƒ</l:l>
+<l:l i="60">ƒ</l:l>
+<l:l i="60">Ḟ</l:l>
+<l:l i="60">ḟ</l:l>
+<l:l i="70">G</l:l>
+<l:l i="70">g</l:l>
+<l:l i="70">Ĝ</l:l>
+<l:l i="70">ĝ</l:l>
+<l:l i="70">Ğ</l:l>
+<l:l i="70">ğ</l:l>
+<l:l i="70">Ġ</l:l>
+<l:l i="70">ġ</l:l>
+<l:l i="70">Ģ</l:l>
+<l:l i="70">ģ</l:l>
+<l:l i="70">Ɠ</l:l>
+<l:l i="70">ɠ</l:l>
+<l:l i="70">Ǥ</l:l>
+<l:l i="70">ǥ</l:l>
+<l:l i="70">Ǧ</l:l>
+<l:l i="70">ǧ</l:l>
+<l:l i="70">Ǵ</l:l>
+<l:l i="70">ǵ</l:l>
+<l:l i="70">Ḡ</l:l>
+<l:l i="70">ḡ</l:l>
+<l:l i="80">H</l:l>
+<l:l i="80">h</l:l>
+<l:l i="80">Ĥ</l:l>
+<l:l i="80">ĥ</l:l>
+<l:l i="80">Ħ</l:l>
+<l:l i="80">ħ</l:l>
+<l:l i="80">Ȟ</l:l>
+<l:l i="80">ȟ</l:l>
+<l:l i="80">ɦ</l:l>
+<l:l i="80">Ḣ</l:l>
+<l:l i="80">ḣ</l:l>
+<l:l i="80">Ḥ</l:l>
+<l:l i="80">ḥ</l:l>
+<l:l i="80">Ḧ</l:l>
+<l:l i="80">ḧ</l:l>
+<l:l i="80">Ḩ</l:l>
+<l:l i="80">ḩ</l:l>
+<l:l i="80">Ḫ</l:l>
+<l:l i="80">ḫ</l:l>
+<l:l i="80">ẖ</l:l>
+<l:l i="90">I</l:l>
+<l:l i="90">i</l:l>
+<l:l i="90">Ì</l:l>
+<l:l i="90">ì</l:l>
+<l:l i="90">Í</l:l>
+<l:l i="90">í</l:l>
+<l:l i="90">Î</l:l>
+<l:l i="90">î</l:l>
+<l:l i="90">Ï</l:l>
+<l:l i="90">ï</l:l>
+<l:l i="90">Ĩ</l:l>
+<l:l i="90">ĩ</l:l>
+<l:l i="90">Ī</l:l>
+<l:l i="90">ī</l:l>
+<l:l i="90">Ĭ</l:l>
+<l:l i="90">ĭ</l:l>
+<l:l i="90">Į</l:l>
+<l:l i="90">į</l:l>
+<l:l i="90">İ</l:l>
+<l:l i="90">Ɨ</l:l>
+<l:l i="90">ɨ</l:l>
+<l:l i="90">Ǐ</l:l>
+<l:l i="90">ǐ</l:l>
+<l:l i="90">Ȉ</l:l>
+<l:l i="90">ȉ</l:l>
+<l:l i="90">Ȋ</l:l>
+<l:l i="90">ȋ</l:l>
+<l:l i="90">Ḭ</l:l>
+<l:l i="90">ḭ</l:l>
+<l:l i="90">Ḯ</l:l>
+<l:l i="90">ḯ</l:l>
+<l:l i="90">Ỉ</l:l>
+<l:l i="90">ỉ</l:l>
+<l:l i="90">Ị</l:l>
+<l:l i="90">ị</l:l>
+<l:l i="100">J</l:l>
+<l:l i="100">j</l:l>
+<l:l i="100">Ĵ</l:l>
+<l:l i="100">ĵ</l:l>
+<l:l i="100">ǰ</l:l>
+<l:l i="100">ʝ</l:l>
+<l:l i="110">K</l:l>
+<l:l i="110">k</l:l>
+<l:l i="110">Ķ</l:l>
+<l:l i="110">ķ</l:l>
+<l:l i="110">Ƙ</l:l>
+<l:l i="110">ƙ</l:l>
+<l:l i="110">Ǩ</l:l>
+<l:l i="110">ǩ</l:l>
+<l:l i="110">Ḱ</l:l>
+<l:l i="110">ḱ</l:l>
+<l:l i="110">Ḳ</l:l>
+<l:l i="110">ḳ</l:l>
+<l:l i="110">Ḵ</l:l>
+<l:l i="110">ḵ</l:l>
+<l:l i="120">L</l:l>
+<l:l i="120">l</l:l>
+<l:l i="120">Ĺ</l:l>
+<l:l i="120">ĺ</l:l>
+<l:l i="120">Ļ</l:l>
+<l:l i="120">ļ</l:l>
+<l:l i="120">Ľ</l:l>
+<l:l i="120">ľ</l:l>
+<l:l i="120">Ŀ</l:l>
+<l:l i="120">ŀ</l:l>
+<l:l i="120">Ł</l:l>
+<l:l i="120">ł</l:l>
+<l:l i="120">ƚ</l:l>
+<l:l i="120">Lj</l:l>
+<l:l i="120">ȴ</l:l>
+<l:l i="120">ɫ</l:l>
+<l:l i="120">ɬ</l:l>
+<l:l i="120">ɭ</l:l>
+<l:l i="120">Ḷ</l:l>
+<l:l i="120">ḷ</l:l>
+<l:l i="120">Ḹ</l:l>
+<l:l i="120">ḹ</l:l>
+<l:l i="120">Ḻ</l:l>
+<l:l i="120">ḻ</l:l>
+<l:l i="120">Ḽ</l:l>
+<l:l i="120">ḽ</l:l>
+<l:l i="130">M</l:l>
+<l:l i="130">m</l:l>
+<l:l i="130">ɱ</l:l>
+<l:l i="130">Ḿ</l:l>
+<l:l i="130">ḿ</l:l>
+<l:l i="130">Ṁ</l:l>
+<l:l i="130">ṁ</l:l>
+<l:l i="130">Ṃ</l:l>
+<l:l i="130">ṃ</l:l>
+<l:l i="140">N</l:l>
+<l:l i="140">n</l:l>
+<l:l i="140">Ñ</l:l>
+<l:l i="140">ñ</l:l>
+<l:l i="140">Ń</l:l>
+<l:l i="140">ń</l:l>
+<l:l i="140">Ņ</l:l>
+<l:l i="140">ņ</l:l>
+<l:l i="140">Ň</l:l>
+<l:l i="140">ň</l:l>
+<l:l i="140">Ɲ</l:l>
+<l:l i="140">ɲ</l:l>
+<l:l i="140">ƞ</l:l>
+<l:l i="140">Ƞ</l:l>
+<l:l i="140">Nj</l:l>
+<l:l i="140">Ǹ</l:l>
+<l:l i="140">ǹ</l:l>
+<l:l i="140">ȵ</l:l>
+<l:l i="140">ɳ</l:l>
+<l:l i="140">Ṅ</l:l>
+<l:l i="140">ṅ</l:l>
+<l:l i="140">Ṇ</l:l>
+<l:l i="140">ṇ</l:l>
+<l:l i="140">Ṉ</l:l>
+<l:l i="140">ṉ</l:l>
+<l:l i="140">Ṋ</l:l>
+<l:l i="140">ṋ</l:l>
+<l:l i="150">O</l:l>
+<l:l i="150">o</l:l>
+<l:l i="150">Ò</l:l>
+<l:l i="150">ò</l:l>
+<l:l i="150">Ó</l:l>
+<l:l i="150">ó</l:l>
+<l:l i="150">Ô</l:l>
+<l:l i="150">ô</l:l>
+<l:l i="150">Õ</l:l>
+<l:l i="150">õ</l:l>
+<l:l i="150">Ö</l:l>
+<l:l i="150">ö</l:l>
+<l:l i="150">Ø</l:l>
+<l:l i="150">ø</l:l>
+<l:l i="150">Ō</l:l>
+<l:l i="150">ō</l:l>
+<l:l i="150">Ŏ</l:l>
+<l:l i="150">ŏ</l:l>
+<l:l i="150">Ő</l:l>
+<l:l i="150">ő</l:l>
+<l:l i="150">Ɵ</l:l>
+<l:l i="150">Ơ</l:l>
+<l:l i="150">ơ</l:l>
+<l:l i="150">Ǒ</l:l>
+<l:l i="150">ǒ</l:l>
+<l:l i="150">Ǫ</l:l>
+<l:l i="150">ǫ</l:l>
+<l:l i="150">Ǭ</l:l>
+<l:l i="150">ǭ</l:l>
+<l:l i="150">Ǿ</l:l>
+<l:l i="150">ǿ</l:l>
+<l:l i="150">Ȍ</l:l>
+<l:l i="150">ȍ</l:l>
+<l:l i="150">Ȏ</l:l>
+<l:l i="150">ȏ</l:l>
+<l:l i="150">Ȫ</l:l>
+<l:l i="150">ȫ</l:l>
+<l:l i="150">Ȭ</l:l>
+<l:l i="150">ȭ</l:l>
+<l:l i="150">Ȯ</l:l>
+<l:l i="150">ȯ</l:l>
+<l:l i="150">Ȱ</l:l>
+<l:l i="150">ȱ</l:l>
+<l:l i="150">Ṍ</l:l>
+<l:l i="150">ṍ</l:l>
+<l:l i="150">Ṏ</l:l>
+<l:l i="150">ṏ</l:l>
+<l:l i="150">Ṑ</l:l>
+<l:l i="150">ṑ</l:l>
+<l:l i="150">Ṓ</l:l>
+<l:l i="150">ṓ</l:l>
+<l:l i="150">Ọ</l:l>
+<l:l i="150">ọ</l:l>
+<l:l i="150">Ỏ</l:l>
+<l:l i="150">ỏ</l:l>
+<l:l i="150">Ố</l:l>
+<l:l i="150">ố</l:l>
+<l:l i="150">Ồ</l:l>
+<l:l i="150">ồ</l:l>
+<l:l i="150">Ổ</l:l>
+<l:l i="150">ổ</l:l>
+<l:l i="150">Ỗ</l:l>
+<l:l i="150">ỗ</l:l>
+<l:l i="150">Ộ</l:l>
+<l:l i="150">ộ</l:l>
+<l:l i="150">Ớ</l:l>
+<l:l i="150">ớ</l:l>
+<l:l i="150">Ờ</l:l>
+<l:l i="150">ờ</l:l>
+<l:l i="150">Ở</l:l>
+<l:l i="150">ở</l:l>
+<l:l i="150">Ỡ</l:l>
+<l:l i="150">ỡ</l:l>
+<l:l i="150">Ợ</l:l>
+<l:l i="150">ợ</l:l>
+<l:l i="160">P</l:l>
+<l:l i="160">p</l:l>
+<l:l i="160">Ƥ</l:l>
+<l:l i="160">ƥ</l:l>
+<l:l i="160">Ṕ</l:l>
+<l:l i="160">ṕ</l:l>
+<l:l i="160">Ṗ</l:l>
+<l:l i="160">ṗ</l:l>
+<l:l i="170">Q</l:l>
+<l:l i="170">q</l:l>
+<l:l i="170">ʠ</l:l>
+<l:l i="180">R</l:l>
+<l:l i="180">r</l:l>
+<l:l i="180">Ŕ</l:l>
+<l:l i="180">ŕ</l:l>
+<l:l i="180">Ŗ</l:l>
+<l:l i="180">ŗ</l:l>
+<l:l i="180">Ř</l:l>
+<l:l i="180">ř</l:l>
+<l:l i="180">Ȑ</l:l>
+<l:l i="180">ȑ</l:l>
+<l:l i="180">Ȓ</l:l>
+<l:l i="180">ȓ</l:l>
+<l:l i="180">ɼ</l:l>
+<l:l i="180">ɽ</l:l>
+<l:l i="180">ɾ</l:l>
+<l:l i="180">Ṙ</l:l>
+<l:l i="180">ṙ</l:l>
+<l:l i="180">Ṛ</l:l>
+<l:l i="180">ṛ</l:l>
+<l:l i="180">Ṝ</l:l>
+<l:l i="180">ṝ</l:l>
+<l:l i="180">Ṟ</l:l>
+<l:l i="180">ṟ</l:l>
+<l:l i="190">S</l:l>
+<l:l i="190">s</l:l>
+<l:l i="190">Ś</l:l>
+<l:l i="190">ś</l:l>
+<l:l i="190">Ŝ</l:l>
+<l:l i="190">ŝ</l:l>
+<l:l i="190">Ş</l:l>
+<l:l i="190">ş</l:l>
+<l:l i="190">Š</l:l>
+<l:l i="190">š</l:l>
+<l:l i="190">Ș</l:l>
+<l:l i="190">ș</l:l>
+<l:l i="190">ʂ</l:l>
+<l:l i="190">Ṡ</l:l>
+<l:l i="190">ṡ</l:l>
+<l:l i="190">Ṣ</l:l>
+<l:l i="190">ṣ</l:l>
+<l:l i="190">Ṥ</l:l>
+<l:l i="190">ṥ</l:l>
+<l:l i="190">Ṧ</l:l>
+<l:l i="190">ṧ</l:l>
+<l:l i="190">Ṩ</l:l>
+<l:l i="190">ṩ</l:l>
+<l:l i="200">T</l:l>
+<l:l i="200">t</l:l>
+<l:l i="200">Ţ</l:l>
+<l:l i="200">ţ</l:l>
+<l:l i="200">Ť</l:l>
+<l:l i="200">ť</l:l>
+<l:l i="200">Ŧ</l:l>
+<l:l i="200">ŧ</l:l>
+<l:l i="200">ƫ</l:l>
+<l:l i="200">Ƭ</l:l>
+<l:l i="200">ƭ</l:l>
+<l:l i="200">Ʈ</l:l>
+<l:l i="200">ʈ</l:l>
+<l:l i="200">Ț</l:l>
+<l:l i="200">ț</l:l>
+<l:l i="200">ȶ</l:l>
+<l:l i="200">Ṫ</l:l>
+<l:l i="200">ṫ</l:l>
+<l:l i="200">Ṭ</l:l>
+<l:l i="200">ṭ</l:l>
+<l:l i="200">Ṯ</l:l>
+<l:l i="200">ṯ</l:l>
+<l:l i="200">Ṱ</l:l>
+<l:l i="200">ṱ</l:l>
+<l:l i="200">ẗ</l:l>
+<l:l i="210">U</l:l>
+<l:l i="210">u</l:l>
+<l:l i="210">Ù</l:l>
+<l:l i="210">ù</l:l>
+<l:l i="210">Ú</l:l>
+<l:l i="210">ú</l:l>
+<l:l i="210">Û</l:l>
+<l:l i="210">û</l:l>
+<l:l i="210">Ü</l:l>
+<l:l i="210">ü</l:l>
+<l:l i="210">Ũ</l:l>
+<l:l i="210">ũ</l:l>
+<l:l i="210">Ū</l:l>
+<l:l i="210">ū</l:l>
+<l:l i="210">Ŭ</l:l>
+<l:l i="210">ŭ</l:l>
+<l:l i="210">Ů</l:l>
+<l:l i="210">ů</l:l>
+<l:l i="210">Ű</l:l>
+<l:l i="210">ű</l:l>
+<l:l i="210">Ų</l:l>
+<l:l i="210">ų</l:l>
+<l:l i="210">Ư</l:l>
+<l:l i="210">ư</l:l>
+<l:l i="210">Ǔ</l:l>
+<l:l i="210">ǔ</l:l>
+<l:l i="210">Ǖ</l:l>
+<l:l i="210">ǖ</l:l>
+<l:l i="210">Ǘ</l:l>
+<l:l i="210">ǘ</l:l>
+<l:l i="210">Ǚ</l:l>
+<l:l i="210">ǚ</l:l>
+<l:l i="210">Ǜ</l:l>
+<l:l i="210">ǜ</l:l>
+<l:l i="210">Ȕ</l:l>
+<l:l i="210">ȕ</l:l>
+<l:l i="210">Ȗ</l:l>
+<l:l i="210">ȗ</l:l>
+<l:l i="210">Ṳ</l:l>
+<l:l i="210">ṳ</l:l>
+<l:l i="210">Ṵ</l:l>
+<l:l i="210">ṵ</l:l>
+<l:l i="210">Ṷ</l:l>
+<l:l i="210">ṷ</l:l>
+<l:l i="210">Ṹ</l:l>
+<l:l i="210">ṹ</l:l>
+<l:l i="210">Ṻ</l:l>
+<l:l i="210">ṻ</l:l>
+<l:l i="210">Ụ</l:l>
+<l:l i="210">ụ</l:l>
+<l:l i="210">Ủ</l:l>
+<l:l i="210">ủ</l:l>
+<l:l i="210">Ứ</l:l>
+<l:l i="210">ứ</l:l>
+<l:l i="210">Ừ</l:l>
+<l:l i="210">ừ</l:l>
+<l:l i="210">Ử</l:l>
+<l:l i="210">ử</l:l>
+<l:l i="210">Ữ</l:l>
+<l:l i="210">ữ</l:l>
+<l:l i="210">Ự</l:l>
+<l:l i="210">ự</l:l>
+<l:l i="220">V</l:l>
+<l:l i="220">v</l:l>
+<l:l i="220">Ʋ</l:l>
+<l:l i="220">ʋ</l:l>
+<l:l i="220">Ṽ</l:l>
+<l:l i="220">ṽ</l:l>
+<l:l i="220">Ṿ</l:l>
+<l:l i="220">ṿ</l:l>
+<l:l i="230">W</l:l>
+<l:l i="230">w</l:l>
+<l:l i="230">Ŵ</l:l>
+<l:l i="230">ŵ</l:l>
+<l:l i="230">Ẁ</l:l>
+<l:l i="230">ẁ</l:l>
+<l:l i="230">Ẃ</l:l>
+<l:l i="230">ẃ</l:l>
+<l:l i="230">Ẅ</l:l>
+<l:l i="230">ẅ</l:l>
+<l:l i="230">Ẇ</l:l>
+<l:l i="230">ẇ</l:l>
+<l:l i="230">Ẉ</l:l>
+<l:l i="230">ẉ</l:l>
+<l:l i="230">ẘ</l:l>
+<l:l i="240">X</l:l>
+<l:l i="240">x</l:l>
+<l:l i="240">Ẋ</l:l>
+<l:l i="240">ẋ</l:l>
+<l:l i="240">Ẍ</l:l>
+<l:l i="240">ẍ</l:l>
+<l:l i="250">Y</l:l>
+<l:l i="250">y</l:l>
+<l:l i="250">Ý</l:l>
+<l:l i="250">ý</l:l>
+<l:l i="250">ÿ</l:l>
+<l:l i="250">Ÿ</l:l>
+<l:l i="250">Ŷ</l:l>
+<l:l i="250">ŷ</l:l>
+<l:l i="250">Ƴ</l:l>
+<l:l i="250">ƴ</l:l>
+<l:l i="250">Ȳ</l:l>
+<l:l i="250">ȳ</l:l>
+<l:l i="250">Ẏ</l:l>
+<l:l i="250">ẏ</l:l>
+<l:l i="250">ẙ</l:l>
+<l:l i="250">Ỳ</l:l>
+<l:l i="250">ỳ</l:l>
+<l:l i="250">Ỵ</l:l>
+<l:l i="250">ỵ</l:l>
+<l:l i="250">Ỷ</l:l>
+<l:l i="250">ỷ</l:l>
+<l:l i="250">Ỹ</l:l>
+<l:l i="250">ỹ</l:l>
+<l:l i="260">Z</l:l>
+<l:l i="260">z</l:l>
+<l:l i="260">Ź</l:l>
+<l:l i="260">ź</l:l>
+<l:l i="260">Ż</l:l>
+<l:l i="260">ż</l:l>
+<l:l i="260">Ž</l:l>
+<l:l i="260">ž</l:l>
+<l:l i="260">Ƶ</l:l>
+<l:l i="260">ƶ</l:l>
+<l:l i="260">Ȥ</l:l>
+<l:l i="260">ȥ</l:l>
+<l:l i="260">ʐ</l:l>
+<l:l i="260">ʑ</l:l>
+<l:l i="260">Ẑ</l:l>
+<l:l i="260">ẑ</l:l>
+<l:l i="260">Ẓ</l:l>
+<l:l i="260">ẓ</l:l>
+<l:l i="260">Ẕ</l:l>
+<l:l i="260">ẕ</l:l>
+</l:letters>
+</l:l10n>

+ 126 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/admon.xsl

@@ -0,0 +1,126 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<xsl:template match="note|important|warning|caution|tip">
+  <xsl:choose>
+    <xsl:when test="$admon.graphics != 0">
+      <xsl:call-template name="graphical.admonition"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="nongraphical.admonition"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*" mode="admon.graphic.width">
+  <xsl:param name="node" select="."/>
+  <xsl:text>36pt</xsl:text>
+</xsl:template>
+
+<xsl:template name="admon.graphic">
+  <xsl:param name="node" select="."/>
+
+  <xsl:variable name="filename">
+    <xsl:value-of select="$admon.graphics.path"/>
+    <xsl:choose>
+      <xsl:when test="local-name($node)='note'">note</xsl:when>
+      <xsl:when test="local-name($node)='warning'">warning</xsl:when>
+      <xsl:when test="local-name($node)='caution'">caution</xsl:when>
+      <xsl:when test="local-name($node)='tip'">tip</xsl:when>
+      <xsl:when test="local-name($node)='important'">important</xsl:when>
+      <xsl:otherwise>note</xsl:otherwise>
+    </xsl:choose>
+    <xsl:value-of select="$admon.graphics.extension"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$passivetex.extensions != 0
+                    or $fop.extensions != 0
+                    or $arbortext.extensions != 0">
+      <xsl:value-of select="$filename"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>url(</xsl:text>
+      <xsl:value-of select="$filename"/>
+      <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="graphical.admonition">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <xsl:variable name="graphic.width">
+     <xsl:apply-templates select="." mode="admon.graphic.width"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}"
+            xsl:use-attribute-sets="graphical.admonition.properties">
+    <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
+                    provisional-label-separation="18pt">
+      <fo:list-item>
+          <fo:list-item-label end-indent="label-end()">
+            <fo:block>
+              <fo:external-graphic width="auto" height="auto"
+                                         content-width="{$graphic.width}" >
+                <xsl:attribute name="src">
+                  <xsl:call-template name="admon.graphic"/>
+                </xsl:attribute>
+              </fo:external-graphic>
+            </fo:block>
+          </fo:list-item-label>
+          <fo:list-item-body start-indent="body-start()">
+            <xsl:if test="$admon.textlabel != 0 or title or info/title">
+              <fo:block xsl:use-attribute-sets="admonition.title.properties">
+                <xsl:apply-templates select="." mode="object.title.markup"/>
+              </fo:block>
+            </xsl:if>
+            <fo:block xsl:use-attribute-sets="admonition.properties">
+              <xsl:apply-templates/>
+            </fo:block>
+          </fo:list-item-body>
+      </fo:list-item>
+    </fo:list-block>
+  </fo:block>
+</xsl:template>
+
+<xsl:template name="nongraphical.admonition">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}"
+            xsl:use-attribute-sets="nongraphical.admonition.properties">
+    <xsl:if test="$admon.textlabel != 0 or title or info/title">
+      <fo:block keep-with-next.within-column='always'
+                xsl:use-attribute-sets="admonition.title.properties">
+         <xsl:apply-templates select="." mode="object.title.markup"/>
+      </fo:block>
+    </xsl:if>
+
+    <fo:block xsl:use-attribute-sets="admonition.properties">
+      <xsl:apply-templates/>
+    </fo:block>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="note/title"></xsl:template>
+<xsl:template match="important/title"></xsl:template>
+<xsl:template match="warning/title"></xsl:template>
+<xsl:template match="caution/title"></xsl:template>
+<xsl:template match="tip/title"></xsl:template>
+
+</xsl:stylesheet>

+ 18 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/annotations.xsl

@@ -0,0 +1,18 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<xsl:template match="annotation"/>
+
+</xsl:stylesheet>

+ 178 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autoidx-kimber.xsl

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

+ 150 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autoidx-kosek.xsl

@@ -0,0 +1,150 @@
+<?xml version="1.0"?>
+<!DOCTYPE xsl:stylesheet [
+
+<!ENTITY primary   'normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = ""]))'>
+<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas) or @sortas = ""]))'>
+<!ENTITY tertiary  'normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas) or @sortas = ""]))'>
+
+<!ENTITY sep '" "'>
+<!-- Documents using the kimber index method must have a lang attribute -->
+<!-- Only one of these should be present in the entity -->
+
+<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())
+                and ($role = @role or $type = @type or
+                (string-length($role) = 0 and string-length($type) = 0))'>
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                xmlns:rx="http://www.renderx.com/XSL/Extensions"
+                xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                xmlns:i="urn:cz-kosek:functions:index"
+                xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
+                xmlns:func="http://exslt.org/functions"
+                xmlns:exslt="http://exslt.org/common"
+                extension-element-prefixes="func exslt"
+                exclude-result-prefixes="func exslt i l"
+                version="1.0">
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the DocBook XSL Stylesheet distribution.
+     See ../README or http://docbook.sf.net/ for copyright
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+<!-- The "kosek" method contributed by Jirka Kosek. -->
+
+<xsl:include href="../common/autoidx-kosek.xsl"/>
+
+<xsl:template name="generate-kosek-index">
+  <xsl:param name="scope" select="NOTANODE"/>
+
+  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
+  <xsl:if test="contains($vendor, 'libxslt')">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
+      <xsl:text>work with the xsltproc XSLT processor.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:if test="contains($vendor, 'Saxonica')">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
+      <xsl:text>work with the Saxon 8 XSLT processor.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+
+  <xsl:if test="not(function-available('exslt:node-set') or
+                    function-available('exslt:nodeSet'))">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kosek' index method requires the </xsl:text>
+      <xsl:text>exslt:node-set() function. Use a processor that </xsl:text>
+      <xsl:text>has it, or use a different index method.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:if test="not(function-available('i:group-index'))">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kosek' index method requires the&#xA;</xsl:text>
+      <xsl:text>index extension functions be imported:&#xA;</xsl:text>
+      <xsl:text>  xsl:import href="common/autoidx-kosek.xsl"</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:variable name="role">
+    <xsl:if test="$index.on.role != 0">
+      <xsl:value-of select="@role"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="type">
+    <xsl:if test="$index.on.type != 0">
+      <xsl:value-of select="@type"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="terms"
+                select="//indexterm[count(.|key('group-code',
+                                          i:group-index(&primary;))
+                                          [&scope;][1]) = 1
+                                and not(@class = 'endofrange')]"/>
+  <fo:block>
+    <xsl:apply-templates select="$terms" mode="index-div-kosek">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="i:group-index(&primary;)" data-type="number"/>
+    </xsl:apply-templates>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-div-kosek">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:variable name="key"
+                select="i:group-index(&primary;)"/>
+
+  <xsl:variable name="lang">
+    <xsl:call-template name="l10n.language"/>
+  </xsl:variable>
+
+  <xsl:if test="key('group-code', $key)[&scope;]
+                [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
+    <fo:block>
+      <xsl:call-template name="indexdiv.title">
+        <xsl:with-param name="titlecontent">
+          <xsl:choose>
+            <xsl:when test="$key = 0">
+              <xsl:call-template name="gentext">
+                <xsl:with-param name="key" select="'index symbols'"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="i:group-letter($key)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+      </xsl:call-template>
+      <fo:block>
+        <xsl:apply-templates select="key('group-code', $key)[&scope;]
+                                     [count(.|key('primary', &primary;)
+                                     [&scope;][1])=1]"
+                             mode="index-primary">
+          <xsl:sort select="&primary;" lang="{$lang}"/>
+          <xsl:with-param name="scope" select="$scope"/>
+          <xsl:with-param name="role" select="$role"/>
+          <xsl:with-param name="type" select="$type"/>
+        </xsl:apply-templates>
+      </fo:block>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>

+ 20 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autoidx-ng.xsl

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

+ 1310 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/autoidx.xsl

@@ -0,0 +1,1310 @@
+<?xml version="1.0"?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY % common.entities SYSTEM "../common/entities.ent">
+%common.entities;
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                xmlns:rx="http://www.renderx.com/XSL/Extensions"
+                xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"
+                xmlns:exslt="http://exslt.org/common"
+                extension-element-prefixes="exslt"
+                exclude-result-prefixes="exslt"
+                version="1.0">
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the DocBook XSL Stylesheet distribution.
+     See ../README or http://docbook.sf.net/ for copyright
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+<!-- The "basic" method derived from Jeni Tennison's work. -->
+<!-- The "kosek" method contributed by Jirka Kosek. -->
+<!-- The "kimber" method contributed by Eliot Kimber of Innodata Isogen. -->
+
+<!-- Importing module for kimber or kosek method overrides one of these -->
+<xsl:param name="kimber.imported" select="0"/>
+<xsl:param name="kosek.imported" select="0"/>
+
+<!-- These keys used primary in all methods -->
+<xsl:key name="letter"
+         match="indexterm"
+         use="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
+
+<xsl:key name="primary"
+         match="indexterm"
+         use="&primary;"/>
+
+<xsl:key name="secondary"
+         match="indexterm"
+         use="concat(&primary;, &sep;, &secondary;)"/>
+
+<xsl:key name="tertiary"
+         match="indexterm"
+         use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
+
+<xsl:key name="endofrange"
+         match="indexterm[@class='endofrange']"
+         use="@startref"/>
+
+<xsl:key name="see-also"
+         match="indexterm[seealso]"
+         use="concat(&primary;, &sep;, 
+                     &secondary;, &sep;, 
+                     &tertiary;, &sep;, seealso)"/>
+
+<xsl:key name="see"
+         match="indexterm[see]"
+         use="concat(&primary;, &sep;, 
+                     &secondary;, &sep;, 
+                     &tertiary;, &sep;, see)"/>
+
+
+<xsl:template name="generate-index">
+  <xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
+
+  <xsl:choose>
+    <xsl:when test="$index.method = 'kosek'">
+      <xsl:call-template name="generate-kosek-index">
+        <xsl:with-param name="scope" select="$scope"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$index.method = 'kimber'">
+      <xsl:call-template name="generate-kimber-index">
+        <xsl:with-param name="scope" select="$scope"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:call-template name="generate-basic-index">
+        <xsl:with-param name="scope" select="$scope"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+      
+<xsl:template name="generate-basic-index">
+  <xsl:param name="scope" select="NOTANODE"/>
+
+  <xsl:variable name="role">
+    <xsl:if test="$index.on.role != 0">
+      <xsl:value-of select="@role"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="type">
+    <xsl:if test="$index.on.type != 0">
+      <xsl:value-of select="@type"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="terms"
+                select="//indexterm
+                        [count(.|key('letter',
+                          translate(substring(&primary;, 1, 1),
+                             &lowercase;,
+                             &uppercase;))
+                          [&scope;][1]) = 1
+                          and not(@class = 'endofrange')]"/>
+
+  <xsl:variable name="alphabetical"
+                select="$terms[contains(concat(&lowercase;, &uppercase;),
+                                        substring(&primary;, 1, 1))]"/>
+
+  <xsl:variable name="others" select="$terms[not(contains(
+                                        concat(&lowercase;,
+                                        &uppercase;),
+                                        substring(&primary;, 1, 1)))]"/>
+  <fo:block>
+    <xsl:if test="$others">
+      <xsl:call-template name="indexdiv.title">
+        <xsl:with-param name="titlecontent">
+          <xsl:call-template name="gentext">
+            <xsl:with-param name="key" select="'index symbols'"/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+
+      <fo:block>
+        <xsl:apply-templates select="$others[count(.|key('primary',
+                                     &primary;)[&scope;][1]) = 1]"
+                             mode="index-symbol-div">
+          <xsl:with-param name="scope" select="$scope"/>
+          <xsl:with-param name="role" select="$role"/>
+          <xsl:with-param name="type" select="$type"/>
+          <xsl:sort select="translate(&primary;, &lowercase;, 
+                            &uppercase;)"/>
+        </xsl:apply-templates>
+      </fo:block>
+    </xsl:if>
+
+    <xsl:apply-templates select="$alphabetical[count(.|key('letter',
+                                 translate(substring(&primary;, 1, 1),
+                                           &lowercase;,&uppercase;))
+                                           [&scope;][1]) = 1]"
+                         mode="index-div-basic">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+  </fo:block>
+</xsl:template>
+
+<!-- This template not used if fo/autoidx-kosek.xsl is imported -->
+<xsl:template name="generate-kosek-index">
+  <xsl:param name="scope" select="NOTANODE"/>
+
+  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
+  <xsl:if test="contains($vendor, 'libxslt')">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kosek' index method does not </xsl:text>
+      <xsl:text>work with the xsltproc XSLT processor.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+
+  <xsl:if test="not(function-available('exslt:node-set') or
+                    function-available('exslt:nodeSet'))">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kosek' index method requires the </xsl:text>
+      <xsl:text>exslt:node-set() function. Use a processor that </xsl:text>
+      <xsl:text>has it, or use a different index method.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:if test="$kosek.imported = 0">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kosek' index method requires the&#xA;</xsl:text>
+      <xsl:text>kosek index extensions be imported:&#xA;</xsl:text>
+      <xsl:text>  xsl:import href="fo/autoidx-kosek.xsl"</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+</xsl:template>
+
+
+<!-- This template not used if fo/autoidx-kimber.xsl is imported -->
+<xsl:template name="generate-kimber-index">
+  <xsl:param name="scope" select="NOTANODE"/>
+
+  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
+  <xsl:if test="not(contains($vendor, 'SAXON '))">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kimber' index method requires the </xsl:text>
+      <xsl:text>Saxon version 6 or 8 XSLT processor.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:if test="$kimber.imported = 0">
+    <xsl:message terminate="yes">
+      <xsl:text>ERROR: the 'kimber' index method requires the&#xA;</xsl:text>
+      <xsl:text>kimber index extensions be imported:&#xA;</xsl:text>
+      <xsl:text>  xsl:import href="fo/autoidx-kimber.xsl"</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-div-basic">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:variable name="key"
+                select="translate(substring(&primary;, 1, 1),
+                         &lowercase;,&uppercase;)"/>
+
+  <xsl:if test="key('letter', $key)[&scope;]
+                [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
+    <fo:block>
+      <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
+        <xsl:call-template name="indexdiv.title">
+          <xsl:with-param name="titlecontent">
+            <xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:block xsl:use-attribute-sets="index.entry.properties">
+        <xsl:apply-templates select="key('letter', $key)[&scope;]
+                                     [count(.|key('primary', &primary;)
+                                     [&scope;][1])=1]"
+                             mode="index-primary">
+          <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+          <xsl:with-param name="scope" select="$scope"/>
+          <xsl:with-param name="role" select="$role"/>
+          <xsl:with-param name="type" select="$type"/>
+        </xsl:apply-templates>
+      </fo:block>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-symbol-div">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:variable name="key"
+                select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
+
+  <fo:block xsl:use-attribute-sets="index.entry.properties">
+    <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]"
+                         mode="index-primary">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-primary">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:variable name="key" select="&primary;"/>
+  <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
+
+  <xsl:variable name="term.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.term.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="range.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.range.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="number.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.number.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <fo:block>
+    <xsl:if test="$axf.extensions != 0">
+      <xsl:attribute name="axf:suppress-duplicate-page-number">true</xsl:attribute>
+    </xsl:if>
+    <xsl:value-of select="primary"/>
+
+    <xsl:choose>
+      <xsl:when test="$xep.extensions != 0">
+        <xsl:if test="$refs[not(see) and not(secondary)]">
+          <xsl:copy-of select="$term.separator"/>
+          <xsl:variable name="primary" select="&primary;"/>
+          <xsl:variable name="primary.significant" select="concat(&primary;, $significant.flag)"/>
+          <rx:page-index list-separator="{$number.separator}"
+                         range-separator="{$range.separator}">
+            <xsl:if test="$refs[@significance='preferred'][not(see) and not(secondary)]">
+              <rx:index-item xsl:use-attribute-sets="index.preferred.page.properties xep.index.item.properties"
+                ref-key="{$primary.significant}"/>
+            </xsl:if>
+            <xsl:if test="$refs[not(@significance) or @significance!='preferred'][not(see) and not(secondary)]">
+              <rx:index-item xsl:use-attribute-sets="xep.index.item.properties"
+                ref-key="{$primary}"/>
+            </xsl:if>
+          </rx:page-index>        
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="page-number-citations">
+          <xsl:for-each select="$refs[not(see) 
+                                and not(secondary)]">
+            <xsl:apply-templates select="." mode="reference">
+              <xsl:with-param name="scope" select="$scope"/>
+              <xsl:with-param name="role" select="$role"/>
+              <xsl:with-param name="type" select="$type"/>
+              <xsl:with-param name="position" select="position()"/>
+            </xsl:apply-templates>
+          </xsl:for-each>
+        </xsl:variable>
+
+        <xsl:choose>
+          <xsl:when test="$passivetex.extensions != '0'">
+            <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
+              <xsl:copy-of select="$page-number-citations"/>
+            </fotex:sort>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="$page-number-citations"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:if test="$refs[not(secondary)]/*[self::see]">
+      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
+                           mode="index-see">
+         <xsl:with-param name="scope" select="$scope"/>
+         <xsl:with-param name="role" select="$role"/>
+         <xsl:with-param name="type" select="$type"/>
+         <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
+    </xsl:if>
+
+  </fo:block>
+
+  <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
+    <fo:block start-indent="1pc">
+      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]"
+                           mode="index-seealso">
+         <xsl:with-param name="scope" select="$scope"/>
+         <xsl:with-param name="role" select="$role"/>
+         <xsl:with-param name="type" select="$type"/>
+         <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]"
+                           mode="index-secondary">
+       <xsl:with-param name="scope" select="$scope"/>
+       <xsl:with-param name="role" select="$role"/>
+       <xsl:with-param name="type" select="$type"/>
+       <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-secondary">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
+  <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
+
+  <xsl:variable name="term.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.term.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="range.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.range.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="number.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.number.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <fo:block>
+    <xsl:if test="$axf.extensions != 0">
+      <xsl:attribute name="axf:suppress-duplicate-page-number">true</xsl:attribute>
+    </xsl:if>
+    <xsl:value-of select="secondary"/>
+
+    <xsl:choose>
+      <xsl:when test="$xep.extensions != 0">
+        <xsl:if test="$refs[not(see) and not(tertiary)]">
+          <xsl:copy-of select="$term.separator"/>
+          <xsl:variable name="primary" select="&primary;"/>
+          <xsl:variable name="secondary" select="&secondary;"/>
+          <xsl:variable name="primary.significant" select="concat(&primary;, $significant.flag)"/>
+          <rx:page-index list-separator="{$number.separator}"
+                         range-separator="{$range.separator}">
+            <xsl:if test="$refs[@significance='preferred'][not(see) and not(tertiary)]">
+              <rx:index-item xsl:use-attribute-sets="index.preferred.page.properties xep.index.item.properties">
+                <xsl:attribute name="ref-key">
+                  <xsl:value-of select="$primary.significant"/>
+                  <xsl:text>, </xsl:text>
+                  <xsl:value-of select="$secondary"/>
+                </xsl:attribute>
+              </rx:index-item>
+            </xsl:if>
+            <xsl:if test="$refs[not(@significance) or @significance!='preferred'][not(see) and not(tertiary)]">
+              <rx:index-item xsl:use-attribute-sets="xep.index.item.properties">
+                <xsl:attribute name="ref-key">
+                  <xsl:value-of select="$primary"/>
+                  <xsl:text>, </xsl:text>
+                  <xsl:value-of select="$secondary"/>
+                </xsl:attribute>
+              </rx:index-item>
+            </xsl:if>
+          </rx:page-index>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="page-number-citations">
+          <xsl:for-each select="$refs[not(see) 
+                                and not(tertiary)]">
+            <xsl:apply-templates select="." mode="reference">
+              <xsl:with-param name="scope" select="$scope"/>
+              <xsl:with-param name="role" select="$role"/>
+              <xsl:with-param name="type" select="$type"/>
+              <xsl:with-param name="position" select="position()"/>
+            </xsl:apply-templates>
+          </xsl:for-each>
+        </xsl:variable>
+
+        <xsl:choose>
+          <xsl:when test="$passivetex.extensions != '0'">
+            <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
+              <xsl:copy-of select="$page-number-citations"/>
+            </fotex:sort>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="$page-number-citations"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:if test="$refs[not(tertiary)]/*[self::see]">
+      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]"
+                           mode="index-see">
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:with-param name="role" select="$role"/>
+        <xsl:with-param name="type" select="$type"/>
+        <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
+    </xsl:if>
+
+  </fo:block>
+
+  <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::seealso]">
+    <fo:block start-indent="2pc">
+      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[&scope;][1])]"
+                           mode="index-seealso">
+          <xsl:with-param name="scope" select="$scope"/>
+          <xsl:with-param name="role" select="$role"/>
+          <xsl:with-param name="type" select="$type"/>
+          <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[&scope;][1]) = 1]" 
+                           mode="index-tertiary">
+          <xsl:with-param name="scope" select="$scope"/>
+          <xsl:with-param name="role" select="$role"/>
+          <xsl:with-param name="type" select="$type"/>
+          <xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-tertiary">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
+  <xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/>
+
+  <xsl:variable name="term.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.term.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="range.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.range.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="number.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.number.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <fo:block>
+    <xsl:if test="$axf.extensions != 0">
+      <xsl:attribute name="axf:suppress-duplicate-page-number">true</xsl:attribute>
+    </xsl:if>
+    <xsl:value-of select="tertiary"/>
+
+    <xsl:choose>
+      <xsl:when test="$xep.extensions != 0">
+        <xsl:if test="$refs[not(see)]">
+          <xsl:copy-of select="$term.separator"/>
+          <xsl:variable name="primary" select="&primary;"/>
+          <xsl:variable name="secondary" select="&secondary;"/>
+          <xsl:variable name="tertiary" select="&tertiary;"/>
+          <xsl:variable name="primary.significant" select="concat(&primary;, $significant.flag)"/>
+          <rx:page-index list-separator="{$number.separator}"
+                         range-separator="{$range.separator}">
+            <xsl:if test="$refs[@significance='preferred'][not(see)]">
+              <rx:index-item xsl:use-attribute-sets="index.preferred.page.properties xep.index.item.properties">
+                <xsl:attribute name="ref-key">
+                  <xsl:value-of select="$primary.significant"/>
+                  <xsl:text>, </xsl:text>
+                  <xsl:value-of select="$secondary"/>
+                  <xsl:text>, </xsl:text>
+                  <xsl:value-of select="$tertiary"/>
+                </xsl:attribute>
+              </rx:index-item>
+            </xsl:if>
+            <xsl:if test="$refs[not(@significance) or @significance!='preferred'][not(see)]">
+              <rx:index-item xsl:use-attribute-sets="xep.index.item.properties">
+                <xsl:attribute name="ref-key">
+                  <xsl:value-of select="$primary"/>
+                  <xsl:text>, </xsl:text>
+                  <xsl:value-of select="$secondary"/>
+                  <xsl:text>, </xsl:text>
+                  <xsl:value-of select="$tertiary"/>
+                </xsl:attribute>
+              </rx:index-item>
+            </xsl:if>
+          </rx:page-index>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="page-number-citations">
+          <xsl:for-each select="$refs[not(see)]">
+            <xsl:apply-templates select="." mode="reference">
+              <xsl:with-param name="scope" select="$scope"/>
+              <xsl:with-param name="role" select="$role"/>
+              <xsl:with-param name="type" select="$type"/>
+              <xsl:with-param name="position" select="position()"/>
+            </xsl:apply-templates>
+          </xsl:for-each>
+        </xsl:variable>
+
+        <xsl:choose>
+          <xsl:when test="$passivetex.extensions != '0'">
+            <fotex:sort xmlns:fotex="http://www.tug.org/fotex">
+              <xsl:copy-of select="$page-number-citations"/>
+            </fotex:sort>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="$page-number-citations"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:if test="$refs/see">
+      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]"
+                           mode="index-see">
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:with-param name="role" select="$role"/>
+        <xsl:with-param name="type" select="$type"/>
+        <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
+    </xsl:if>
+
+  </fo:block>
+
+  <xsl:if test="$refs/seealso">
+    <fo:block>
+      <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[&scope;][1])]"
+                           mode="index-seealso">
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:with-param name="role" select="$role"/>
+        <xsl:with-param name="type" select="$type"/>
+        <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
+      </xsl:apply-templates>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="reference">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:param name="position" select="0"/>
+  <xsl:param name="separator" select="''"/>
+
+  <xsl:variable name="term.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.term.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="range.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.range.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="number.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.number.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$separator != ''">
+      <xsl:value-of select="$separator"/>
+    </xsl:when>
+    <xsl:when test="$position = 1">
+      <xsl:value-of select="$term.separator"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$number.separator"/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:choose>
+    <xsl:when test="@zone and string(@zone)">
+      <xsl:call-template name="reference">
+        <xsl:with-param name="zones" select="normalize-space(@zone)"/>
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:with-param name="role" select="$role"/>
+        <xsl:with-param name="type" select="$type"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="ancestor::*[contains(local-name(),'info') and not(starts-with(local-name(),'info'))]">
+      <xsl:call-template name="info.reference">
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:with-param name="role" select="$role"/>
+        <xsl:with-param name="type" select="$type"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="id">
+        <xsl:call-template name="object.id"/>
+      </xsl:variable>
+
+      <fo:basic-link internal-destination="{$id}"
+                     xsl:use-attribute-sets="index.page.number.properties">
+        <fo:page-number-citation ref-id="{$id}"/>
+      </fo:basic-link>
+
+      <xsl:if test="key('endofrange', $id)[&scope;]">
+        <xsl:apply-templates select="key('endofrange', $id)[&scope;][last()]"
+                             mode="reference">
+          <xsl:with-param name="scope" select="$scope"/>
+          <xsl:with-param name="role" select="$role"/>
+          <xsl:with-param name="type" select="$type"/>
+          <xsl:with-param name="separator" select="$range.separator"/>
+        </xsl:apply-templates>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="reference">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:param name="zones"/>
+
+  <xsl:variable name="number.separator">
+    <xsl:call-template name="index.separator">
+      <xsl:with-param name="key" select="'index.number.separator'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="contains($zones, ' ')">
+      <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
+      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
+
+      <xsl:variable name="id">
+        <xsl:call-template name="object.id">
+           <xsl:with-param name="object" select="$target[1]"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <fo:basic-link internal-destination="{$id}"
+                     xsl:use-attribute-sets="index.page.number.properties">
+        <fo:page-number-citation ref-id="{$id}"/>
+      </fo:basic-link>
+
+      <xsl:if test="$passivetex.extensions = '0'">
+        <xsl:copy-of select="$number.separator"/>
+      </xsl:if>
+      <xsl:call-template name="reference">
+        <xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:with-param name="role" select="$role"/>
+        <xsl:with-param name="type" select="$type"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="zone" select="$zones"/>
+      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
+
+      <xsl:variable name="id">
+        <xsl:call-template name="object.id">
+          <xsl:with-param name="object" select="$target[1]"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <fo:basic-link internal-destination="{$id}"
+                     xsl:use-attribute-sets="index.page.number.properties">
+        <fo:page-number-citation ref-id="{$id}"/>
+      </fo:basic-link>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="info.reference">
+  <!-- This is not perfect. It doesn't treat indexterm inside info element as a range covering whole parent of info.
+       It also not work when there is no ID generated for parent element. But it works in the most common cases. -->
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:variable name="target" select="(ancestor::appendix|ancestor::article|ancestor::bibliography|ancestor::book|
+                                       ancestor::chapter|ancestor::glossary|ancestor::part|ancestor::preface|
+                                       ancestor::refentry|ancestor::reference|ancestor::refsect1|ancestor::refsect2|
+                                       ancestor::refsect3|ancestor::refsection|ancestor::refsynopsisdiv|
+                                       ancestor::sect1|ancestor::sect2|ancestor::sect3|ancestor::sect4|ancestor::sect5|
+                                       ancestor::section|ancestor::setindex|ancestor::set|ancestor::sidebar)[&scope;]"/>
+  
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="$target[1]"/>
+    </xsl:call-template>
+  </xsl:variable>
+  
+  <fo:basic-link internal-destination="{$id}"
+                 xsl:use-attribute-sets="index.page.number.properties">
+    <fo:page-number-citation ref-id="{$id}"/>
+  </fo:basic-link>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-see">
+   <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+   <fo:inline>
+     <xsl:text> (</xsl:text>
+     <xsl:call-template name="gentext">
+       <xsl:with-param name="key" select="'see'"/>
+     </xsl:call-template>
+     <xsl:text> </xsl:text>
+     <xsl:value-of select="see"/>
+     <xsl:text>)</xsl:text>
+   </fo:inline>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-seealso">
+   <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:for-each select="seealso">
+    <xsl:sort select="translate(., &lowercase;, &uppercase;)"/>
+    <fo:block>
+      <xsl:text>(</xsl:text>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'seealso'"/>
+      </xsl:call-template>
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="."/>
+      <xsl:text>)</xsl:text>
+    </fo:block>
+  </xsl:for-each>
+
+</xsl:template>
+
+<!-- ====================================================================== -->
+
+<xsl:template name="generate-index-markup">
+  <xsl:param name="scope" select="(ancestor::book|/)[last()]"/>
+  <xsl:param name="role" select="@role"/>
+  <xsl:param name="type" select="@type"/>
+
+  <xsl:variable name="terms" select="$scope//indexterm[count(.|key('letter',
+                                     translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;))[&scope;][1]) = 1]"/>
+  <xsl:variable name="alphabetical"
+                select="$terms[contains(concat(&lowercase;, &uppercase;),
+                                        substring(&primary;, 1, 1))]"/>
+  <xsl:variable name="others" select="$terms[not(contains(concat(&lowercase;,
+                                                 &uppercase;),
+                                             substring(&primary;, 1, 1)))]"/>
+
+  <xsl:text>&lt;index&gt;&#10;</xsl:text>
+  <xsl:if test="$others">
+    <xsl:text>&#10;&lt;indexdiv&gt;&#10;</xsl:text>
+    <xsl:text>&lt;title&gt;</xsl:text>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'index symbols'"/>
+    </xsl:call-template>
+    <xsl:text>&lt;/title&gt;&#10;</xsl:text>
+    <xsl:apply-templates select="$others[count(.|key('primary',
+                                 &primary;)[&scope;][1]) = 1]"
+                         mode="index-symbol-div-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+    <xsl:text>&lt;/indexdiv&gt;&#10;</xsl:text>
+  </xsl:if>
+
+  <xsl:apply-templates select="$alphabetical[count(.|key('letter',
+                               translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;))[&scope;][1]) = 1]"
+                       mode="index-div-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+  </xsl:apply-templates>
+  <xsl:text>&lt;/index&gt;&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="*" mode="index-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:text>&lt;</xsl:text>
+  <xsl:value-of select="local-name(.)"/>
+  <xsl:text>&gt;&#10;</xsl:text>
+  <xsl:apply-templates mode="index-markup">
+    <xsl:with-param name="scope" select="$scope"/>
+    <xsl:with-param name="role" select="$role"/>
+    <xsl:with-param name="type" select="$type"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-div-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
+  <xsl:text>&#10;&lt;indexdiv&gt;&#10;</xsl:text>
+  <xsl:text>&lt;title&gt;</xsl:text>
+  <xsl:value-of select="translate($key, &lowercase;, &uppercase;)"/>
+  <xsl:text>&lt;/title&gt;&#10;</xsl:text>
+
+  <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]"
+                       mode="index-primary-markup">
+    <xsl:with-param name="scope" select="$scope"/>
+    <xsl:with-param name="role" select="$role"/>
+    <xsl:with-param name="type" select="$type"/>
+    <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+  </xsl:apply-templates>
+  <xsl:text>&lt;/indexdiv&gt;&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-symbol-div-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
+
+  <xsl:apply-templates select="key('letter', $key)[&scope;][count(.|key('primary', &primary;)[&scope;][1]) = 1]"
+                       mode="index-primary-markup">
+    <xsl:with-param name="scope" select="$scope"/>
+    <xsl:with-param name="role" select="$role"/>
+    <xsl:with-param name="type" select="$type"/>
+    <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-primary-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:variable name="key" select="&primary;"/>
+  <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
+  <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/>
+
+  <xsl:text>&#10;&lt;indexentry&gt;&#10;</xsl:text>
+  <xsl:text>&lt;primaryie&gt;</xsl:text>
+  <xsl:text>&lt;phrase&gt;</xsl:text>
+  <xsl:call-template name="escape-text">
+    <xsl:with-param name="text" select="string(primary)"/>
+  </xsl:call-template>
+  <xsl:text>&lt;/phrase&gt;</xsl:text>
+  <xsl:if test="$pages">,</xsl:if>
+  <xsl:text>&#10;</xsl:text>
+
+  <xsl:for-each select="$pages">
+    <xsl:apply-templates select="." mode="reference-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+
+  <xsl:text>&lt;/primaryie&gt;&#10;</xsl:text>
+
+  <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::see or self::seealso]">
+    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
+                         mode="index-see-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+
+    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]"
+                         mode="index-seealso-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+
+    <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" 
+                         mode="index-secondary-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+  </xsl:if>
+  <xsl:text>&lt;/indexentry&gt;&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-secondary-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
+  <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
+  <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/>
+
+  <xsl:text>&lt;secondaryie&gt;</xsl:text>
+  <xsl:text>&lt;phrase&gt;</xsl:text>
+  <xsl:call-template name="escape-text">
+    <xsl:with-param name="text" select="string(secondary)"/>
+  </xsl:call-template>
+  <xsl:text>&lt;/phrase&gt;</xsl:text>
+  <xsl:if test="$pages">,</xsl:if>
+  <xsl:text>&#10;</xsl:text>
+
+  <xsl:for-each select="$pages">
+    <xsl:apply-templates select="." mode="reference-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+
+  <xsl:text>&lt;/secondaryie&gt;&#10;</xsl:text>
+
+  <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::see or self::seealso]">
+    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]"
+                         mode="index-see-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[&scope;][1])]"
+                         mode="index-seealso-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[&scope;][1]) = 1]" 
+                         mode="index-tertiary-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-tertiary-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
+  <xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/>
+  <xsl:variable name="pages" select="$refs[not(see) and not(seealso)]"/>
+
+  <xsl:text>&lt;tertiaryie&gt;</xsl:text>
+  <xsl:text>&lt;phrase&gt;</xsl:text>
+  <xsl:call-template name="escape-text">
+    <xsl:with-param name="text" select="string(tertiary)"/>
+  </xsl:call-template>
+  <xsl:text>&lt;/phrase&gt;</xsl:text>
+  <xsl:if test="$pages">,</xsl:if>
+  <xsl:text>&#10;</xsl:text>
+
+  <xsl:for-each select="$pages">
+    <xsl:apply-templates select="." mode="reference-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+
+  <xsl:text>&lt;/tertiaryie&gt;&#10;</xsl:text>
+
+  <xsl:variable name="see" select="$refs/see | $refs/seealso"/>
+  <xsl:if test="$see">
+    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]"
+                         mode="index-see-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+    <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[&scope;][1])]"
+                         mode="index-seealso-markup">
+      <xsl:with-param name="scope" select="$scope"/>
+      <xsl:with-param name="role" select="$role"/>
+      <xsl:with-param name="type" select="$type"/>
+      <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
+    </xsl:apply-templates>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="reference-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+
+  <xsl:choose>
+    <xsl:when test="@zone and string(@zone)">
+      <xsl:call-template name="reference-markup">
+        <xsl:with-param name="zones" select="normalize-space(@zone)"/>
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:with-param name="role" select="$role"/>
+        <xsl:with-param name="type" select="$type"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="id">
+        <xsl:call-template name="object.id"/>
+      </xsl:variable>
+
+
+      <xsl:choose>
+        <xsl:when test="@startref and @class='endofrange'">
+          <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
+          <xsl:text>&lt;link linkend="</xsl:text>
+          <xsl:value-of select="@startref"/>
+          <xsl:text>"&gt;</xsl:text>
+          <fo:basic-link internal-destination="{@startref}"
+                     xsl:use-attribute-sets="index.page.number.properties">
+            <fo:page-number-citation ref-id="{@startref}"/>
+            <xsl:text>-</xsl:text>
+            <fo:page-number-citation ref-id="{$id}"/>
+          </fo:basic-link>
+          <xsl:text>&lt;/link&gt;</xsl:text>
+          <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
+          <xsl:if test="$id">
+            <xsl:text>&lt;link linkend="</xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text>"&gt;</xsl:text>
+          </xsl:if>
+          <fo:basic-link internal-destination="{$id}"
+                     xsl:use-attribute-sets="index.page.number.properties">
+            <fo:page-number-citation ref-id="{$id}"/>
+          </fo:basic-link>
+          <xsl:if test="$id">
+            <xsl:text>&lt;/link&gt;</xsl:text>
+          </xsl:if>
+          <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="reference-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <xsl:param name="zones"/>
+  <xsl:choose>
+    <xsl:when test="contains($zones, ' ')">
+      <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
+      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
+
+      <xsl:variable name="id">
+        <xsl:call-template name="object.id">
+          <xsl:with-param name="object" select="$target[1]"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:text>&lt;phrase fole="pageno"&gt;</xsl:text>
+      <xsl:if test="$target[1]/@id or $target[1]/@xml:id">
+        <xsl:text>&lt;link linkend="</xsl:text>
+        <xsl:value-of select="$id"/>
+        <xsl:text>"&gt;</xsl:text>
+      </xsl:if>
+      <fo:basic-link internal-destination="{$id}"
+                     xsl:use-attribute-sets="index.page.number.properties">
+        <fo:page-number-citation ref-id="{$id}"/>
+      </fo:basic-link>
+      <xsl:if test="$target[1]/@id or $target[1]/@xml:id">
+        <xsl:text>&lt;/link&gt;</xsl:text>
+      </xsl:if>
+      <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
+
+      <xsl:call-template name="reference">
+        <xsl:with-param name="zones" select="substring-after($zones, ' ')"/>
+        <xsl:with-param name="scope" select="$scope"/>
+        <xsl:with-param name="role" select="$role"/>
+        <xsl:with-param name="type" select="$type"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="zone" select="$zones"/>
+      <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
+
+      <xsl:variable name="id">
+        <xsl:call-template name="object.id">
+          <xsl:with-param name="object" select="$target[1]"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:text>&lt;phrase role="pageno"&gt;</xsl:text>
+      <xsl:if test="$target[1]/@id or target[1]/@xml:id">
+        <xsl:text>&lt;link linkend="</xsl:text>
+        <xsl:value-of select="$id"/>
+        <xsl:text>"&gt;</xsl:text>
+      </xsl:if>
+      <fo:basic-link internal-destination="{$id}"
+                     xsl:use-attribute-sets="index.page.number.properties">
+        <fo:page-number-citation ref-id="{$id}"/>
+      </fo:basic-link>
+      <xsl:if test="$target[1]/@id or target[1]/@xml:id">
+        <xsl:text>&lt;/link&gt;</xsl:text>
+      </xsl:if>
+      <xsl:text>&lt;/phrase&gt;&#10;</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-see-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <fo:block>
+    <xsl:text>&lt;seeie&gt;</xsl:text>
+    <xsl:text>&lt;phrase&gt;</xsl:text>
+    <xsl:call-template name="escape-text">
+      <xsl:with-param name="text" select="string(see)"/>
+    </xsl:call-template>
+    <xsl:text>&lt;/phrase&gt;</xsl:text>
+    <xsl:text>&lt;/seeie&gt;&#10;</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="index-seealso-markup">
+  <xsl:param name="scope" select="."/>
+  <xsl:param name="role" select="''"/>
+  <xsl:param name="type" select="''"/>
+  <fo:block>
+    <xsl:text>&lt;seealsoie&gt;</xsl:text>
+    <xsl:text>&lt;phrase&gt;</xsl:text>
+    <xsl:call-template name="escape-text">
+      <xsl:with-param name="text" select="string(seealso)"/>
+    </xsl:call-template>
+    <xsl:text>&lt;/phrase&gt;</xsl:text>
+    <xsl:text>&lt;/seealsoie&gt;&#10;</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<xsl:template name="escape-text">
+  <xsl:param name="text" select="''"/>
+
+  <xsl:variable name="ltpos" select="substring-before($text, '&lt;')"/>
+  <xsl:variable name="amppos" select="substring-before($text, '&amp;')"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($text,'&lt;') and contains($text, '&amp;')
+                    and string-length($ltpos) &lt; string-length($amppos)">
+      <xsl:value-of select="$ltpos"/>
+      <xsl:text>&amp;lt;</xsl:text>
+      <xsl:call-template name="escape-text">
+        <xsl:with-param name="text" select="substring-after($text, '&lt;')"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:when test="contains($text,'&lt;') and contains($text, '&amp;')
+                    and string-length($amppos) &lt; string-length($ltpos)">
+      <xsl:value-of select="$amppos"/>
+      <xsl:text>&amp;amp;</xsl:text>
+      <xsl:call-template name="escape-text">
+        <xsl:with-param name="text" select="substring-after($text, '&amp;')"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:when test="contains($text, '&lt;')">
+      <xsl:value-of select="$ltpos"/>
+      <xsl:text>&amp;lt;</xsl:text>
+      <xsl:call-template name="escape-text">
+        <xsl:with-param name="text" select="substring-after($text, '&lt;')"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:when test="contains($text, '&amp;')">
+      <xsl:value-of select="$amppos"/>
+      <xsl:text>&amp;amp;</xsl:text>
+      <xsl:call-template name="escape-text">
+        <xsl:with-param name="text" select="substring-after($text, '&amp;')"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:value-of select="$text"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="index.separator">
+  <xsl:param name="key" select="''"/>
+  <xsl:param name="lang">
+    <xsl:call-template name="l10n.language"/>
+  </xsl:param>
+
+  <xsl:choose>
+    <xsl:when test="$key = 'index.term.separator'">
+      <xsl:choose>
+        <!-- Use the override if not blank -->
+        <xsl:when test="$index.term.separator != ''">
+          <xsl:copy-of select="$index.term.separator"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="lang" select="$lang"/>
+            <xsl:with-param name="context">index</xsl:with-param>
+            <xsl:with-param name="name">term-separator</xsl:with-param>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="$key = 'index.number.separator'">
+      <xsl:choose>
+        <!-- Use the override if not blank -->
+        <xsl:when test="$index.number.separator != ''">
+          <xsl:copy-of select="$index.number.separator"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="lang" select="$lang"/>
+            <xsl:with-param name="context">index</xsl:with-param>
+            <xsl:with-param name="name">number-separator</xsl:with-param>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="$key = 'index.range.separator'">
+      <xsl:choose>
+        <!-- Use the override if not blank -->
+        <xsl:when test="$index.range.separator != ''">
+          <xsl:copy-of select="$index.range.separator"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="lang" select="$lang"/>
+            <xsl:with-param name="context">index</xsl:with-param>
+            <xsl:with-param name="name">range-separator</xsl:with-param>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 855 - 0
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$
+     ********************************************************************
+
+     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>
+

+ 110 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/axf.xsl

@@ -0,0 +1,110 @@
+<?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$
+     ******************************************************************** -->
+
+<xsl:template name="axf-document-information">
+
+    <xsl:variable name="authors" select="(//author|//editor|
+                                          //corpauthor|//authorgroup)[1]"/>
+    <xsl:if test="$authors">
+      <xsl:variable name="author">
+        <xsl:choose>
+          <xsl:when test="$authors[self::authorgroup]">
+            <xsl:call-template name="person.name.list">
+              <xsl:with-param name="person.list" 
+                 select="$authors/*[self::author|self::corpauthor|
+                               self::othercredit|self::editor]"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:when test="$authors[self::corpauthor]">
+            <xsl:value-of select="$authors"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="person.name">
+              <xsl:with-param name="node" select="$authors"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:element name="axf:document-info">
+        <xsl:attribute name="name">author</xsl:attribute>
+        <xsl:attribute name="value">
+          <xsl:value-of select="normalize-space($author)"/>
+        </xsl:attribute>
+      </xsl:element>
+    </xsl:if>
+
+    <xsl:variable name="title">
+      <xsl:apply-templates select="/*[1]" mode="label.markup"/>
+      <xsl:apply-templates select="/*[1]" mode="title.markup"/>
+    </xsl:variable>
+
+    <!-- * see bug report #1465301 - mzjn -->
+    <axf:document-info name="title">
+      <xsl:attribute name="value">
+        <xsl:value-of select="normalize-space($title)"/>
+      </xsl:attribute>
+    </axf:document-info>
+
+    <xsl:if test="//keyword">
+      <xsl:element name="axf:document-info">
+        <xsl:attribute name="name">keywords</xsl:attribute>
+        <xsl:attribute name="value">
+          <xsl:for-each select="//keyword">
+            <xsl:value-of select="normalize-space(.)"/>
+            <xsl:if test="position() != last()">
+              <xsl:text>, </xsl:text>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:attribute>
+      </xsl:element>
+    </xsl:if>
+
+    <xsl:if test="//subjectterm">
+      <xsl:element name="axf:document-info">
+        <xsl:attribute name="name">subject</xsl:attribute>
+        <xsl:attribute name="value">
+          <xsl:for-each select="//subjectterm">
+            <xsl:value-of select="normalize-space(.)"/>
+            <xsl:if test="position() != last()">
+              <xsl:text>, </xsl:text>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:attribute>
+      </xsl:element>
+    </xsl:if>
+
+</xsl:template>
+
+<!-- These properties are added to fo:simple-page-master -->
+<xsl:template name="axf-page-master-properties">
+  <xsl:param name="page.master" select="''"/>
+
+  <xsl:if test="$crop.marks != 0">
+    <xsl:attribute name="axf:printer-marks">crop</xsl:attribute>
+    <xsl:attribute name="axf:bleed"><xsl:value-of
+                          select="$crop.mark.bleed"/></xsl:attribute>
+    <xsl:attribute name="axf:printer-marks-line-width"><xsl:value-of
+                          select="$crop.mark.width"/></xsl:attribute>
+    <xsl:attribute name="axf:crop-offset"><xsl:value-of
+                          select="$crop.mark.offset"/></xsl:attribute>
+  </xsl:if>
+
+  <xsl:call-template name="user-axf-page-master-properties">
+    <xsl:with-param name="page.master" select="$page.master"/>
+  </xsl:call-template>
+
+</xsl:template>
+
+<xsl:template name="user-axf-page-master-properties">
+  <xsl:param name="page.master" select="''"/>
+</xsl:template>
+
+</xsl:stylesheet>

+ 1300 - 0
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$
+     ********************************************************************
+
+     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>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- Issue designation (date and/or n°) -->
+<xsl:template name="iso690.issuing">
+  <xsl:param name="issuing.div">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="issuing.range">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="issuing.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2] and ./issuenum[2]">
+      <xsl:call-template name="iso690.issuedate"/>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum[1]">
+        <xsl:with-param name="sep" select="$issuing.range"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum[2]">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2]">
+      <xsl:call-template name="iso690.issuedate"/>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
+        <xsl:with-param name="sep" select="$issuing.range"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum and ./issuenum">
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./pubdate[@role='issuing']">
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./volumenum">
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./issuenum">
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.issuedate">
+  <xsl:param name="issuing.div">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="issuing.range">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="issuing.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./pubdate[@role='issuing'][2]">
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][1]">
+        <xsl:with-param name="sep" select="$issuing.range"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][2]">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="pubdate[@role='issuing']" mode="iso690.mode">
+  <xsl:param name="sep"/>
+  <xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.space">
+    <xsl:with-param name="text" select="$substr"/>
+  </xsl:call-template>
+  <xsl:choose>
+    <xsl:when test="$substr='-'">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="' '"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="string(.)"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- Numeration of the part -->
+<xsl:template name="iso690.partnr">
+  <xsl:param name="partnr.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'partnr.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+    <xsl:with-param name="sep" select="$partnr.sep"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
+<xsl:template name="iso690.pub">
+  <xsl:param name="onlydate" select="0"/>
+  <xsl:param name="placesep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'placepubl.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="pubsep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'publyear.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="endsep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pubinfo.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="(./publisher/publishername|./publishername|./publisher/address/city)and($onlydate=0)and(./pubdate[not(@role='issuing')]|./copyright/year|./date[@role='upd']|./date[@role='upd'])">
+      <xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
+        <xsl:with-param name="sep" select="$placesep"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
+        <xsl:with-param name="sep" select="$pubsep"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
+        <xsl:with-param name="sep" select="$endsep"/>
+      </xsl:apply-templates>
+      <xsl:if test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
+        <xsl:call-template name="iso690.data">
+          <xsl:with-param name="sep" select="$endsep"/>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:when>
+    <xsl:when test="(./publisher/publishername|./publishername)and(./publisher/address/city)and($onlydate=0)">
+      <xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
+        <xsl:with-param name="sep" select="$placesep"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
+        <xsl:with-param name="sep" select="$endsep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="($onlydate=1)or(./pubdate[not(@role='issuing')]|./copyright/year)">
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
+        <xsl:with-param name="sep" select="$endsep"/>
+      </xsl:apply-templates>
+      <xsl:if test="$onlydate=1">
+        <xsl:call-template name="iso690.location">
+          <xsl:with-param name="onlypages" select="1"/>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:when>
+    <xsl:when test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
+      <xsl:call-template name="iso690.data">
+        <xsl:with-param name="sep" select="$endsep"/>
+      </xsl:call-template>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.paper.pub">
+  <xsl:param name="spec.pubinfo.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'spec.pubinfo.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./volumnum|./issuenum|./pagenums">
+      <xsl:call-template name="iso690.pub">
+        <xsl:with-param name="endsep" select="$spec.pubinfo.sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="iso690.pub"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.data">
+  <xsl:param name="sep"/>
+  <xsl:param name="datecit2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode" select="./date[@role='upd']">
+    <xsl:with-param name="sep"/>
+  </xsl:apply-templates>
+  <xsl:apply-templates mode="iso690.mode" select="./date[@role='cit']"/>
+  <xsl:choose>
+    <xsl:when test="./date[@role='cit']">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="$datecit2"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="./date[@role='upd']">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="string(./date[@role='upd'])"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="publisher/address/city|publishername" mode="iso690.mode">
+  <xsl:param name="sep"/>
+  <xsl:param name="upd" select="0"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="pubdate|copyright/year" mode="iso690.mode">
+  <xsl:param name="sep"/>
+  <xsl:param name="upd" select="1"/>
+  <xsl:param name="datecit2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
+  <xsl:if test="name(.)!='pubdate'">
+    <xsl:value-of select="'&#x00A9;'"/><!-- copyright -->
+  </xsl:if>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.space">
+    <xsl:with-param name="text" select="$substr"/>
+  </xsl:call-template>
+  <xsl:if test="$upd!=0">
+    <xsl:choose>
+      <xsl:when test="name(.)='pubdate'">
+        <xsl:apply-templates mode="iso690.mode" select="../date[@role='upd']"/>
+        <xsl:apply-templates mode="iso690.mode" select="../date[@role='cit']"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="iso690.mode" select="../../date[@role='upd']"/>
+        <xsl:apply-templates mode="iso690.mode" select="../../date[@role='cit']"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:if>
+  <xsl:choose>
+    <xsl:when test="../date[@role='cit']|../../date[@role='cit'] and $upd!=0">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="$datecit2"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="../date[@role='upd']|../../date[@role='upd'] and $upd!=0">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="string(../date[@role='upd'])"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$substr='-'">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="' '"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="string(.)"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.space">
+  <xsl:param name="text" select="substring(string(.),string-length(string(.)))"/>
+  <xsl:if test="$text='-'">
+    <xsl:value-of select="' '"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- Date of update/revision -->
+<xsl:template match="date[@role='upd']" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'upd.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$sep"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+</xsl:template>
+
+<!-- Date of citation -->
+<xsl:template match="date[@role='cit']" mode="iso690.mode">
+  <xsl:param name="datecit1">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit1'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="datecit2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$datecit1"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:value-of select="$datecit2"/>
+</xsl:template>
+
+<!-- Extent -->
+<xsl:template name="iso690.extent">
+  <xsl:param name="extent.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'extent.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode" select="./pagenums">
+    <xsl:with-param name="sep" select="$extent.sep"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<!-- Location within host -->
+<xsl:template name="iso690.part.location">
+  <xsl:param name="location.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./pagenums">
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']"/>
+      <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
+    </xsl:when>
+    <xsl:when test="./bibliomisc[@role='sectitle']">
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']">
+        <xsl:with-param name="sep" select="$location.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']">
+        <xsl:with-param name="sep" select="$location.sep"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.article.location">
+  <xsl:param name="location.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="locs.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="not(./date[@role='upd']|./date[@role='cit'])">
+      <xsl:choose>
+        <xsl:when test="./volumenum|./issuenum|./pagenums">
+          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+            <xsl:with-param name="upd" select="0"/>
+            <xsl:with-param name="sep" select="$locs.sep"/>
+          </xsl:apply-templates>
+          <xsl:call-template name="iso690.location"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+            <xsl:with-param name="sep" select="$location.sep"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="./volumenum|./issuenum|./pagenums">
+          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+            <xsl:with-param name="upd" select="0"/>
+            <xsl:with-param name="sep" select="$locs.sep"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+            <xsl:with-param name="upd" select="0"/>
+            <xsl:with-param name="sep" select="$location.sep"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="./issuenum">
+          <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
+          <xsl:apply-templates mode="iso690.mode" select="./issuenum">
+            <xsl:with-param name="sep"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+            <xsl:with-param name="sep"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="./pagenums">
+          <xsl:call-template name="iso690.data">
+            <xsl:with-param name="sep" select="$locs.sep"/>
+          </xsl:call-template>
+          <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="iso690.data">
+            <xsl:with-param name="sep" select="$location.sep"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.location">
+  <xsl:param name="location.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./volumenum and not(./issuenum) and not(./pagenums)">
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+        <xsl:with-param name="sep" select="$location.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./issuenum and not(./pagenums)">
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
+        <xsl:with-param name="sep" select="$location.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./pagenums">
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum"/>
+      <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="bibliomisc[@role='secnum']|bibliomisc[@role='sectitle']" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="volumenum|issuenum" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="pagenums" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- Series -->
+<xsl:template name="iso690.serie">
+  <xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[@role='serie']"/>
+</xsl:template>
+
+<!-- Notes -->
+<xsl:template name="iso690.notice">
+  <xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[not(@role)]"/>
+</xsl:template>
+
+<xsl:template match="bibliomisc[not(@role)]|bibliomisc[@role='serie']" mode="iso690.mode">
+  <xsl:param name="notice.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'notice.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$notice.sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- Avaibility and access -->
+<xsl:template name="iso690.access">
+  <xsl:for-each select="./biblioid[@class='uri']|./bibliomisc[@role='access']">
+    <xsl:choose>
+      <xsl:when test="position()=1">
+        <xsl:apply-templates mode="iso690.mode" select="."/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="iso690.mode" select=".">
+          <xsl:with-param name="firstacc" select="0"/>
+        </xsl:apply-templates>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="biblioid[@class='uri']/ulink|bibliomisc[@role='access']/ulink" mode="iso690.mode">
+  <xsl:param name="link1">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link1'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="link2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$link1"/>
+  <xsl:call-template name="ulink"/>
+  <xsl:value-of select="$link2"/>
+</xsl:template>
+
+<xsl:template match="biblioid[@class='uri']|bibliomisc[@role='access']" mode="iso690.mode">
+  <xsl:param name="firstacc" select="1"/>
+  <xsl:param name="access">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="acctoo">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'acctoo'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="onwww">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'onwww'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="oninet">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'oninet'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="access.end">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.end'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="access.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="$firstacc=1">
+      <xsl:value-of select="$access"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$acctoo"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:choose>
+    <xsl:when test="(./ulink)and(string(./ulink)=string(.))">
+      <xsl:choose>
+        <xsl:when test="(starts-with(./ulink/@url,'http://')or(starts-with(./ulink/@url,'https://')))">
+          <xsl:value-of select="$onwww"/>
+          <xsl:value-of select="$access.end"/>
+          <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$oninet"/>
+          <xsl:value-of select="$access.end"/>
+          <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="(./ulink)and(string(./ulink)!=string(.))">
+      <xsl:value-of select="text()[1]"/>
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="text()[1]"/>
+        <xsl:with-param name="sep" select="$access.end"/>
+      </xsl:call-template>
+      <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:value-of select="$access.sep"/>
+</xsl:template>
+
+<!-- Standard number - ISBN -->
+<xsl:template name="iso690.isbn">
+  <xsl:choose>
+    <xsl:when test="./biblioid/@class='isbn'">
+      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='isbn']"/>
+    </xsl:when>
+    <xsl:when test="./isbn">
+      <xsl:apply-templates mode="iso690.mode" select="./isbn"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="isbn|biblioid[@class='isbn']" mode="iso690.mode">
+  <xsl:param name="isbn">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'isbn'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="stdnum.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$isbn"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:value-of select="$stdnum.sep"/>
+</xsl:template>
+
+<!-- Standard number - ISSN -->
+<xsl:template name="iso690.issn">
+  <xsl:choose>
+    <xsl:when test="./biblioid/@class='issn'">
+      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='issn']"/>
+    </xsl:when>
+    <xsl:when test="./issn">
+      <xsl:apply-templates mode="iso690.mode" select="./issn"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="issn|biblioid[@class='issn']" mode="iso690.mode">
+  <xsl:param name="issn">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issn'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="stdnum.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$issn"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:value-of select="$stdnum.sep"/>
+</xsl:template>
+
+<!-- Identification of patent document -->
+<xsl:template name="iso690.pat.ident">
+  <xsl:param name="patdate.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patdate.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode" select="./address/country"/>
+  <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='patenttype']"/>
+  <xsl:choose>
+    <xsl:when test="./biblioid[@class='other' and @otherclass='patentnum']">
+      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='other' and @otherclass='patentnum']"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='patentnum']"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+    <xsl:with-param name="sep" select="$patdate.sep"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<!-- Country or issuing office -->
+<xsl:template match="address/country" mode="iso690.mode">
+  <xsl:param name="patcountry.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patcountry.sep'"/></xsl:call-template>
+  </xsl:param>
+  <fo:inline font-style="italic">
+    <xsl:apply-templates mode="iso690.mode"/>
+  </fo:inline>
+  <xsl:value-of select="$patcountry.sep"/>
+</xsl:template>
+
+<!-- Kind of patent document -->
+<xsl:template match="bibliomisc[@role='patenttype']" mode="iso690.mode">
+  <xsl:param name="pattype.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pattype.sep'"/></xsl:call-template>
+  </xsl:param>
+  <fo:inline font-style="italic">
+    <xsl:apply-templates mode="iso690.mode"/>
+  </fo:inline>
+  <xsl:value-of select="$pattype.sep"/>
+</xsl:template>
+
+<!-- Number -->
+<xsl:template match="biblioid[@class='other' and @otherclass='patentnum']|bibliomisc[@role='patentnum']" mode="iso690.mode">
+  <xsl:param name="patnum.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patnum.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:value-of select="$patnum.sep"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- Supplementary templates -->
+
+<xsl:template name="iso690.endsep">
+  <xsl:param name="text"/>
+  <xsl:param name="sep" select=". "/>
+  <xsl:choose>
+    <xsl:when test="substring($text,string-length($text))!=substring($sep,1,1)">
+      <xsl:value-of select="$sep"/>
+    </xsl:when>
+    <xsl:when test="substring($text,string-length($text))=' '">
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="' '"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="iso690.mode">
+  <xsl:apply-templates select="."/><!-- try the default mode -->
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 1169 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/biblio.xsl

@@ -0,0 +1,1169 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="bibliography">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="not(parent::*) or parent::part or parent::book">
+      <xsl:variable name="master-reference">
+        <xsl:call-template name="select.pagemaster"/>
+      </xsl:variable>
+
+      <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="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="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 id="{$id}">
+            <xsl:call-template name="bibliography.titlepage"/>
+          </fo:block>
+          <xsl:apply-templates/>
+        </fo:flow>
+      </fo:page-sequence>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}"
+                space-before.minimum="1em"
+                space-before.optimum="1.5em"
+                space-before.maximum="2em">
+        <xsl:call-template name="bibliography.titlepage"/>
+      </fo:block>
+      <xsl:apply-templates/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="bibliography/bibliographyinfo"></xsl:template>
+<xsl:template match="bibliography/info"></xsl:template>
+<xsl:template match="bibliography/title"></xsl:template>
+<xsl:template match="bibliography/subtitle"></xsl:template>
+<xsl:template match="bibliography/titleabbrev"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="bibliodiv">
+  <fo:block>
+    <xsl:attribute name="id">
+      <xsl:call-template name="object.id"/>
+    </xsl:attribute>
+    <xsl:call-template name="bibliodiv.titlepage"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="bibliodiv/title"/>
+<xsl:template match="bibliodiv/subtitle"/>
+<xsl:template match="bibliodiv/titleabbrev"/>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="bibliolist">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}"
+            space-before.minimum="1em"
+            space-before.optimum="1.5em"
+            space-before.maximum="2em">
+
+    <xsl:if test="blockinfo/title|info/title|title">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="*[not(self::blockinfo)
+                                   and not(self::info)
+                                   and not(self::title)
+                                   and not(self::titleabbrev)]"/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="biblioentry">
+  <xsl:param name="label">
+    <xsl:call-template name="biblioentry.label"/>
+  </xsl:param>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="string(.) = ''">
+      <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
+      <xsl:variable name="entry" select="$bib/bibliography/
+                                         *[@id=$id or @xml:id=$id][1]"/>
+      <xsl:choose>
+        <xsl:when test="$entry">
+          <xsl:choose>
+            <xsl:when test="$bibliography.numbered != 0">
+              <xsl:apply-templates select="$entry">
+                <xsl:with-param name="label" select="$label"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="$entry"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>No bibliography entry: </xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text> found in </xsl:text>
+            <xsl:value-of select="$bibliography.collection"/>
+          </xsl:message>
+          <fo:block id="{$id}" xsl:use-attribute-sets="normal.para.spacing">
+            <xsl:text>Error: no bibliography entry: </xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text> found in </xsl:text>
+            <xsl:value-of select="$bibliography.collection"/>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}" xsl:use-attribute-sets="biblioentry.properties">
+        <xsl:copy-of select="$label"/>
+	<xsl:choose>
+	  <xsl:when test="$bibliography.style = 'iso690'">
+	    <xsl:call-template name="iso690.makecitation"/>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:apply-templates mode="bibliography.mode"/>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="bibliomixed">
+  <xsl:param name="label">
+    <xsl:call-template name="biblioentry.label"/>
+  </xsl:param>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="string(.) = ''">
+      <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
+      <xsl:variable name="entry" select="$bib/bibliography/
+                                         *[@id=$id or @xml:id=$id][1]"/>
+      <xsl:choose>
+        <xsl:when test="$entry">
+          <xsl:choose>
+            <xsl:when test="$bibliography.numbered != 0">
+              <xsl:apply-templates select="$entry">
+                <xsl:with-param name="label" select="$label"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="$entry"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>No bibliography entry: </xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text> found in </xsl:text>
+            <xsl:value-of select="$bibliography.collection"/>
+          </xsl:message>
+          <fo:block id="{$id}" xsl:use-attribute-sets="normal.para.spacing">
+            <xsl:text>Error: no bibliography entry: </xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text> found in </xsl:text>
+            <xsl:value-of select="$bibliography.collection"/>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}" xsl:use-attribute-sets="biblioentry.properties">
+        <xsl:copy-of select="$label"/>
+        <xsl:apply-templates mode="bibliomixed.mode"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="biblioentry.label">
+  <xsl:param name="node" select="."/>
+
+  <xsl:choose>
+    <xsl:when test="$bibliography.numbered != 0">
+      <xsl:text>[</xsl:text>
+      <xsl:number from="bibliography" count="biblioentry|bibliomixed"
+                  level="any" format="1"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:when test="local-name($node/child::*[1]) = 'abbrev'">
+      <xsl:text>[</xsl:text>
+      <xsl:apply-templates select="$node/abbrev[1]"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:when test="$node/@xreflabel">
+      <xsl:text>[</xsl:text>
+      <xsl:value-of select="$node/@xreflabel"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:when test="$node/@id or $node/@xml:id">
+      <xsl:text>[</xsl:text>
+      <xsl:value-of select="($node/@id|$node/@xml:id)[1]"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:otherwise><!-- nop --></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="bibliography.mode">
+  <xsl:apply-templates select="."/><!-- try the default mode -->
+</xsl:template>
+
+<xsl:template match="abbrev" mode="bibliography.mode">
+  <xsl:if test="preceding-sibling::*">
+    <fo:inline>
+      <xsl:apply-templates mode="bibliography.mode"/>
+    </fo:inline>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="abstract" mode="bibliography.mode">
+  <!-- suppressed -->
+</xsl:template>
+
+<xsl:template match="address" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="affiliation" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="shortaffil" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="jobtitle" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="artheader|articleinfo|article/info" 
+              mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="artpagenums" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="author" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:call-template name="person.name"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="authorblurb|personblurb" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:call-template name="person.name.list"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="authorinitials" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="bibliomisc" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="bibliomset" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="biblioset" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="biblioset/title|biblioset/citetitle" 
+              mode="bibliography.mode">
+  <xsl:variable name="relation" select="../@relation"/>
+  <xsl:choose>
+    <xsl:when test="$relation='article' or @pubwork='article'">
+      <xsl:call-template name="gentext.startquote"/>
+      <xsl:apply-templates mode="bibliography.mode"/>
+      <xsl:call-template name="gentext.endquote"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:inline font-style="italic">
+        <xsl:apply-templates/>
+      </fo:inline>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:value-of select="$biblioentry.item.separator"/>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="bookbiblio" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="citetitle" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:choose>
+      <xsl:when test="@pubwork = 'article'">
+        <xsl:call-template name="gentext.startquote"/>
+        <xsl:apply-templates mode="bibliography.mode"/>
+        <xsl:call-template name="gentext.endquote"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <fo:inline font-style="italic">
+          <xsl:apply-templates mode="bibliography.mode"/>
+        </fo:inline>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="collab" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="confgroup" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="contractnum" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="contractsponsor" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="contrib" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="copyright" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'Copyright'"/>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:call-template name="dingbat">
+      <xsl:with-param name="dingbat">copyright</xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:apply-templates select="year" mode="bibliography.mode"/>
+    <xsl:if test="holder">
+      <xsl:call-template name="gentext.space"/>
+      <xsl:apply-templates select="holder" mode="bibliography.mode"/>
+    </xsl:if>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="year" mode="bibliography.mode">
+  <xsl:apply-templates/><xsl:text>, </xsl:text>
+</xsl:template>
+
+<xsl:template match="year[position()=last()]" mode="bibliography.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="holder" mode="bibliography.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="corpauthor" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="corpcredit" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="corpname" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="date" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="edition" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="editor" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:call-template name="person.name"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="firstname" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="honorific" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="bibliography.mode">
+  <xsl:apply-templates select="."/> 
+</xsl:template>
+
+<xsl:template match="invpartnumber" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="isbn" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="issn" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="issuenum" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="lineage" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="orgname" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="othername" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="pagenums" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="printhistory" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="productname" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="productnumber" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="publisher" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="publishername" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="pubsnumber" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="bibliography.mode">
+  <fo:block>
+    <xsl:apply-templates select="."/> <!-- use normal mode -->
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="seriesinfo" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="seriesvolnums" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="surname" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="title" mode="bibliography.mode">
+  <fo:inline>
+    <fo:inline font-style="italic">
+      <xsl:apply-templates mode="bibliography.mode"/>
+    </fo:inline>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="titleabbrev" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="volumenum" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="orgdiv" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="collabname" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="confdates" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="conftitle" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="confnum" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="confsponsor" mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="bibliocoverage|biblioid|bibliorelation|bibliosource"
+              mode="bibliography.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:value-of select="$biblioentry.item.separator"/>
+  </fo:inline>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="bibliomixed.mode">
+  <xsl:apply-templates select="."/><!-- try the default mode -->
+</xsl:template>
+
+<xsl:template match="abbrev" mode="bibliomixed.mode">
+  <xsl:if test="preceding-sibling::*">
+    <fo:inline>
+      <xsl:apply-templates mode="bibliomixed.mode"/>
+    </fo:inline>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="abstract" mode="bibliomixed.mode">
+  <fo:block start-indent="1in">
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="para" mode="bibliomixed.mode">
+  <fo:block>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="address" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="affiliation" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="shortaffil" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="jobtitle" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="artpagenums" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="author" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:call-template name="person.name"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="authorblurb|personblurb" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="authorinitials" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="bibliomisc" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="bibliomset" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="bibliomset/title|bibliomset/citetitle" 
+              mode="bibliomixed.mode">
+  <xsl:variable name="relation" select="../@relation"/>
+  <xsl:choose>
+    <xsl:when test="$relation='article' or @pubwork='article'">
+      <xsl:call-template name="gentext.startquote"/>
+      <xsl:apply-templates mode="bibliomixed.mode"/>
+      <xsl:call-template name="gentext.endquote"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:inline font-style="italic">
+        <xsl:apply-templates/>
+      </fo:inline>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="biblioset" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="citetitle" mode="bibliomixed.mode">
+  <xsl:choose>
+    <xsl:when test="@pubwork = 'article'">
+      <xsl:call-template name="gentext.startquote"/>
+      <xsl:apply-templates mode="bibliomixed.mode"/>
+      <xsl:call-template name="gentext.endquote"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:inline font-style="italic">
+        <xsl:apply-templates mode="bibliography.mode"/>
+      </fo:inline>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="collab" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="confgroup" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="contractnum" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="contractsponsor" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="contrib" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="copyright" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="corpcredit" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="corpname" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="date" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="edition" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="editor" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="firstname" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="honorific" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="bibliomixed.mode">
+  <xsl:apply-templates select="."/> 
+</xsl:template>
+
+<xsl:template match="invpartnumber" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="isbn" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="issn" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="issuenum" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="lineage" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="orgname" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="othername" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="pagenums" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="printhistory" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="productname" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="productnumber" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="publisher" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="publishername" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="pubsnumber" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="seriesvolnums" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="surname" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="title" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="titleabbrev" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="volumenum" mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="bibliocoverage|biblioid|bibliorelation|bibliosource"
+              mode="bibliomixed.mode">
+  <fo:inline>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </fo:inline>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 600 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/block.xsl

@@ -0,0 +1,600 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+<!-- What should we do about styling blockinfo? -->
+
+<xsl:template match="blockinfo|info">
+  <!-- suppress -->
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="block.object">
+  <fo:block>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="para">
+  <fo:block xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="simpara">
+  <fo:block xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="formalpara">
+  <fo:block xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- Only use title from info -->
+<xsl:template match="formalpara/info">
+  <xsl:apply-templates select="title"/>
+</xsl:template>
+
+<xsl:template match="formalpara/title|formalpara/info/title">
+  <xsl:variable name="titleStr">
+      <xsl:apply-templates/>
+  </xsl:variable>
+  <xsl:variable name="lastChar">
+    <xsl:if test="$titleStr != ''">
+      <xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <fo:inline font-weight="bold"
+             keep-with-next.within-line="always"
+             padding-end="1em">
+    <xsl:copy-of select="$titleStr"/>
+    <xsl:if test="$lastChar != ''
+                  and not(contains($runinhead.title.end.punct, $lastChar))">
+      <xsl:value-of select="$runinhead.default.title.end.punct"/>
+    </xsl:if>
+    <xsl:text>&#160;</xsl:text>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="formalpara/para">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="blockquote">
+  <fo:block xsl:use-attribute-sets="blockquote.properties">
+    <xsl:call-template name="anchor"/>
+    <fo:block>
+      <xsl:if test="title|info/title">
+        <fo:block xsl:use-attribute-sets="formal.title.properties">
+          <xsl:apply-templates select="." mode="object.title.markup"/>
+        </fo:block>
+      </xsl:if>
+      <xsl:apply-templates select="*[local-name(.) != 'title'
+                                   and local-name(.) != 'attribution']"/>
+    </fo:block>
+    <xsl:if test="attribution">
+      <fo:block text-align="right">
+        <!-- mdash -->
+        <xsl:text>&#x2014;</xsl:text>
+        <xsl:apply-templates select="attribution"/>
+      </fo:block>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="epigraph">
+  <fo:block>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates select="para|simpara|formalpara|literallayout"/>
+    <xsl:if test="attribution">
+      <fo:inline>
+        <xsl:text>--</xsl:text>
+        <xsl:apply-templates select="attribution"/>
+      </fo:inline>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="attribution">
+  <fo:inline><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="floater">
+  <xsl:param name="position" select="'none'"/>
+  <xsl:param name="clear" select="'both'"/>
+  <xsl:param name="width"/>
+  <xsl:param name="content"/>
+  <xsl:param name="start.indent">0pt</xsl:param>
+  <xsl:param name="end.indent">0pt</xsl:param>
+
+  <xsl:choose>
+    <xsl:when test="not($fop.extensions = 0)">
+      <!-- fop 0.20.5 does not support floats -->
+      <xsl:copy-of select="$content"/>
+    </xsl:when>
+    <xsl:when test="$position = 'none'">
+      <xsl:copy-of select="$content"/>
+    </xsl:when>
+    <xsl:when test="$position = 'before'">
+      <fo:float float="before">
+        <xsl:copy-of select="$content"/>
+      </fo:float>
+    </xsl:when>
+    <xsl:when test="$position = 'left' or
+                    $position = 'start' or
+                    $position = 'right' or
+                    $position = 'end' or
+                    $position = 'inside' or
+                    $position = 'outside'">
+      <xsl:variable name="float">
+        <fo:float float="{$position}"
+                  clear="{$clear}">
+          <fo:block-container 
+                    start-indent="{$start.indent}"
+                    end-indent="{$end.indent}">
+            <xsl:if test="$width != ''">
+              <xsl:attribute name="inline-progression-dimension">
+                <xsl:value-of select="$width"/>
+              </xsl:attribute>
+            </xsl:if>
+            <fo:block>
+              <xsl:copy-of select="$content"/>
+            </fo:block>
+          </fo:block-container>
+        </fo:float>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="$axf.extensions != 0 and self::sidebar">
+          <fo:block xsl:use-attribute-sets="normal.para.spacing"
+                    space-after="0pt"
+                    space-after.precedence="force"
+                    start-indent="0pt" end-indent="0pt">
+            <xsl:copy-of select="$float"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:when test="$axf.extensions != 0 and 
+                        ($position = 'left' or $position = 'start')">
+          <fo:float float="{$position}"
+                    clear="{$clear}">
+            <fo:block-container 
+                      inline-progression-dimension=".001mm"
+                      end-indent="{$start.indent} + {$width} + {$end.indent}">
+              <xsl:attribute name="start-indent">
+                <xsl:choose>
+                  <xsl:when test="ancestor::para">
+                    <!-- Special case for handling inline floats
+                         in Antenna House-->
+                    <xsl:value-of select="concat('-', $body.start.indent)"/>
+                  </xsl:when>
+                  <xsl:otherwise>0pt</xsl:otherwise>
+                </xsl:choose>
+              </xsl:attribute>
+              <fo:block start-indent="{$start.indent}"
+                        end-indent="-{$start.indent} - {$width}">
+                <xsl:copy-of select="$content"/>
+              </fo:block>
+            </fo:block-container>
+          </fo:float>
+
+        </xsl:when>
+        <xsl:when test="$axf.extensions != 0 and 
+                        ($position = 'right' or $position = 'end')">
+          <!-- Special case for handling inline floats in Antenna House-->
+          <fo:float float="{$position}"
+                    clear="{$clear}">
+            <fo:block-container 
+                      inline-progression-dimension=".001mm"
+                      end-indent="-{$body.end.indent}"
+                      start-indent="{$start.indent} + {$width} + {$end.indent}">
+              <fo:block end-indent="{$end.indent}"
+                        start-indent="-{$end.indent} - {$width}">
+                <xsl:copy-of select="$content"/>
+              </fo:block>
+            </fo:block-container>
+          </fo:float>
+
+        </xsl:when>
+        <xsl:when test="$xep.extensions != 0 and self::sidebar">
+          <!-- float needs some space above  to line up with following para -->
+          <fo:block xsl:use-attribute-sets="normal.para.spacing">
+            <xsl:copy-of select="$float"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:when test="$xep.extensions != 0">
+          <xsl:copy-of select="$float"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select="$float"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$content"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="sidebar" name="sidebar">
+  <!-- Also does margin notes -->
+  <xsl:variable name="pi-type">
+    <xsl:call-template name="pi.dbfo_float-type"/>
+  </xsl:variable>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$pi-type = 'margin.note'">
+      <xsl:call-template name="margin.note"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="content">
+        <fo:block xsl:use-attribute-sets="sidebar.properties"
+                  id="{$id}">
+          <xsl:call-template name="sidebar.titlepage"/>
+          <xsl:apply-templates select="node()[not(self::title) and
+                                         not(self::info) and
+                                         not(self::sidebarinfo)]"/>
+        </fo:block>
+      </xsl:variable>
+
+      <xsl:variable name="pi-width">
+        <xsl:call-template name="pi.dbfo_sidebar-width"/>
+      </xsl:variable>
+
+      <xsl:variable name="position">
+        <xsl:choose>
+          <xsl:when test="$pi-type != ''">
+            <xsl:value-of select="$pi-type"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$sidebar.float.type"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+    
+      <xsl:call-template name="floater">
+        <xsl:with-param name="content" select="$content"/>
+        <xsl:with-param name="position" select="$position"/>
+        <xsl:with-param name="width">
+          <xsl:choose>
+            <xsl:when test="$pi-width != ''">
+              <xsl:value-of select="$pi-width"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$sidebar.float.width"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+        <xsl:with-param name="start.indent">
+          <xsl:choose>
+            <xsl:when test="$position = 'start' or 
+                            $position = 'left'">0pt</xsl:when>
+            <xsl:when test="$position = 'end' or 
+                            $position = 'right'">0.5em</xsl:when>
+            <xsl:otherwise>0pt</xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+        <xsl:with-param name="end.indent">
+          <xsl:choose>
+            <xsl:when test="$position = 'start' or 
+                            $position = 'left'">0.5em</xsl:when>
+            <xsl:when test="$position = 'end' or 
+                            $position = 'right'">0pt</xsl:when>
+            <xsl:otherwise>0pt</xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="sidebar/title|sidebarinfo|sidebar/info"/>
+
+<xsl:template match="sidebar/title|sidebarinfo/title|sidebar/info/title"
+              mode="titlepage.mode" priority="1">
+  <fo:block xsl:use-attribute-sets="sidebar.title.properties">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template name="margin.note">
+  <xsl:param name="content">
+    <fo:block xsl:use-attribute-sets="margin.note.properties">
+      <xsl:if test="./title">
+        <fo:block xsl:use-attribute-sets="margin.note.title.properties">
+          <xsl:apply-templates select="./title" mode="margin.note.title.mode"/>
+        </fo:block>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </fo:block>
+  </xsl:param>
+
+  <xsl:variable name="pi-width">
+    <xsl:call-template name="pi.dbfo_sidebar-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="position" select="$margin.note.float.type"/>
+
+  <xsl:call-template name="floater">
+    <xsl:with-param name="content" select="$content"/>
+    <xsl:with-param name="position" select="$position"/>
+    <xsl:with-param name="width" >
+      <xsl:choose>
+        <xsl:when test="$pi-width != ''">
+          <xsl:value-of select="$pi-width"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$margin.note.width"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:with-param>
+    <xsl:with-param name="start.indent">
+      <xsl:choose>
+        <xsl:when test="$position = 'start' or 
+                        $position = 'left'">0pt</xsl:when>
+        <xsl:when test="$position = 'end' or 
+                        $position = 'right'">0.5em</xsl:when>
+        <xsl:otherwise>0pt</xsl:otherwise>
+      </xsl:choose>
+    </xsl:with-param>
+    <xsl:with-param name="end.indent">
+      <xsl:choose>
+        <xsl:when test="$position = 'start' or 
+                        $position = 'left'">0.5em</xsl:when>
+        <xsl:when test="$position = 'end' or 
+                        $position = 'right'">0pt</xsl:when>
+        <xsl:otherwise>0pt</xsl:otherwise>
+      </xsl:choose>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="sidebar/title" mode="margin.note.title.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="abstract">
+  <fo:block xsl:use-attribute-sets="abstract.properties">
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="abstract/title|abstract/info/title">
+  <fo:block xsl:use-attribute-sets="abstract.title.properties">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="msgset">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="msgentry">
+  <xsl:call-template name="block.object"/>
+</xsl:template>
+
+<xsl:template match="simplemsgentry">
+  <xsl:call-template name="block.object"/>
+</xsl:template>
+
+<xsl:template match="msg">
+  <xsl:call-template name="block.object"/>
+</xsl:template>
+
+<xsl:template match="msgmain">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="msgsub">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="msgrel">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="msgtext">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="msginfo">
+  <xsl:call-template name="block.object"/>
+</xsl:template>
+
+<xsl:template match="msglevel">
+  <fo:block>
+    <fo:inline font-weight="bold"
+               keep-with-next.within-line="always">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'msgset'"/>
+        <xsl:with-param name="name" select="'MsgLevel'"/>
+      </xsl:call-template>
+    </fo:inline>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="msgorig">
+  <fo:block>
+    <fo:inline font-weight="bold"
+               keep-with-next.within-line="always">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'msgset'"/>
+        <xsl:with-param name="name" select="'MsgOrig'"/>
+      </xsl:call-template>
+    </fo:inline>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="msgaud">
+  <fo:block>
+    <fo:inline font-weight="bold"
+               keep-with-next.within-line="always">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'msgset'"/>
+        <xsl:with-param name="name" select="'MsgAud'"/>
+      </xsl:call-template>
+    </fo:inline>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="msgexplan">
+  <xsl:call-template name="block.object"/>
+</xsl:template>
+
+<xsl:template match="msgexplan/title">
+  <fo:block font-weight="bold"
+            keep-with-next.within-column="always"
+            hyphenate="false">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- For better or worse, revhistory is allowed in content... -->
+
+<xsl:template match="revhistory">
+  <fo:table table-layout="fixed" xsl:use-attribute-sets="revhistory.table.properties">
+    <xsl:call-template name="anchor"/>
+    <fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
+    <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
+    <fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
+    <fo:table-body start-indent="0pt" end-indent="0pt">
+      <fo:table-row>
+        <fo:table-cell number-columns-spanned="3" xsl:use-attribute-sets="revhistory.table.cell.properties">
+          <fo:block xsl:use-attribute-sets="revhistory.title.properties">
+            <xsl:call-template name="gentext">
+              <xsl:with-param name="key" select="'RevHistory'"/>
+            </xsl:call-template>
+          </fo:block>
+        </fo:table-cell>
+      </fo:table-row>
+      <xsl:apply-templates/>
+    </fo:table-body>
+  </fo:table>
+</xsl:template>
+
+<xsl:template match="revhistory/revision">
+  <xsl:variable name="revnumber" select="revnumber"/>
+  <xsl:variable name="revdate"   select="date"/>
+  <xsl:variable name="revauthor" select="authorinitials|author"/>
+  <xsl:variable name="revremark" select="revremark|revdescription"/>
+  <fo:table-row>
+    <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+      <fo:block>
+        <xsl:call-template name="anchor"/>
+        <xsl:if test="$revnumber">
+          <xsl:call-template name="gentext">
+            <xsl:with-param name="key" select="'Revision'"/>
+          </xsl:call-template>
+          <xsl:call-template name="gentext.space"/>
+          <xsl:apply-templates select="$revnumber[1]"/>
+        </xsl:if>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+      <fo:block>
+        <xsl:apply-templates select="$revdate[1]"/>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+      <fo:block>
+        <xsl:for-each select="$revauthor">
+          <xsl:apply-templates select="."/>
+          <xsl:if test="position() != last()">
+            <xsl:text>, </xsl:text>
+          </xsl:if>
+        </xsl:for-each>
+      </fo:block>
+    </fo:table-cell>
+  </fo:table-row>
+  <xsl:if test="$revremark">
+    <fo:table-row>
+      <fo:table-cell number-columns-spanned="3" xsl:use-attribute-sets="revhistory.table.cell.properties">
+        <fo:block>
+          <xsl:apply-templates select="$revremark[1]"/>
+        </fo:block>
+      </fo:table-cell>
+    </fo:table-row>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="revision/revnumber">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="revision/date">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="revision/authorinitials">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="revision/author">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="revision/revremark">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="revision/revdescription">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="ackno">
+  <fo:block xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="highlights">
+  <xsl:call-template name="block.object"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 231 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/callout.xsl

@@ -0,0 +1,231 @@
+<?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:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim"
+                xmlns:xverb="com.nwalsh.xalan.Verbatim"
+                xmlns:lxslt="http://xml.apache.org/xslt"
+                exclude-result-prefixes="sverb xverb lxslt"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<lxslt:component prefix="xverb"
+                 functions="insertCallouts"/>
+
+<xsl:template match="programlistingco|screenco">
+  <xsl:variable name="verbatim" select="programlisting|screen"/>
+  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
+
+  <xsl:choose>
+    <xsl:when test="$use.extensions != '0'
+                    and $callouts.extension != '0'">
+      <xsl:variable name="rtf">
+        <xsl:apply-templates select="$verbatim">
+          <xsl:with-param name="suppress-numbers" select="'1'"/>
+        </xsl:apply-templates>
+      </xsl:variable>
+
+      <xsl:variable name="rtf-with-callouts">
+        <xsl:choose>
+          <xsl:when test="contains($vendor, 'SAXON ')">
+            <xsl:copy-of select="sverb:insertCallouts(areaspec,$rtf)"/>
+          </xsl:when>
+          <xsl:when test="contains($vendor, 'Apache Software Foundation')">
+            <xsl:copy-of select="xverb:insertCallouts(areaspec,$rtf)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:message terminate="yes">
+              <xsl:text>Don't know how to do callouts with </xsl:text>
+              <xsl:value-of select="$vendor"/>
+            </xsl:message>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$verbatim/@linenumbering = 'numbered'
+                        and $linenumbering.extension != '0'">
+          <xsl:call-template name="number.rtf.lines">
+            <xsl:with-param name="rtf" select="$rtf-with-callouts"/>
+            <xsl:with-param name="pi.context"
+                            select="programlisting|screen"/>
+          </xsl:call-template>
+          <xsl:apply-templates select="calloutlist"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select="$rtf-with-callouts"/>
+          <xsl:apply-templates select="calloutlist"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="areaspec|areaset|area">
+</xsl:template>
+
+<xsl:template match="areaset" mode="conumber">
+  <xsl:number count="area|areaset" format="1"/>
+</xsl:template>
+
+<xsl:template match="area" mode="conumber">
+  <xsl:number count="area|areaset" format="1"/>
+</xsl:template>
+
+<xsl:template match="co">
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates select="." mode="callout-bug"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="coref">
+  <!-- tricky; this relies on the fact that we can process the "co" that's -->
+  <!-- "over there" as if it were "right here" -->
+
+  <xsl:variable name="co" select="key('id', @linkend)"/>
+  <xsl:choose>
+    <xsl:when test="not($co)">
+      <xsl:message>
+        <xsl:text>Error: coref link is broken: </xsl:text>
+        <xsl:value-of select="@linkend"/>
+      </xsl:message>
+    </xsl:when>
+    <xsl:when test="local-name($co) != 'co'">
+      <xsl:message>
+        <xsl:text>Error: coref doesn't point to a co: </xsl:text>
+        <xsl:value-of select="@linkend"/>
+      </xsl:message>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:inline>
+        <xsl:call-template name="anchor"/>
+        <xsl:apply-templates select="$co" mode="callout-bug"/>
+      </fo:inline>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="co" mode="callout-bug">
+  <xsl:call-template name="callout-bug">
+    <xsl:with-param name="conum">
+      <xsl:number count="co"
+                  level="any"
+                  from="programlisting|screen|literallayout|synopsis"
+                  format="1"/>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="callout-bug">
+  <xsl:param name="conum" select='1'/>
+
+  <xsl:choose>
+    <!-- Draw callouts as images -->
+    <xsl:when test="$callout.graphics != '0'
+                    and $conum &lt;= $callout.graphics.number.limit">
+      <xsl:variable name="filename"
+                    select="concat($callout.graphics.path, $conum,
+		                   $callout.graphics.extension)"/>
+
+      <fo:external-graphic content-width="{$callout.icon.size}"
+                           width="{$callout.icon.size}">
+        <xsl:attribute name="src">
+          <xsl:choose>
+            <xsl:when test="$passivetex.extensions != 0
+                            or $fop.extensions != 0
+                            or $arbortext.extensions != 0">
+              <xsl:value-of select="$filename"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:text>url(</xsl:text>
+              <xsl:value-of select="$filename"/>
+              <xsl:text>)</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:attribute>
+      </fo:external-graphic>
+    </xsl:when>
+
+    <xsl:when test="$callout.unicode != 0
+                    and $conum &lt;= $callout.unicode.number.limit">
+      <xsl:variable name="comarkup">
+        <xsl:choose>
+          <xsl:when test="$callout.unicode.start.character = 10102">
+            <xsl:choose>
+              <xsl:when test="$conum = 1">&#10102;</xsl:when>
+              <xsl:when test="$conum = 2">&#10103;</xsl:when>
+              <xsl:when test="$conum = 3">&#10104;</xsl:when>
+              <xsl:when test="$conum = 4">&#10105;</xsl:when>
+              <xsl:when test="$conum = 5">&#10106;</xsl:when>
+              <xsl:when test="$conum = 6">&#10107;</xsl:when>
+              <xsl:when test="$conum = 7">&#10108;</xsl:when>
+              <xsl:when test="$conum = 8">&#10109;</xsl:when>
+              <xsl:when test="$conum = 9">&#10110;</xsl:when>
+              <xsl:when test="$conum = 10">&#10111;</xsl:when>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:message>
+              <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
+              <xsl:text>when $callout.unicode.start.character is </xsl:text>
+              <xsl:value-of select="$callout.unicode.start.character"/>
+            </xsl:message>
+            <fo:inline background-color="#404040"
+                       color="white"
+                       padding-top="0.1em"
+                       padding-bottom="0.1em"
+                       padding-start="0.2em"
+                       padding-end="0.2em"
+                       baseline-shift="0.1em"
+                       font-family="{$body.fontset}"
+                       font-weight="bold"
+                       font-size="75%">
+              <xsl:value-of select="$conum"/>
+            </fo:inline>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$callout.unicode.font != ''">
+          <fo:inline font-family="{$callout.unicode.font}">
+            <xsl:copy-of select="$comarkup"/>
+          </fo:inline>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select="$comarkup"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+
+    <!-- Most safe: draw a dark gray square with a white number inside -->
+    <xsl:otherwise>
+      <fo:inline background-color="#404040"
+                 color="white"
+                 padding-top="0.1em"
+                 padding-bottom="0.1em"
+                 padding-start="0.2em"
+                 padding-end="0.2em"
+                 baseline-shift="0.1em"
+                 font-family="{$body.fontset}"
+                 font-weight="bold"
+                 font-size="75%">
+        <xsl:value-of select="$conum"/>
+      </fo:inline>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 782 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/component.xsl

@@ -0,0 +1,782 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+
+<xsl:template name="component.title">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="pagewide" select="0"/>
+
+  <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:with-param name="allow-anchors" select="1"/>
+    </xsl:apply-templates>
+  </xsl:variable>
+
+  <xsl:variable name="titleabbrev">
+    <xsl:apply-templates select="$node" mode="titleabbrev.markup"/>
+  </xsl:variable>
+
+  <xsl:variable name="level">
+    <xsl:choose>
+      <xsl:when test="ancestor::section">
+        <xsl:value-of select="count(ancestor::section)+1"/>
+      </xsl:when>
+      <xsl:when test="ancestor::sect5">6</xsl:when>
+      <xsl:when test="ancestor::sect4">5</xsl:when>
+      <xsl:when test="ancestor::sect3">4</xsl:when>
+      <xsl:when test="ancestor::sect2">3</xsl:when>
+      <xsl:when test="ancestor::sect1">2</xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="$passivetex.extensions != 0">
+    <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex"
+                    fotex-bookmark-level="2"
+                    fotex-bookmark-label="{$id}">
+      <xsl:value-of select="$titleabbrev"/>
+    </fotex:bookmark>
+  </xsl:if>
+
+  <fo:block xsl:use-attribute-sets="component.title.properties">
+    <xsl:if test="$pagewide != 0">
+      <!-- Doesn't work to use 'all' here since not a child of fo:flow -->
+      <xsl:attribute name="span">inherit</xsl:attribute>
+    </xsl:if>
+    <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:if test="$axf.extensions != 0">
+      <xsl:attribute name="axf:outline-level">
+        <xsl:value-of select="count($node/ancestor::*)"/>
+      </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>
+
+    <!-- Let's handle the case where a component (bibliography, for example)
+         occurs inside a section; will we need parameters for this?
+         Danger Will Robinson: using section.title.level*.properties here
+         runs the risk that someone will set something other than
+         font-size there... -->
+    <xsl:choose>
+      <xsl:when test="$level=2">
+        <fo:block xsl:use-attribute-sets="section.title.level2.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=3">
+        <fo:block xsl:use-attribute-sets="section.title.level3.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=4">
+        <fo:block xsl:use-attribute-sets="section.title.level4.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=5">
+        <fo:block xsl:use-attribute-sets="section.title.level5.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=6">
+        <fo:block xsl:use-attribute-sets="section.title.level6.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- not in a section: do nothing special -->
+        <xsl:copy-of select="$title"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="dedication" mode="dedication">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}"
+                xsl:use-attribute-sets="component.titlepage.properties">
+        <xsl:call-template name="dedication.titlepage"/>
+      </fo:block>
+      <xsl:apply-templates/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="dedication"></xsl:template> <!-- see mode="dedication" -->
+<xsl:template match="dedication/docinfo"></xsl:template>
+<xsl:template match="dedication/title"></xsl:template>
+<xsl:template match="dedication/subtitle"></xsl:template>
+<xsl:template match="dedication/titleabbrev"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="colophon">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}"
+                xsl:use-attribute-sets="component.titlepage.properties">
+        <xsl:call-template name="colophon.titlepage"/>
+      </fo:block>
+      <xsl:apply-templates/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="colophon/title"></xsl:template>
+<xsl:template match="colophon/subtitle"></xsl:template>
+<xsl:template match="colophon/titleabbrev"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="preface">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}"
+                xsl:use-attribute-sets="component.titlepage.properties">
+        <xsl:call-template name="preface.titlepage"/>
+      </fo:block>
+
+      <xsl:variable name="toc.params">
+        <xsl:call-template name="find.path.params">
+          <xsl:with-param name="table" 
+                          select="normalize-space($generate.toc)"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:if test="contains($toc.params, 'toc')">
+        <xsl:call-template name="component.toc">
+          <xsl:with-param name="toc.title.p" 
+                          select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+        <xsl:call-template name="component.toc.separator"/>
+      </xsl:if>
+
+      <xsl:apply-templates/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="preface/docinfo|prefaceinfo"></xsl:template>
+<xsl:template match="preface/info"></xsl:template>
+<xsl:template match="preface/title"></xsl:template>
+<xsl:template match="preface/titleabbrev"></xsl:template>
+<xsl:template match="preface/subtitle"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="chapter">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}"
+                xsl:use-attribute-sets="component.titlepage.properties">
+        <xsl:call-template name="chapter.titlepage"/>
+      </fo:block>
+
+      <xsl:variable name="toc.params">
+        <xsl:call-template name="find.path.params">
+          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:if test="contains($toc.params, 'toc')">
+        <xsl:call-template name="component.toc">
+          <xsl:with-param name="toc.title.p" 
+                          select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+        <xsl:call-template name="component.toc.separator"/>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="chapter/docinfo|chapterinfo"></xsl:template>
+<xsl:template match="chapter/info"></xsl:template>
+<xsl:template match="chapter/title"></xsl:template>
+<xsl:template match="chapter/titleabbrev"></xsl:template>
+<xsl:template match="chapter/subtitle"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="appendix">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}"
+                xsl:use-attribute-sets="component.titlepage.properties">
+        <xsl:call-template name="appendix.titlepage"/>
+      </fo:block>
+
+      <xsl:variable name="toc.params">
+        <xsl:call-template name="find.path.params">
+          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:if test="contains($toc.params, 'toc')">
+        <xsl:call-template name="component.toc">
+          <xsl:with-param name="toc.title.p" 
+                          select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+        <xsl:call-template name="component.toc.separator"/>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="appendix/docinfo|appendixinfo"></xsl:template>
+<xsl:template match="appendix/info"></xsl:template>
+<xsl:template match="appendix/title"></xsl:template>
+<xsl:template match="appendix/titleabbrev"></xsl:template>
+<xsl:template match="appendix/subtitle"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="article">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}"
+                xsl:use-attribute-sets="component.titlepage.properties">
+        <xsl:call-template name="article.titlepage"/>
+      </fo:block>
+
+      <xsl:variable name="toc.params">
+        <xsl:call-template name="find.path.params">
+          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:if test="contains($toc.params, 'toc')">
+        <xsl:call-template name="component.toc">
+          <xsl:with-param name="toc.title.p" 
+                          select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+        <xsl:call-template name="component.toc.separator"/>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="article/artheader"></xsl:template>
+<xsl:template match="article/articleinfo"></xsl:template>
+<xsl:template match="article/info"></xsl:template>
+<xsl:template match="article/title"></xsl:template>
+<xsl:template match="article/subtitle"></xsl:template>
+<xsl:template match="article/titleabbrev"></xsl:template>
+
+<xsl:template match="article/appendix">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="title">
+    <xsl:apply-templates select="." mode="object.title.markup"/>
+  </xsl:variable>
+
+  <xsl:variable name="titleabbrev">
+    <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+  </xsl:variable>
+
+  <fo:block id='{$id}'>
+    <xsl:if test="$axf.extensions != 0">
+      <xsl:attribute name="axf:outline-level">
+        <xsl:value-of select="count(ancestor::*)+2"/>
+      </xsl:attribute>
+      <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
+      <xsl:attribute name="axf:outline-title">
+        <xsl:value-of select="normalize-space($titleabbrev)"/>
+      </xsl:attribute>
+    </xsl:if>
+
+    <xsl:if test="$passivetex.extensions != 0">
+      <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex" 
+                      fotex-bookmark-level="{count(ancestor::*)+2}" 
+                      fotex-bookmark-label="{$id}">
+        <xsl:value-of select="$titleabbrev"/>
+      </fotex:bookmark>
+    </xsl:if>
+
+    <fo:block xsl:use-attribute-sets="article.appendix.title.properties">
+      <fo:marker marker-class-name="section.head.marker">
+        <xsl:choose>
+          <xsl:when test="$titleabbrev = ''">
+            <xsl:value-of select="$title"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$titleabbrev"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:marker>
+      <xsl:copy-of select="$title"/>
+    </fo:block>
+
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!-- Utility template to create a page sequence for an element -->
+<xsl:template match="*" mode="page.sequence" name="page.sequence">
+  <xsl:param name="content">
+    <xsl:apply-templates/>
+  </xsl:param>
+  <xsl:param name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:param>
+  <xsl:param name="element" select="local-name(.)"/>
+  <xsl:param name="gentext-key" select="local-name(.)"/>
+
+  <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="master-reference" select="$master-reference"/>
+        <xsl:with-param name="element" select="$element"/>
+      </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="$master-reference"/>
+        <xsl:with-param name="element" select="$element"/>
+      </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:with-param name="element" select="$element"/>
+      </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:with-param name="gentext-key" select="$gentext-key"/>
+    </xsl:apply-templates>
+
+    <xsl:apply-templates select="." mode="running.foot.mode">
+      <xsl:with-param name="master-reference" select="$master-reference"/>
+      <xsl:with-param name="gentext-key" select="$gentext-key"/>
+    </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>
+
+      <xsl:copy-of select="$content"/>
+
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 611 - 0
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$
+     ********************************************************************
+
+     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>
+

+ 331 - 0
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$
+     ********************************************************************
+
+     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>

+ 325 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/ebnf.xsl

@@ -0,0 +1,325 @@
+<?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:doc="http://nwalsh.com/xsl/documentation/1.0"
+                exclude-result-prefixes="doc"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<doc:reference xmlns="">
+<referenceinfo>
+<releaseinfo role="meta">
+$Id$
+</releaseinfo>
+<author><surname>Walsh</surname>
+<firstname>Norman</firstname></author>
+<copyright><year>1999</year><year>2000</year><year>2001</year>
+<holder>Norman Walsh</holder>
+</copyright>
+</referenceinfo>
+<title>HTML EBNF Reference</title>
+
+<partintro>
+<section><title>Introduction</title>
+
+<para>This is technical reference documentation for the DocBook XSL
+Stylesheets; it documents (some of) the parameters, templates, and
+other elements of the stylesheets.</para>
+
+<para>This reference describes the templates and parameters relevant
+to formatting EBNF markup.</para>
+
+<para>This is not intended to be <quote>user</quote> documentation.
+It is provided for developers writing customization layers for the
+stylesheets, and for anyone who's interested in <quote>how it
+works</quote>.</para>
+
+<para>Although I am trying to be thorough, this documentation is known
+to be incomplete. Don't forget to read the source, too :-)</para>
+</section>
+</partintro>
+</doc:reference>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="productionset">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="title">
+      <fo:block id="{$id}" xsl:use-attribute-sets="formal.object.properties">
+        <xsl:call-template name="formal.object.heading">
+          <xsl:with-param name="placement" select="'before'"/>
+        </xsl:call-template>
+
+        <fo:table table-layout="fixed" width="100%">
+          <fo:table-column column-number="1" column-width="3%"/>
+          <fo:table-column column-number="2" column-width="15%"/>
+          <fo:table-column column-number="3" column-width="5%"/>
+          <fo:table-column column-number="4" column-width="52%"/>
+          <fo:table-column column-number="5" column-width="25%"/>
+          <fo:table-body start-indent="0pt" end-indent="0pt">
+            <xsl:apply-templates select="production|productionrecap"/>
+          </fo:table-body>
+        </fo:table>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:table id="{$id}" table-layout="fixed" width="100%">
+        <fo:table-column column-number="1" column-width="3%"/>
+        <fo:table-column column-number="2" column-width="15%"/>
+        <fo:table-column column-number="3" column-width="5%"/>
+        <fo:table-column column-number="4" column-width="52%"/>
+        <fo:table-column column-number="5" column-width="25%"/>
+        <fo:table-body start-indent="0pt" end-indent="0pt">
+          <xsl:apply-templates select="production|productionrecap"/>
+        </fo:table-body>
+      </fo:table>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="productionset/title">
+  <!-- suppressed -->
+</xsl:template>
+
+<xsl:template match="production">
+  <xsl:param name="recap" select="false()"/>
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+  <fo:table-row>
+    <fo:table-cell>
+      <fo:block text-align="start">
+        <xsl:text>[</xsl:text>
+        <xsl:number count="production" level="any"/>
+        <xsl:text>]</xsl:text>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell>
+      <fo:block text-align="end">
+        <xsl:choose>
+          <xsl:when test="$recap">
+            <fo:basic-link internal-destination="{$id}"
+                           xsl:use-attribute-sets="xref.properties">
+              <xsl:apply-templates select="lhs"/>
+            </fo:basic-link>
+          </xsl:when>
+          <xsl:otherwise>
+            <fo:wrapper id="{$id}">
+              <xsl:apply-templates select="lhs"/>
+            </fo:wrapper>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell>
+      <fo:block text-align="center">
+        <xsl:copy-of select="$ebnf.assignment"/>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell>
+      <fo:block>
+        <xsl:apply-templates select="rhs"/>
+        <xsl:copy-of select="$ebnf.statement.terminator"/>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell border-start-width="3pt">
+      <fo:block text-align="start">
+        <xsl:choose>
+          <xsl:when test="rhs/lineannotation|constraint">
+            <xsl:apply-templates select="rhs/lineannotation" mode="rhslo"/>
+            <xsl:apply-templates select="constraint"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>&#160;</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:block>
+    </fo:table-cell>
+  </fo:table-row>
+</xsl:template>
+
+<xsl:template match="productionrecap">
+  <xsl:variable name="targets" select="key('id',@linkend)"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+
+  <xsl:if test="count($targets)=0">
+    <xsl:message>
+      <xsl:text>Error: no ID for productionrecap linkend: </xsl:text>
+      <xsl:value-of select="@linkend"/>
+      <xsl:text>.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:if test="count($targets)>1">
+    <xsl:message>
+      <xsl:text>Warning: multiple "IDs" for productionrecap linkend: </xsl:text>
+      <xsl:value-of select="@linkend"/>
+      <xsl:text>.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:apply-templates select="$target">
+    <xsl:with-param name="recap" select="true()"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="lhs">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="rhs">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="nonterminal">
+  <xsl:variable name="linkend">
+    <xsl:call-template name="xpointer.idref">
+      <xsl:with-param name="xpointer" select="@def"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:call-template name="check.id.unique">
+    <xsl:with-param name="linkend" select="$linkend"/>
+  </xsl:call-template>
+
+  <xsl:call-template name="check.idref.targets">
+    <xsl:with-param name="linkend" select="$linkend"/>
+    <xsl:with-param name="element-list">production</xsl:with-param>
+  </xsl:call-template>
+
+  <!-- If you don't provide content, you can't point outside this doc. -->
+  <xsl:choose>
+    <xsl:when test="*|text()"><!--nop--></xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$linkend = ''">
+	<xsl:message>
+	  <xsl:text>Non-terminals with no content must point to </xsl:text>
+	  <xsl:text>production elements in the current document.</xsl:text>
+	</xsl:message>
+	<xsl:message>
+	  <xsl:text>Invalid xpointer for empty nt: </xsl:text>
+	  <xsl:value-of select="@def"/>
+	</xsl:message>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:variable name="href">
+    <xsl:choose>
+      <xsl:when test="$linkend != ''">
+	<xsl:variable name="targets" select="key('id',$linkend)"/>
+	<xsl:variable name="target" select="$targets[1]"/>
+        <xsl:call-template name="object.id">
+          <xsl:with-param name="object" select="$target"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:value-of select="@def"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:basic-link internal-destination="{$href}"
+                 xsl:use-attribute-sets="xref.properties">
+    <xsl:choose>
+      <xsl:when test="*|text()">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="$linkend != ''">
+            <xsl:variable name="targets" select="key('id',$linkend)"/>
+            <xsl:variable name="target" select="$targets[1]"/>
+            <xsl:apply-templates select="$target/lhs"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>???</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:basic-link>
+</xsl:template>
+
+<xsl:template match="rhs/lineannotation">
+  <!--nop-->
+</xsl:template>
+
+<xsl:template match="rhs/lineannotation" mode="rhslo">
+  <xsl:text>/*&#160;</xsl:text>
+  <xsl:apply-templates/>
+  <xsl:text>&#160;*/</xsl:text>
+</xsl:template>
+
+<xsl:template match="constraint">
+  <xsl:call-template name="check.id.unique">
+    <xsl:with-param name="linkend" select="@linkend"/>
+  </xsl:call-template>
+
+  <xsl:call-template name="check.idref.targets">
+    <xsl:with-param name="linkend" select="@linkend"/>
+    <xsl:with-param name="element-list">constraintdef</xsl:with-param>
+  </xsl:call-template>
+
+  <xsl:variable name="href">
+    <xsl:variable name="targets" select="key('id',@linkend)"/>
+    <xsl:variable name="target" select="$targets[1]"/>
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="$target"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:if test="preceding-sibling::constraint">
+    <fo:inline linefeed-treatment="preserve">&#xA;</fo:inline>
+  </xsl:if>
+  <xsl:text>[&#160;</xsl:text>
+
+  <xsl:choose>
+    <xsl:when test="@role">
+      <xsl:value-of select="@role"/>
+      <xsl:text>: </xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="targets" select="key('id',@linkend)"/>
+      <xsl:variable name="target" select="$targets[1]"/>
+      <xsl:if test="$target/@role">
+	<xsl:value-of select="$target/@role"/>
+	<xsl:text>: </xsl:text>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <fo:basic-link internal-destination="{$href}"
+                 xsl:use-attribute-sets="xref.properties">
+    <xsl:variable name="targets" select="key('id',@linkend)"/>
+    <xsl:variable name="target" select="$targets[1]"/>
+    <xsl:apply-templates select="$target" mode="title.markup"/>
+  </fo:basic-link>
+  <xsl:text>&#160;]</xsl:text>
+</xsl:template>
+
+<xsl:template match="constraintdef">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+  <fo:block id="{$id}">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="constraintdef/title">
+  <fo:block font-weight="bold">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 154 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/fo-rtf.xsl

@@ -0,0 +1,154 @@
+<?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:exsl="http://exslt.org/common"
+                xmlns:set="http://exslt.org/sets"
+                exclude-result-prefixes="exsl set"
+                version="1.0">
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the DocBook XSL Stylesheet distribution.
+     See ../README or http://docbook.sf.net/ for copyright
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- This module contains templates that match against FO nodes. It is used
+     to post-process result tree fragments for some sorts of cleanup.
+     These templates can only ever be fired by a processor that supports
+     exslt:node-set(). -->
+
+<!-- ==================================================================== -->
+
+<!-- insert.fo.fnum mode templates insert a particular RTF at the beginning
+     of the first paragraph in the primary RTF. In fact, they are inserting
+     a footnote-number, so we tinker a few other things too, like spacing and
+     font-sizes. -->
+
+<xsl:template match="/" mode="insert.fo.fnum">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:apply-templates mode="insert.fo.fnum">
+    <xsl:with-param name="mark" select="$mark"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="*" mode="insert.fo.fnum">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="insert.fo.fnum">
+      <xsl:with-param name="mark" select="$mark"/>
+    </xsl:apply-templates>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="fo:block" mode="insert.fo.fnum">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:copy>
+    <xsl:for-each select="@*">
+      <xsl:choose>
+        <xsl:when test="starts-with(name(.), 'space-before')"/>
+        <xsl:when test="starts-with(name(.), 'space-after')"/>
+        <xsl:when test="starts-with(name(.), 'font-size')"/>
+        <xsl:otherwise>
+          <xsl:copy-of select="."/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:if test="not(preceding::fo:block)">
+      <xsl:copy-of select="$mark"/>
+    </xsl:if>
+    <xsl:apply-templates mode="insert.fo.fnum">
+      <xsl:with-param name="mark" select="$mark"/>
+    </xsl:apply-templates>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.fnum">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:copy/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!-- insert.fo.block mode templates insert a particular RTF at the beginning
+     of the first paragraph in the primary RTF. -->
+
+<xsl:template match="/" mode="insert.fo.block">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:apply-templates mode="insert.fo.block">
+    <xsl:with-param name="mark" select="$mark"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="*" mode="insert.fo.block">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="insert.fo.block">
+      <xsl:with-param name="mark" select="$mark"/>
+    </xsl:apply-templates>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="fo:block" mode="insert.fo.block">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:if test="not(preceding::fo:block)">
+      <xsl:copy-of select="$mark"/>
+    </xsl:if>
+    <xsl:apply-templates mode="insert.fo.block">
+      <xsl:with-param name="mark" select="$mark"/>
+    </xsl:apply-templates>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.block">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:copy/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!-- insert.fo.text mode templates insert a particular RTF at the beginning
+     of the first text-node in the primary RTF. -->
+
+<xsl:template match="/" mode="insert.fo.text">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:apply-templates mode="insert.fo.text">
+    <xsl:with-param name="mark" select="$mark"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="*" mode="insert.fo.text">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="insert.fo.text">
+      <xsl:with-param name="mark" select="$mark"/>
+    </xsl:apply-templates>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.text">
+  <xsl:param name="mark" select="'?'"/>
+
+  <xsl:if test="not(preceding::text())">
+    <xsl:copy-of select="$mark"/>
+  </xsl:if>
+
+  <xsl:copy/>
+</xsl:template>
+
+<xsl:template match="processing-instruction()|comment()" mode="insert.fo.text">
+  <xsl:param name="mark" select="'?'"/>
+  <xsl:copy/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 71 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/fo.xsl

@@ -0,0 +1,71 @@
+<?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$
+     ********************************************************************
+
+     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="anchor">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="conditional" select="1"/>
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="$node"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id">
+    <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="dingbat">
+  <xsl:param name="dingbat">bullet</xsl:param>
+  <xsl:variable name="symbol">
+    <xsl:choose>
+      <xsl:when test="$dingbat='bullet'">o</xsl:when>
+      <xsl:when test="$dingbat='copyright'">&#x00A9;</xsl:when>
+      <xsl:when test="$dingbat='trademark'">&#x2122;</xsl:when>
+      <xsl:when test="$dingbat='trade'">&#x2122;</xsl:when>
+      <xsl:when test="$dingbat='registered'">&#x00AE;</xsl:when>
+      <xsl:when test="$dingbat='service'">(SM)</xsl:when>
+      <xsl:when test="$dingbat='ldquo'">"</xsl:when>
+      <xsl:when test="$dingbat='rdquo'">"</xsl:when>
+      <xsl:when test="$dingbat='lsquo'">'</xsl:when>
+      <xsl:when test="$dingbat='rsquo'">'</xsl:when>
+      <xsl:when test="$dingbat='em-dash'">&#x2014;</xsl:when>
+      <xsl:when test="$dingbat='en-dash'">-</xsl:when>
+      <xsl:otherwise>o</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$dingbat.font.family = ''">
+      <xsl:copy-of select="$symbol"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:inline font-family="{$dingbat.font.family}">
+        <xsl:copy-of select="$symbol"/>
+      </fo:inline>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="href.target">
+  <xsl:param name="context" select="."/>
+  <xsl:param name="object" select="."/>
+  <xsl:text>#</xsl:text>
+  <xsl:call-template name="object.id">
+    <xsl:with-param name="object" select="$object"/>
+  </xsl:call-template>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 186 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/footnote.xsl

@@ -0,0 +1,186 @@
+<?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:exsl="http://exslt.org/common"
+                exclude-result-prefixes="exsl"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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="format.footnote.mark">
+  <xsl:param name="mark" select="'?'"/>
+  <fo:inline xsl:use-attribute-sets="footnote.mark.properties">
+    <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="$mark"/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="footnote">
+  <xsl:choose>
+    <xsl:when test="ancestor::table or ancestor::informaltable">
+      <xsl:call-template name="format.footnote.mark">
+        <xsl:with-param name="mark">
+          <xsl:apply-templates select="." mode="footnote.number"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:footnote>
+        <fo:inline>
+          <xsl:call-template name="format.footnote.mark">
+            <xsl:with-param name="mark">
+              <xsl:apply-templates select="." mode="footnote.number"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </fo:inline>
+        <fo:footnote-body xsl:use-attribute-sets="footnote.properties">
+          <xsl:apply-templates/>
+        </fo:footnote-body>
+      </fo:footnote>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="footnoteref">
+  <xsl:variable name="footnote" select="key('id',@linkend)"/>
+  <xsl:call-template name="format.footnote.mark">
+    <xsl:with-param name="mark">
+      <xsl:apply-templates select="$footnote" mode="footnote.number"/>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="footnote" mode="footnote.number">
+  <xsl:choose>
+    <xsl:when test="string-length(@label) != 0">
+      <xsl:value-of select="@label"/>
+    </xsl:when>
+    <xsl:when test="ancestor::table or ancestor::informaltable">
+      <xsl:variable name="tfnum">
+        <xsl:number level="any" from="table|informaltable" format="1"/>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="string-length($table.footnote.number.symbols) &gt;= $tfnum">
+          <xsl:value-of select="substring($table.footnote.number.symbols, $tfnum, 1)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number level="any" from="table|informaltable"
+                      format="{$table.footnote.number.format}"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="fnum">
+        <!-- FIXME: list in @from is probably not complete -->
+        <xsl:number level="any" 
+                    from="chapter|appendix|preface|article|refentry|bibliography" 
+                    count="footnote[not(@label)][not(ancestor::table) and not(ancestor::informaltable)]|ulink[$ulink.footnotes != 0][node()][@url != .][not(ancestor::footnote)][ulink.show != 0]" 
+                    format="1"/>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="string-length($footnote.number.symbols) &gt;= $fnum">
+          <xsl:value-of select="substring($footnote.number.symbols, $fnum, 1)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:number value="$fnum" format="{$footnote.number.format}"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="footnote.body.number">
+  <xsl:variable name="footnote.mark">
+    <xsl:call-template name="format.footnote.mark">
+      <xsl:with-param name="mark">
+        <xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="fo">
+    <xsl:apply-templates select="."/>
+  </xsl:variable>
+
+  <xsl:variable name="fo-nodes" select="exsl:node-set($fo)"/>
+
+  <xsl:choose>
+    <xsl:when test="$fo-nodes//fo:block">
+      <xsl:apply-templates select="$fo-nodes" mode="insert.fo.fnum">
+        <xsl:with-param name="mark" select="$footnote.mark"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="$fo-nodes" mode="insert.fo.text">
+        <xsl:with-param name="mark" select="$footnote.mark"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="footnote/para[1]
+                     |footnote/simpara[1]
+                     |footnote/formalpara[1]"
+              priority="2">
+  <!-- this only works if the first thing in a footnote is a para, -->
+  <!-- which is ok, because it usually is. -->
+  <fo:block>
+    <xsl:call-template name="format.footnote.mark">
+      <xsl:with-param name="mark">
+        <xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
+      </xsl:with-param>
+    </xsl:call-template>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="footnote" mode="table.footnote.mode">
+  <xsl:choose>
+    <xsl:when test="local-name(*[1]) = 'para' or local-name(*[1]) = 'simpara'">
+      <fo:block xsl:use-attribute-sets="table.footnote.properties">
+        <xsl:apply-templates/>
+      </fo:block>
+    </xsl:when>
+
+    <xsl:when test="function-available('exsl:node-set')">
+      <fo:block xsl:use-attribute-sets="table.footnote.properties">
+        <xsl:apply-templates select="*[1]" mode="footnote.body.number"/>
+        <xsl:apply-templates select="*[position() &gt; 1]"/>
+      </fo:block>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>Warning: footnote number may not be generated </xsl:text>
+        <xsl:text>correctly; </xsl:text>
+        <xsl:value-of select="local-name(*[1])"/>
+        <xsl:text> unexpected as first child of footnote.</xsl:text>
+      </xsl:message>
+      <fo:block xsl:use-attribute-sets="table.footnote.properties">
+        <xsl:apply-templates/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 92 - 0
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$
+     ********************************************************************
+     (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>
+

+ 71 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/fop1.xsl

@@ -0,0 +1,71 @@
+<?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'>
+
+<xsl:template match="*" mode="fop1.outline">
+  <xsl:apply-templates select="*" mode="fop1.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="fop1.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::*">
+      <fo:bookmark internal-destination="{$id}">
+        <fo:bookmark-title>
+          <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
+        </fo:bookmark-title>
+        <xsl:apply-templates select="*" mode="fop1.outline"/>
+      </fo:bookmark>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:bookmark internal-destination="{$id}">
+        <fo:bookmark-title>
+          <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
+        </fo:bookmark-title>
+      </fo:bookmark>
+
+      <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)">
+        <fo:bookmark internal-destination="toc...{$id}">
+          <fo:bookmark-title>
+            <xsl:call-template name="gentext">
+              <xsl:with-param name="key" select="'TableofContents'"/>
+            </xsl:call-template>
+          </fo:bookmark-title>
+        </fo:bookmark>
+      </xsl:if>
+      <xsl:apply-templates select="*" mode="fop1.outline"/>
+    </xsl:otherwise>
+  </xsl:choose>
+<!--
+  <fo:bookmark internal-destination="{$id}"/>
+-->
+</xsl:template>
+
+
+</xsl:stylesheet>

+ 534 - 0
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$
+     ********************************************************************
+
+     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>

+ 1139 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/glossary.xsl

@@ -0,0 +1,1139 @@
+<?xml version='1.0'?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY % common.entities SYSTEM "../common/entities.ent">
+%common.entities;
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="glossary">
+  <xsl:call-template name="make-glossary"/>
+</xsl:template>
+
+<xsl:template match="glossdiv/title"/>
+<xsl:template match="glossdiv/subtitle"/>
+<xsl:template match="glossdiv/titleabbrev"/>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="make-glossary">
+  <xsl:param name="divs" select="glossdiv"/>
+  <xsl:param name="entries" select="glossentry"/>
+  <xsl:param name="preamble" select="*[not(self::title
+                                           or self::subtitle
+                                           or self::glossdiv
+                                           or self::glossentry)]"/>
+
+  &setup-language-variable;
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="presentation">
+    <xsl:call-template name="pi.dbfo_glossary-presentation"/>
+  </xsl:variable>
+
+  <xsl:variable name="term-width">
+    <xsl:call-template name="pi.dbfo_glossterm-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="width">
+    <xsl:choose>
+      <xsl:when test="$term-width = ''">
+        <xsl:value-of select="$glossterm.width"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$term-width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:call-template name="glossary.titlepage"/>
+  </fo:block>
+
+  <xsl:if test="$preamble">
+    <xsl:apply-templates select="$preamble"/>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="$presentation = 'list'">
+      <xsl:apply-templates select="$divs" mode="glossary.as.list">
+        <xsl:with-param name="width" select="$width"/>
+      </xsl:apply-templates>
+      <xsl:if test="$entries">
+        <fo:list-block provisional-distance-between-starts="{$width}"
+                       provisional-label-separation="{$glossterm.separation}"
+                       xsl:use-attribute-sets="normal.para.spacing">
+          <xsl:choose>
+            <xsl:when test="$glossary.sort != 0">
+              <xsl:apply-templates select="$entries" mode="glossary.as.list">
+                <xsl:sort lang="{$language}"
+                          select="translate(glossterm, $lowercase, 
+                                            $uppercase)"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </fo:list-block>
+      </xsl:if>
+    </xsl:when>
+    <xsl:when test="$presentation = 'blocks'">
+      <xsl:apply-templates select="$divs" mode="glossary.as.blocks"/>
+      <xsl:choose>
+        <xsl:when test="$glossary.sort != 0">
+          <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
+            <xsl:sort lang="{$language}"
+                      select="translate(glossterm, $lowercase, 
+                                        $uppercase)"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="$glossary.as.blocks != 0">
+      <xsl:apply-templates select="$divs" mode="glossary.as.blocks"/>
+      <xsl:choose>
+        <xsl:when test="$glossary.sort != 0">
+          <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
+            <xsl:sort lang="{$language}"
+                      select="translate(glossterm, $lowercase, 
+                                        $uppercase)"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="$divs" mode="glossary.as.list">
+        <xsl:with-param name="width" select="$width"/>
+      </xsl:apply-templates>
+      <xsl:if test="$entries">
+        <fo:list-block provisional-distance-between-starts="{$width}"
+                       provisional-label-separation="{$glossterm.separation}"
+                       xsl:use-attribute-sets="normal.para.spacing">
+          <xsl:choose>
+            <xsl:when test="$glossary.sort != 0">
+              <xsl:apply-templates select="$entries" mode="glossary.as.list">
+                <xsl:sort lang="{$language}"
+                          select="translate(glossterm, $lowercase, 
+                                            $uppercase)"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </fo:list-block>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="book/glossary|part/glossary|/glossary" priority="2">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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>
+
+      <xsl:call-template name="make-glossary"/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="glossary/glossaryinfo"></xsl:template>
+<xsl:template match="glossary/info"></xsl:template>
+<xsl:template match="glossary/title"></xsl:template>
+<xsl:template match="glossary/subtitle"></xsl:template>
+<xsl:template match="glossary/titleabbrev"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="glosslist">
+  &setup-language-variable;
+
+  <xsl:variable name="presentation">
+    <xsl:call-template name="pi.dbfo_glosslist-presentation"/>
+  </xsl:variable>
+
+  <xsl:variable name="term-width">
+    <xsl:call-template name="pi.dbfo_glossterm-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="width">
+    <xsl:choose>
+      <xsl:when test="$term-width = ''">
+        <xsl:value-of select="$glossterm.width"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$term-width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="title or info/title">
+    <xsl:apply-templates select="(title|info/title)[1]" mode="list.title.mode"/>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="$presentation = 'list'">
+      <fo:list-block provisional-distance-between-starts="{$width}"
+                     provisional-label-separation="{$glossterm.separation}"
+                     xsl:use-attribute-sets="normal.para.spacing">
+        <xsl:choose>
+          <xsl:when test="$glossary.sort != 0">
+            <xsl:apply-templates select="glossentry" mode="glossary.as.list">
+              <xsl:sort lang="{$language}"
+                        select="translate(glossterm, $lowercase, 
+                                          $uppercase)"/>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="glossentry" mode="glossary.as.list"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:list-block>
+    </xsl:when>
+    <xsl:when test="$presentation = 'blocks'">
+      <xsl:choose>
+        <xsl:when test="$glossary.sort != 0">
+          <xsl:apply-templates select="glossentry" mode="glossary.as.blocks">
+            <xsl:sort lang="{$language}"
+                      select="translate(glossterm, $lowercase, 
+                                        $uppercase)"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="glossentry" mode="glossary.as.blocks"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="$glosslist.as.blocks != 0">
+      <xsl:choose>
+        <xsl:when test="$glossary.sort != 0">
+          <xsl:apply-templates select="glossentry" mode="glossary.as.blocks">
+            <xsl:sort lang="{$language}"
+                      select="translate(glossterm, $lowercase, 
+                                        $uppercase)"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="glossentry" mode="glossary.as.blocks"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-block provisional-distance-between-starts="{$width}"
+                     provisional-label-separation="{$glossterm.separation}"
+                     xsl:use-attribute-sets="normal.para.spacing">
+        <xsl:choose>
+          <xsl:when test="$glossary.sort != 0">
+            <xsl:apply-templates select="glossentry" mode="glossary.as.list">
+              <xsl:sort lang="{$language}"
+                        select="translate(glossterm, $lowercase, 
+                                          $uppercase)"/>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="glossentry" mode="glossary.as.list"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:list-block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- Glossary collection -->
+
+<xsl:template match="glossary[@role='auto']" priority="2">
+  <xsl:variable name="collection" select="document($glossary.collection, .)"/>
+  <xsl:if test="$glossary.collection = ''">
+    <xsl:message>
+      <xsl:text>Warning: processing automatic glossary </xsl:text>
+      <xsl:text>without a glossary.collection file.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:if test="not($collection) and $glossary.collection != ''">
+    <xsl:message>
+      <xsl:text>Warning: processing automatic glossary but unable to </xsl:text>
+      <xsl:text>open glossary.collection file '</xsl:text>
+      <xsl:value-of select="$glossary.collection"/>
+      <xsl:text>'</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:call-template name="make-auto-glossary"/>
+</xsl:template>
+
+<xsl:template name="make-auto-glossary">
+  <xsl:param name="collection" select="document($glossary.collection, .)"/>
+  <xsl:param name="terms" select="//glossterm[not(parent::glossdef)]|//firstterm"/>
+  <xsl:param name="preamble" select="*[not(self::title
+                                           or self::subtitle
+                                           or self::glossdiv
+                                           or self::glossentry)]"/>
+
+  &setup-language-variable;
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="presentation">
+    <xsl:call-template name="pi.dbfo_glossary-presentation"/>
+  </xsl:variable>
+
+  <xsl:variable name="term-width">
+    <xsl:call-template name="pi.dbfo_glossterm-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="width">
+    <xsl:choose>
+      <xsl:when test="$term-width = ''">
+        <xsl:value-of select="$glossterm.width"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$term-width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="$glossary.collection = ''">
+    <xsl:message>
+      <xsl:text>Warning: processing automatic glossary </xsl:text>
+      <xsl:text>without a glossary.collection file.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <fo:block id="{$id}">
+    <xsl:call-template name="glossary.titlepage"/>
+  </fo:block>
+
+  <xsl:if test="$preamble">
+    <xsl:apply-templates select="$preamble"/>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="glossdiv and $collection//glossdiv">
+      <xsl:for-each select="$collection//glossdiv">
+        <!-- first see if there are any in this div -->
+        <xsl:variable name="exist.test">
+          <xsl:for-each select="glossentry">
+            <xsl:variable name="cterm" select="glossterm"/>
+            <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+              <xsl:value-of select="glossterm"/>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:variable>
+
+        <xsl:if test="$exist.test != ''">
+          <xsl:choose>
+            <xsl:when test="$presentation = 'list'">
+              <xsl:apply-templates select="." mode="auto-glossary-as-list">
+                <xsl:with-param name="width" select="$width"/>
+                <xsl:with-param name="terms" select="$terms"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:when test="$presentation = 'blocks'">
+              <xsl:apply-templates select="." mode="auto-glossary-as-blocks">
+                <xsl:with-param name="terms" select="$terms"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:when test="$glossary.as.blocks != 0">
+              <xsl:apply-templates select="." mode="auto-glossary-as-blocks">
+                <xsl:with-param name="terms" select="$terms"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="." mode="auto-glossary-as-list">
+                <xsl:with-param name="width" select="$width"/>
+                <xsl:with-param name="terms" select="$terms"/>
+              </xsl:apply-templates>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:if>
+      </xsl:for-each>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$presentation = 'list'">
+          <fo:list-block provisional-distance-between-starts="{$width}"
+                         provisional-label-separation="{$glossterm.separation}"
+                         xsl:use-attribute-sets="normal.para.spacing">
+            <xsl:choose>
+              <xsl:when test="$glossary.sort != 0">
+                <xsl:for-each select="$collection//glossentry">
+                  <xsl:sort lang="{$language}"
+                            select="translate(glossterm, $lowercase, 
+                                              $uppercase)"/>
+                  <xsl:variable name="cterm" select="glossterm"/>
+                  <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+                    <xsl:apply-templates select="." 
+                                         mode="auto-glossary-as-list"/>
+                  </xsl:if>
+                </xsl:for-each>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:for-each select="$collection//glossentry">
+                  <xsl:variable name="cterm" select="glossterm"/>
+                  <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+                    <xsl:apply-templates select="." 
+                                         mode="auto-glossary-as-list"/>
+                  </xsl:if>
+                </xsl:for-each>
+              </xsl:otherwise>
+            </xsl:choose>
+          </fo:list-block>
+        </xsl:when>
+        <xsl:when test="$presentation = 'blocks' or
+                        $glossary.as.blocks != 0">
+          <xsl:choose>
+            <xsl:when test="$glossary.sort != 0">
+              <xsl:for-each select="$collection//glossentry">
+                <xsl:sort lang="{$language}"
+                          select="translate(glossterm, $lowercase, 
+                                            $uppercase)"/>
+                <xsl:variable name="cterm" select="glossterm"/>
+                <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+                  <xsl:apply-templates select="." 
+                                       mode="auto-glossary-as-blocks"/>
+                </xsl:if>
+              </xsl:for-each>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:for-each select="$collection//glossentry">
+                <xsl:variable name="cterm" select="glossterm"/>
+                <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+                  <xsl:apply-templates select="." 
+                                       mode="auto-glossary-as-blocks"/>
+                </xsl:if>
+              </xsl:for-each>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:list-block provisional-distance-between-starts="{$width}"
+                         provisional-label-separation="{$glossterm.separation}"
+                         xsl:use-attribute-sets="normal.para.spacing">
+            <xsl:choose>
+              <xsl:when test="$glossary.sort != 0">
+                <xsl:for-each select="$collection//glossentry">
+                  <xsl:sort lang="{$language}"
+                            select="translate(glossterm, $lowercase, 
+                                              $uppercase)"/>
+                  <xsl:variable name="cterm" select="glossterm"/>
+                  <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+                    <xsl:apply-templates select="." 
+                                         mode="auto-glossary-as-list"/>
+                  </xsl:if>
+                </xsl:for-each>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:for-each select="$collection//glossentry">
+                  <xsl:variable name="cterm" select="glossterm"/>
+                  <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+                    <xsl:apply-templates select="." 
+                                         mode="auto-glossary-as-list"/>
+                  </xsl:if>
+                </xsl:for-each>
+              </xsl:otherwise>
+            </xsl:choose>
+          </fo:list-block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="book/glossary[@role='auto']|
+                     part/glossary[@role='auto']|
+                     /glossary[@role='auto']" priority="2.5">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <xsl:if test="$glossary.collection = ''">
+    <xsl:message>
+      <xsl:text>Warning: processing automatic glossary </xsl:text>
+      <xsl:text>without a glossary.collection file.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <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="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="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>
+
+      <xsl:call-template name="make-auto-glossary"/>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="glossdiv" mode="auto-glossary-as-list">
+  <xsl:param name="width" select="$glossterm.width"/>
+  <xsl:param name="terms" select="."/>
+
+  &setup-language-variable;
+
+  <xsl:variable name="preamble"
+                select="*[not(self::title
+                            or self::subtitle
+                            or self::glossentry)]"/>
+
+  <xsl:call-template name="glossdiv.titlepage"/>
+
+  <xsl:apply-templates select="$preamble"/>
+
+  <fo:list-block provisional-distance-between-starts="{$width}"
+                 provisional-label-separation="{$glossterm.separation}"
+                 xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:choose>
+      <xsl:when test="$glossary.sort != 0">
+        <xsl:for-each select="glossentry">
+          <xsl:sort lang="{$language}"
+                    select="translate(glossterm, $lowercase, $uppercase)"/>
+          <xsl:variable name="cterm" select="glossterm"/>
+          <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+            <xsl:apply-templates select="." mode="auto-glossary-as-list"/>
+          </xsl:if>
+        </xsl:for-each>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:for-each select="glossentry">
+          <xsl:variable name="cterm" select="glossterm"/>
+          <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+            <xsl:apply-templates select="." mode="auto-glossary-as-list"/>
+          </xsl:if>
+        </xsl:for-each>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:list-block>
+</xsl:template>
+
+<xsl:template match="glossentry" mode="auto-glossary-as-list">
+  <xsl:apply-templates select="." mode="glossary.as.list"/>
+</xsl:template>
+
+<xsl:template match="glossdiv" mode="auto-glossary-as-blocks">
+  <xsl:param name="terms" select="."/>
+
+  &setup-language-variable;
+
+  <xsl:variable name="preamble"
+                select="*[not(self::title
+                            or self::subtitle
+                            or self::glossentry)]"/>
+
+  <xsl:call-template name="glossdiv.titlepage"/>
+
+  <xsl:apply-templates select="$preamble"/>
+
+  <xsl:choose>
+    <xsl:when test="$glossary.sort != 0">
+      <xsl:for-each select="glossentry">
+        <xsl:sort lang="{$language}"
+                  select="translate(glossterm, $lowercase, $uppercase)"/>
+        <xsl:variable name="cterm" select="glossterm"/>
+        <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+          <xsl:apply-templates select="." mode="auto-glossary-as-blocks"/>
+        </xsl:if>
+      </xsl:for-each>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:for-each select="glossentry">
+        <xsl:variable name="cterm" select="glossterm"/>
+        <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
+          <xsl:apply-templates select="." mode="auto-glossary-as-blocks"/>
+        </xsl:if>
+      </xsl:for-each>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="glossentry" mode="auto-glossary-as-blocks">
+  <xsl:apply-templates select="." mode="glossary.as.blocks"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- Format glossary as a list -->
+
+<xsl:template match="glossdiv" mode="glossary.as.list">
+  <xsl:param name="width" select="$glossterm.width"/>
+
+  &setup-language-variable;
+
+  <xsl:variable name="entries" select="glossentry"/>
+
+  <xsl:variable name="preamble"
+                select="*[not(self::title
+                            or self::subtitle
+                            or self::glossentry)]"/>
+
+  <xsl:call-template name="glossdiv.titlepage"/>
+
+  <xsl:apply-templates select="$preamble"/>
+
+  <fo:list-block provisional-distance-between-starts="{$width}"
+                 provisional-label-separation="{$glossterm.separation}"
+                 xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:choose>
+      <xsl:when test="$glossary.sort != 0">
+        <xsl:apply-templates select="$entries" mode="glossary.as.list">
+          <xsl:sort lang="{$language}"
+                    select="translate(glossterm, $lowercase, 
+                                      $uppercase)"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:list-block>
+</xsl:template>
+
+<!--
+GlossEntry ::=
+  GlossTerm, Acronym?, Abbrev?,
+  (IndexTerm)*,
+  RevHistory?,
+  (GlossSee | GlossDef+)
+-->
+
+<xsl:template match="glossentry" mode="glossary.as.list">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:list-item xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="anchor">
+      <xsl:with-param name="conditional">
+        <xsl:choose>
+          <xsl:when test="$glossterm.auto.link != 0
+                          or $glossary.collection != ''">0</xsl:when>
+          <xsl:otherwise>1</xsl:otherwise>
+        </xsl:choose>
+      </xsl:with-param>
+    </xsl:call-template>
+
+    <fo:list-item-label end-indent="label-end()">
+      <fo:block>
+        <xsl:choose>
+          <xsl:when test="$glossentry.show.acronym = 'primary'">
+            <xsl:choose>
+              <xsl:when test="acronym|abbrev">
+                <xsl:apply-templates select="acronym|abbrev" 
+                                     mode="glossary.as.list"/>
+                <xsl:text> (</xsl:text>
+                <xsl:apply-templates select="glossterm" 
+                                     mode="glossary.as.list"/>
+                <xsl:text>)</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates select="glossterm" 
+                                     mode="glossary.as.list"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+
+          <xsl:when test="$glossentry.show.acronym = 'yes'">
+            <xsl:apply-templates select="glossterm" mode="glossary.as.list"/>
+
+            <xsl:if test="acronym|abbrev">
+              <xsl:text> (</xsl:text>
+              <xsl:apply-templates select="acronym|abbrev" 
+                                   mode="glossary.as.list"/>
+              <xsl:text>)</xsl:text>
+            </xsl:if>
+          </xsl:when>
+
+          <xsl:otherwise>
+            <xsl:apply-templates select="glossterm" mode="glossary.as.list"/>
+          </xsl:otherwise>
+        </xsl:choose>
+        <xsl:apply-templates select="indexterm"/>
+      </fo:block>
+    </fo:list-item-label>
+
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.list"/>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<xsl:template match="glossentry/glossterm" mode="glossary.as.list">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <fo:inline id="{$id}">
+    <xsl:apply-templates/>
+  </fo:inline>
+  <xsl:if test="following-sibling::glossterm">, </xsl:if>
+</xsl:template>
+
+<xsl:template match="glossentry/acronym" mode="glossary.as.list">
+  <xsl:apply-templates/>
+  <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
+</xsl:template>
+
+<xsl:template match="glossentry/abbrev" mode="glossary.as.list">
+  <xsl:apply-templates/>
+  <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
+</xsl:template>
+
+<xsl:template match="glossentry/revhistory" mode="glossary.as.list">
+</xsl:template>
+
+<xsl:template match="glossentry/glosssee" mode="glossary.as.list">
+  <xsl:variable name="otherterm" select="@otherterm"/>
+  <xsl:variable name="targets" select="key('id', $otherterm)"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+
+  <fo:block>
+    <xsl:variable name="template">
+      <xsl:call-template name="gentext.template">
+        <xsl:with-param name="context" select="'glossary'"/>
+        <xsl:with-param name="name" select="'see'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:variable name="title">
+      <xsl:choose>
+        <xsl:when test="$target">
+          <fo:basic-link internal-destination="{$otherterm}"
+                         xsl:use-attribute-sets="xref.properties">
+            <xsl:apply-templates select="$target" mode="xref-to"/>
+          </fo:basic-link>
+        </xsl:when>
+        <xsl:when test="$otherterm != '' and not($target)">
+          <xsl:message>
+            <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
+            <xsl:value-of select="$otherterm"/>
+          </xsl:message>
+          <xsl:apply-templates mode="glossary.as.list"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates mode="glossary.as.list"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:call-template name="substitute-markup">
+      <xsl:with-param name="template" select="$template"/>
+      <xsl:with-param name="title" select="$title"/>
+    </xsl:call-template>
+
+    <xsl:text>.</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="glossentry/glossdef" mode="glossary.as.list">
+  <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
+  <xsl:if test="glossseealso">
+    <fo:block>
+      <xsl:variable name="template">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'glossary'"/>
+          <xsl:with-param name="name" select="'seealso'"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="title">
+        <xsl:apply-templates select="glossseealso" mode="glossary.as.list"/>
+      </xsl:variable>
+      <xsl:call-template name="substitute-markup">
+        <xsl:with-param name="template" select="$template"/>
+        <xsl:with-param name="title" select="$title"/>
+      </xsl:call-template>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="glossentry/glossdef/para[1]|glossentry/glossdef/simpara[1]"
+              mode="glossary.as.list">
+  <fo:block>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="glossseealso" mode="glossary.as.list">
+  <xsl:variable name="otherterm" select="@otherterm"/>
+  <xsl:variable name="targets" select="key('id', $otherterm)"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="$target">
+      <fo:basic-link internal-destination="{$otherterm}"
+                     xsl:use-attribute-sets="xref.properties">
+        <xsl:apply-templates select="$target" mode="xref-to"/>
+      </fo:basic-link>
+    </xsl:when>
+    <xsl:when test="$otherterm != '' and not($target)">
+      <xsl:message>
+        <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
+        <xsl:value-of select="$otherterm"/>
+      </xsl:message>
+      <xsl:apply-templates mode="glossary.as.list"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="glossary.as.list"/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:choose>
+    <xsl:when test="position() = last()">
+      <xsl:text>.</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>, </xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- Format glossary blocks -->
+
+<xsl:template match="glossdiv" mode="glossary.as.blocks">
+  &setup-language-variable;
+  <xsl:variable name="entries" select="glossentry"/>
+  <xsl:variable name="preamble"
+                select="*[not(self::title
+                            or self::subtitle
+                            or self::glossentry)]"/>
+
+  <xsl:call-template name="glossdiv.titlepage"/>
+
+  <xsl:apply-templates select="$preamble"/>
+
+  <xsl:choose>
+    <xsl:when test="$glossary.sort != 0">
+      <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
+        <xsl:sort lang="{$language}"
+                  select="translate(glossterm, $lowercase, 
+                                    $uppercase)"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!--
+GlossEntry ::=
+  GlossTerm, Acronym?, Abbrev?,
+  (IndexTerm)*,
+  RevHistory?,
+  (GlossSee | GlossDef+)
+-->
+
+<xsl:template match="glossentry" mode="glossary.as.blocks">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block xsl:use-attribute-sets="list.item.spacing"
+           keep-with-next.within-column="always" 
+           keep-together.within-column="always">
+    <xsl:call-template name="anchor">
+      <xsl:with-param name="conditional">
+        <xsl:choose>
+          <xsl:when test="$glossterm.auto.link != 0
+                          or $glossary.collection != ''">0</xsl:when>
+          <xsl:otherwise>1</xsl:otherwise>
+        </xsl:choose>
+      </xsl:with-param>
+    </xsl:call-template>
+
+    <xsl:choose>
+      <xsl:when test="$glossentry.show.acronym = 'primary'">
+        <xsl:choose>
+          <xsl:when test="acronym|abbrev">
+            <xsl:apply-templates select="acronym|abbrev" mode="glossary.as.blocks"/>
+            <xsl:text> (</xsl:text>
+            <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
+            <xsl:text>)</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+
+      <xsl:when test="$glossentry.show.acronym = 'yes'">
+        <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
+
+        <xsl:if test="acronym|abbrev">
+          <xsl:text> (</xsl:text>
+          <xsl:apply-templates select="acronym|abbrev" mode="glossary.as.blocks"/>
+          <xsl:text>)</xsl:text>
+        </xsl:if>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:apply-templates select="indexterm"/>
+  </fo:block>
+
+  <fo:block margin-left="0.25in">
+    <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.blocks"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="glossentry/glossterm" mode="glossary.as.blocks">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <fo:inline id="{$id}">
+    <xsl:apply-templates/>
+  </fo:inline>
+  <xsl:if test="following-sibling::glossterm">, </xsl:if>
+</xsl:template>
+
+<xsl:template match="glossentry/acronym" mode="glossary.as.blocks">
+  <xsl:apply-templates/>
+  <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
+</xsl:template>
+
+<xsl:template match="glossentry/abbrev" mode="glossary.as.blocks">
+  <xsl:apply-templates/>
+  <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
+</xsl:template>
+
+<xsl:template match="glossentry/glosssee" mode="glossary.as.blocks">
+  <xsl:variable name="otherterm" select="@otherterm"/>
+  <xsl:variable name="targets" select="key('id', $otherterm)"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+
+  <xsl:variable name="template">
+    <xsl:call-template name="gentext.template">
+      <xsl:with-param name="context" select="'glossary'"/>
+      <xsl:with-param name="name" select="'see'"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="title">
+    <xsl:choose>
+      <xsl:when test="$target">
+        <fo:basic-link internal-destination="{$otherterm}"
+                       xsl:use-attribute-sets="xref.properties">
+          <xsl:apply-templates select="$target" mode="xref-to"/>
+        </fo:basic-link>
+      </xsl:when>
+      <xsl:when test="$otherterm != '' and not($target)">
+        <xsl:message>
+          <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
+          <xsl:value-of select="$otherterm"/>
+        </xsl:message>
+        <xsl:apply-templates mode="glossary.as.blocks"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="glossary.as.blocks"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:call-template name="substitute-markup">
+    <xsl:with-param name="template" select="$template"/>
+    <xsl:with-param name="title" select="$title"/>
+  </xsl:call-template>
+
+  <xsl:text>.</xsl:text>
+</xsl:template>
+
+<xsl:template match="glossentry/glossdef" mode="glossary.as.blocks">
+  <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"
+                       mode="glossary.as.blocks"/>
+  <xsl:if test="glossseealso">
+    <fo:block>
+      <xsl:variable name="template">
+        <xsl:call-template name="gentext.template">
+          <xsl:with-param name="context" select="'glossary'"/>
+          <xsl:with-param name="name" select="'seealso'"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:variable name="title">
+        <xsl:apply-templates select="glossseealso" mode="glossary.as.blocks"/>
+      </xsl:variable>
+      <xsl:call-template name="substitute-markup">
+        <xsl:with-param name="template" select="$template"/>
+        <xsl:with-param name="title" select="$title"/>
+      </xsl:call-template>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="glossentry/glossdef/para[1]|glossentry/glossdef/simpara[1]"
+              mode="glossary.as.blocks">
+  <fo:block>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- Handle any other glossdef content normally -->
+<xsl:template match="*" mode="glossary.as.blocks">
+  <xsl:apply-templates select="." />
+</xsl:template>
+
+<xsl:template match="glossseealso" mode="glossary.as.blocks">
+  <xsl:variable name="otherterm" select="@otherterm"/>
+  <xsl:variable name="targets" select="key('id', $otherterm)"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="$target">
+      <fo:basic-link internal-destination="{$otherterm}"
+                     xsl:use-attribute-sets="xref.properties">
+        <xsl:apply-templates select="$target" mode="xref-to"/>
+      </fo:basic-link>
+    </xsl:when>
+    <xsl:when test="$otherterm != '' and not($target)">
+      <xsl:message>
+        <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
+        <xsl:value-of select="$otherterm"/>
+      </xsl:message>
+      <xsl:apply-templates mode="glossary.as.blocks"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="glossary.as.blocks"/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:choose>
+    <xsl:when test="position() = last()">
+      <xsl:text>.</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>, </xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 629 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/graphics.xsl

@@ -0,0 +1,629 @@
+<?xml version='1.0'?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
+<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
+ ]>
+<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"
+                xmlns:stext="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.TextFactory"
+                xmlns:xtext="com.nwalsh.xalan.Text"
+                xmlns:lxslt="http://xml.apache.org/xslt"
+                exclude-result-prefixes="xlink stext xtext lxslt"
+                extension-element-prefixes="stext xtext"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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.
+
+     Contributors:
+     Colin Paul Adams, <colin@colina.demon.co.uk>
+     Paul Grosso, <pgrosso@arbortext.com>
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+<!-- Graphic format tests for the FO backend -->
+
+<xsl:param name="graphic.notations">
+  <!-- n.b. exactly one leading space, one trailing space, and one inter-word space -->
+  <xsl:choose>
+    <xsl:when test="$passivetex.extensions != 0">
+      <xsl:text> PNG PDF JPG JPEG linespecific </xsl:text>
+    </xsl:when>
+    <xsl:when test="$fop1.extensions != 0">
+      <xsl:text> BMP GIF TIFF SVG PNG EPS JPG JPEG linespecific </xsl:text>
+    </xsl:when>
+    <xsl:when test="$fop.extensions != 0">
+      <xsl:text> BMP GIF TIFF SVG PNG EPS JPG JPEG linespecific </xsl:text>
+    </xsl:when>
+    <xsl:when test="$arbortext.extensions != 0">
+      <xsl:text> PNG PDF JPG JPEG linespecific GIF GIF87a GIF89a TIFF BMP </xsl:text>
+    </xsl:when>
+    <xsl:when test="$xep.extensions != 0">
+      <xsl:text> SVG PNG PDF JPG JPEG linespecific GIF GIF87a GIF89a TIFF BMP </xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text> PNG PDF JPG JPEG linespecific GIF GIF87a GIF89a TIFF BMP </xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+<xsl:template name="is.graphic.format">
+  <xsl:param name="format"/>
+  <xsl:if test="contains($graphic.notations, concat(' ',$format,' '))">1</xsl:if>
+</xsl:template>
+
+<xsl:param name="graphic.extensions">
+  <!-- n.b. exactly one leading space, one trailing space, and one inter-word space -->
+  <xsl:choose>
+    <xsl:when test="$passivetex.extensions != 0">
+      <xsl:text> png pdf jpg jpeg </xsl:text>
+    </xsl:when>
+    <xsl:when test="$fop1.extensions != 0">
+      <xsl:text> bmp gif tif tiff svg png pdf jpg jpeg eps </xsl:text>
+    </xsl:when>
+    <xsl:when test="$fop.extensions != 0">
+      <xsl:text> bmp gif tif tiff svg png pdf jpg jpeg eps </xsl:text>
+    </xsl:when>
+    <xsl:when test="$arbortext.extensions != 0">
+      <xsl:text> png pdf jpg jpeg gif tif tiff bmp </xsl:text>
+    </xsl:when>
+    <xsl:when test="$xep.extensions != 0">
+      <xsl:text> svg png pdf jpg jpeg gif tif tiff bmp eps </xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text> svg png pdf jpg jpeg gif tif tiff bmp eps </xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+<xsl:template name="is.graphic.extension">
+  <xsl:param name="ext"/>
+  <xsl:variable name="lcext" select="translate($ext,
+                                       'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+                                       'abcdefghijklmnopqrstuvwxyz')"/>
+
+  <xsl:if test="contains($graphic.extensions,
+                         concat(' ', $lcext, ' '))">1</xsl:if>
+</xsl:template>
+
+<xsl:template name="graphic.format.content-type">
+  <xsl:param name="format"/>
+  <xsl:variable name="is.graphic.format">
+    <xsl:call-template name="is.graphic.format">
+      <xsl:with-param name="format" select="$format"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:if test="$is.graphic.format">
+    <xsl:choose>
+      <xsl:when test="$format = ''"></xsl:when>
+      <xsl:when test="$format = 'linespecific'"></xsl:when>
+      <xsl:when test="$format = 'PS'">application/postscript</xsl:when>
+      <xsl:when test="$format = 'PDF'">application/pdf</xsl:when>
+      <xsl:when test="$format = 'PNG'">image/png</xsl:when>
+      <xsl:when test="$format = 'SVG'">image/svg+xml</xsl:when>
+      <xsl:when test="$format = 'JPG'">image/jpeg</xsl:when>
+      <xsl:when test="$format = 'GIF87a'">image/gif</xsl:when>
+      <xsl:when test="$format = 'GIF89a'">image/gif</xsl:when>
+      <xsl:otherwise>
+          <xsl:value-of select="concat('image/', 
+            translate($format, &uppercase;, &lowercase;))"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:if>
+</xsl:template>
+
+
+<!-- ==================================================================== -->
+
+<xsl:template match="screenshot">
+  <fo:block>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="screeninfo">
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- Override these templates for FO -->
+<!-- ==================================================================== -->
+
+<xsl:template name="process.image">
+  <!-- When this template is called, the current node should be  -->
+  <!-- a graphic, inlinegraphic, imagedata, or videodata. All    -->
+  <!-- those elements have the same set of attributes, so we can -->
+  <!-- handle them all in one place.                             -->
+
+  <xsl:variable name="scalefit">
+    <xsl:choose>
+      <xsl:when test="$ignore.image.scaling != 0">0</xsl:when>
+      <xsl:when test="@contentwidth">0</xsl:when>
+      <xsl:when test="@contentdepth and 
+                      @contentdepth != '100%'">0</xsl:when>
+      <xsl:when test="@scale">0</xsl:when>
+      <xsl:when test="@scalefit"><xsl:value-of select="@scalefit"/></xsl:when>
+      <xsl:when test="@width or @depth">1</xsl:when>
+      <xsl:otherwise>0</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="scale">
+    <xsl:choose>
+      <xsl:when test="$ignore.image.scaling != 0">0</xsl:when>
+      <xsl:when test="@contentwidth or @contentdepth">1.0</xsl:when>
+      <xsl:when test="@scale">
+        <xsl:value-of select="@scale div 100.0"/>
+      </xsl:when>
+      <xsl:otherwise>1.0</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="filename">
+    <xsl:choose>
+      <xsl:when test="local-name(.) = 'graphic'
+                      or local-name(.) = 'inlinegraphic'">
+        <!-- handle legacy graphic and inlinegraphic by new template --> 
+        <xsl:call-template name="mediaobject.filename">
+          <xsl:with-param name="object" select="."/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- imagedata, videodata, audiodata -->
+        <xsl:call-template name="mediaobject.filename">
+          <xsl:with-param name="object" select=".."/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="content-type">
+    <xsl:if test="@format">
+      <xsl:call-template name="graphic.format.content-type">
+        <xsl:with-param name="format" select="@format"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="bgcolor">
+    <xsl:call-template name="pi.dbfo_background-color">
+      <xsl:with-param name="node" select=".."/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <fo:external-graphic>
+    <xsl:attribute name="src">
+      <xsl:call-template name="fo-external-image">
+        <xsl:with-param name="filename">
+          <xsl:if test="$img.src.path != '' and
+                        not(starts-with($filename, '/')) and
+                        not(contains($filename, '://'))">
+            <xsl:value-of select="$img.src.path"/>
+          </xsl:if>
+          <xsl:value-of select="$filename"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:attribute>
+
+    <xsl:attribute name="width">
+      <xsl:choose>
+        <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when>
+        <xsl:when test="contains(@width,'%')">
+          <xsl:value-of select="@width"/>
+        </xsl:when>
+        <xsl:when test="@width and not(@width = '')">
+          <xsl:call-template name="length-spec">
+            <xsl:with-param name="length" select="@width"/>
+            <xsl:with-param name="default.units" select="'px'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="not(@depth) and $default.image.width != ''">
+          <xsl:call-template name="length-spec">
+            <xsl:with-param name="length" select="$default.image.width"/>
+            <xsl:with-param name="default.units" select="'px'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>auto</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+
+    <xsl:attribute name="height">
+      <xsl:choose>
+        <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when>
+        <xsl:when test="contains(@depth,'%')">
+          <xsl:value-of select="@depth"/>
+        </xsl:when>
+        <xsl:when test="@depth">
+          <xsl:call-template name="length-spec">
+            <xsl:with-param name="length" select="@depth"/>
+            <xsl:with-param name="default.units" select="'px'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>auto</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+
+    <xsl:attribute name="content-width">
+      <xsl:choose>
+        <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when>
+        <xsl:when test="contains(@contentwidth,'%')">
+          <xsl:value-of select="@contentwidth"/>
+        </xsl:when>
+        <xsl:when test="@contentwidth">
+          <xsl:call-template name="length-spec">
+            <xsl:with-param name="length" select="@contentwidth"/>
+            <xsl:with-param name="default.units" select="'px'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="number($scale) != 1.0">
+          <xsl:value-of select="$scale * 100"/>
+          <xsl:text>%</xsl:text>
+        </xsl:when>
+        <xsl:when test="$scalefit = 1">scale-to-fit</xsl:when>
+        <xsl:otherwise>auto</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+
+    <xsl:attribute name="content-height">
+      <xsl:choose>
+        <xsl:when test="$ignore.image.scaling != 0">auto</xsl:when>
+        <xsl:when test="contains(@contentdepth,'%')">
+          <xsl:value-of select="@contentdepth"/>
+        </xsl:when>
+        <xsl:when test="@contentdepth">
+          <xsl:call-template name="length-spec">
+            <xsl:with-param name="length" select="@contentdepth"/>
+            <xsl:with-param name="default.units" select="'px'"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="number($scale) != 1.0">
+          <xsl:value-of select="$scale * 100"/>
+          <xsl:text>%</xsl:text>
+        </xsl:when>
+        <xsl:when test="$scalefit = 1">scale-to-fit</xsl:when>
+        <xsl:otherwise>auto</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+
+    <xsl:if test="$content-type != ''">
+      <xsl:attribute name="content-type">
+        <xsl:value-of select="concat('content-type:',$content-type)"/>
+      </xsl:attribute>
+    </xsl:if>
+
+    <xsl:if test="$bgcolor != ''">
+      <xsl:attribute name="background-color">
+        <xsl:value-of select="$bgcolor"/>
+      </xsl:attribute>
+    </xsl:if>
+
+    <xsl:if test="@align">
+      <xsl:attribute name="text-align">
+        <xsl:value-of select="@align"/>
+      </xsl:attribute>
+    </xsl:if>
+
+    <xsl:if test="@valign">
+      <xsl:attribute name="display-align">
+        <xsl:choose>
+          <xsl:when test="@valign = 'top'">before</xsl:when>
+          <xsl:when test="@valign = 'middle'">center</xsl:when>
+          <xsl:when test="@valign = 'bottom'">after</xsl:when>
+          <xsl:otherwise>auto</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+    </xsl:if>
+  </fo:external-graphic>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="graphic">
+  <xsl:choose>
+    <xsl:when test="parent::inlineequation">
+      <xsl:call-template name="process.image"/>
+    </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="process.image"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="inlinegraphic">
+  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
+  <xsl:variable name="filename">
+    <xsl:choose>
+      <xsl:when test="@entityref">
+        <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="@fileref"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@format='linespecific'">
+      <xsl:choose>
+        <xsl:when test="$use.extensions != '0'
+                        and $textinsert.extension != '0'">
+          <xsl:choose>
+            <xsl:when test="contains($vendor, 'SAXON')">
+              <stext:insertfile href="{$filename}" encoding="{$textdata.default.encoding}"/>
+            </xsl:when>
+            <xsl:when test="contains($vendor, 'Apache Software Foundation')">
+              <xtext:insertfile href="{$filename}"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:message terminate="yes">
+                <xsl:text>Don't know how to insert files with </xsl:text>
+                <xsl:value-of select="$vendor"/>
+              </xsl:message>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
+             href="{$filename}"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="process.image"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="mediaobject|mediaobjectco">
+
+  <xsl:variable name="olist" select="imageobject|imageobjectco
+                     |videoobject|audioobject
+                     |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:variable name="align">
+    <xsl:value-of select="$object/descendant::imagedata[@align][1]/@align"/>
+  </xsl:variable>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:if test="$align != '' ">
+      <xsl:attribute name="text-align">
+        <xsl:value-of select="$align"/>
+      </xsl:attribute>
+    </xsl:if>
+
+    <xsl:apply-templates select="$object"/>
+    <xsl:apply-templates select="caption"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="inlinemediaobject">
+  <xsl:call-template name="select.mediaobject"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="imageobjectco">
+  <xsl:apply-templates select="imageobject"/>
+  <xsl:apply-templates select="calloutlist"/>
+</xsl:template>
+
+<xsl:template match="imageobject">
+  <xsl:choose>
+    <xsl:when test="imagedata">
+      <xsl:apply-templates select="imagedata"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:instream-foreign-object>
+        <xsl:apply-templates mode="copy-all"/>
+      </fo:instream-foreign-object>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="copy-all">
+  <xsl:copy>
+    <xsl:for-each select="@*">
+      <xsl:copy/>
+    </xsl:for-each>
+    <xsl:apply-templates mode="copy-all"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="text()|comment()|processing-instruction()" mode="copy-all">
+  <xsl:copy/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="imagedata">
+  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
+  <xsl:variable name="filename">
+    <xsl:call-template name="mediaobject.filename">
+      <xsl:with-param name="object" select=".."/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@format='linespecific'">
+      <xsl:choose>
+        <xsl:when test="$use.extensions != '0'
+                        and $textinsert.extension != '0'">
+          <xsl:choose>
+            <xsl:when test="contains($vendor, 'SAXON')">
+              <stext:insertfile href="{$filename}" encoding="{$textdata.default.encoding}"/>
+            </xsl:when>
+            <xsl:when test="contains($vendor, 'Apache Software Foundation')">
+              <xtext:insertfile href="{$filename}"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:message terminate="yes">
+                <xsl:text>Don't know how to insert files with </xsl:text>
+                <xsl:value-of select="$vendor"/>
+              </xsl:message>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
+             href="{$filename}"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="process.image"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="videoobject">
+  <xsl:apply-templates select="videodata"/>
+</xsl:template>
+
+<xsl:template match="videodata">
+  <xsl:call-template name="process.image"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="audioobject">
+  <xsl:apply-templates select="audiodata"/>
+</xsl:template>
+
+<xsl:template match="audiodata">
+  <xsl:call-template name="process.image"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="textobject">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="textdata">
+  <xsl:variable name="filename">
+    <xsl:choose>
+      <xsl:when test="@entityref">
+        <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates select="@fileref"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="encoding">
+    <xsl:choose>
+      <xsl:when test="@encoding">
+        <xsl:value-of select="@encoding"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$textdata.default.encoding"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$use.extensions != '0'
+                    and $textinsert.extension != '0'">
+      <xsl:choose>
+        <xsl:when test="element-available('stext:insertfile')">
+          <stext:insertfile href="{$filename}" encoding="{$encoding}"/>
+        </xsl:when>
+        <xsl:when test="element-available('xtext:insertfile')">
+          <xtext:insertfile href="{$filename}"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message terminate="yes">
+            <xsl:text>No insertfile extension available.</xsl:text>
+          </xsl:message>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
+         href="{$filename}"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="caption">
+  <fo:block>
+    <xsl:if test="@align = 'right' or @align = 'left' or @align='center'">
+      <xsl:attribute name="text-align"><xsl:value-of
+                         select="@align"/></xsl:attribute>
+    </xsl:if>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="fo-external-image">
+  <xsl:param name="filename"/>
+
+  <xsl:choose>
+    <xsl:when test="$passivetex.extensions != 0
+                    or $fop.extensions != 0">
+      <xsl:value-of select="$filename"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="concat('url(', $filename, ')')"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- Resolve xml:base attributes -->
+<xsl:template match="@fileref">
+  <!-- need a check for absolute urls -->
+  <xsl:choose>
+    <xsl:when test="contains(., ':') or starts-with(.,'/')">
+      <!-- it has a uri scheme or starts with '/', so it is an absolute uri -->
+      <xsl:value-of select="."/>
+    </xsl:when>
+    <xsl:when test="$keep.relative.image.uris != 0">
+      <!-- leave it alone -->
+      <xsl:value-of select="."/>
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- its a relative uri -->
+      <xsl:call-template name="relative-uri">
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 57 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/highlight.xsl

@@ -0,0 +1,57 @@
+<?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:xslthl="http://xslthl.sf.net"
+                exclude-result-prefixes="xslthl"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     and other information.
+
+     ******************************************************************** -->
+
+<xsl:template match='xslthl:keyword'>
+  <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<xsl:template match='xslthl:string'>
+  <fo:inline font-weight="bold" font-style="italic"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<xsl:template match='xslthl:comment'>
+  <fo:inline font-style="italic"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<xsl:template match='xslthl:tag'>
+  <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<xsl:template match='xslthl:attribute'>
+  <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<xsl:template match='xslthl:value'>
+  <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
+</xsl:template>
+
+<!--
+<xsl:template match='xslthl:html'>
+  <span style='background:#AFF'><font color='blue'><xsl:apply-templates/></font></span>
+</xsl:template>
+
+<xsl:template match='xslthl:xslt'>
+  <span style='background:#AAA'><font color='blue'><xsl:apply-templates/></font></span>
+</xsl:template>
+
+<xsl:template match='xslthl:section'>
+  <span style='background:yellow'><xsl:apply-templates/></span>
+</xsl:template>
+-->
+
+</xsl:stylesheet>
+

+ 217 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/htmltbl.xsl

@@ -0,0 +1,217 @@
+<?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$
+     ********************************************************************
+
+     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:attribute-set name="th.style">
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+</xsl:attribute-set>
+
+<!-- Outputs an fo:table only, not the caption -->
+<xsl:template match="table|informaltable" mode="htmlTable">
+
+  <xsl:variable name="numcols">
+    <xsl:call-template name="widest-html-row">
+      <xsl:with-param name="rows" select=".//tr"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="prop-columns"
+                select=".//col[contains(@width, '%')] |
+                        .//colgroup[contains(@width, '%')]"/>
+
+  <xsl:variable name="table.width">
+    <xsl:call-template name="table.width"/>
+  </xsl:variable>
+
+  <fo:table xsl:use-attribute-sets="table.table.properties">
+    <xsl:choose>
+      <xsl:when test="$fop.extensions != 0 or
+                      $passivetex.extensions != 0">
+        <xsl:attribute name="table-layout">fixed</xsl:attribute>
+      </xsl:when>
+    </xsl:choose>
+    <xsl:attribute name="width">
+      <xsl:choose>
+        <xsl:when test="@width">
+          <xsl:value-of select="@width"/>
+        </xsl:when>
+        <xsl:when test="$table.width">
+          <xsl:value-of select="$table.width"/>
+        </xsl:when>
+        <xsl:otherwise>100%</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+    <xsl:call-template name="make-html-table-columns">
+      <xsl:with-param name="count" select="$numcols"/>
+    </xsl:call-template>
+    <xsl:apply-templates select="thead" mode="htmlTable"/>
+    <xsl:apply-templates select="tfoot" mode="htmlTable"/>
+    <xsl:choose>
+      <xsl:when test="tbody">
+        <xsl:apply-templates select="tbody" mode="htmlTable"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <fo:table-body start-indent="0pt" end-indent="0pt">
+          <xsl:apply-templates select="tr" mode="htmlTable"/>
+        </fo:table-body>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:table>
+
+</xsl:template>
+
+<xsl:template match="caption" mode="htmlTable">
+  <!-- Handled by formal.object.heading -->
+</xsl:template>
+
+<xsl:template name="widest-html-row">
+  <xsl:param name="rows" select="''"/>
+  <xsl:param name="count" select="0"/>
+  <xsl:choose>
+    <xsl:when test="count($rows) = 0">
+      <xsl:value-of select="$count"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$count &gt; count($rows[1]/*)">
+          <xsl:call-template name="widest-html-row">
+            <xsl:with-param name="rows" select="$rows[position() &gt; 1]"/>
+            <xsl:with-param name="count" select="$count"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="widest-html-row">
+            <xsl:with-param name="rows" select="$rows[position() &gt; 1]"/>
+            <xsl:with-param name="count" select="count($rows[1]/*)"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="make-html-table-columns">
+  <xsl:param name="count" select="0"/>
+  <xsl:param name="number" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="col|colgroup/col">
+      <xsl:for-each select="col|colgroup/col">
+        <fo:table-column>
+          <xsl:attribute name="column-number">
+            <xsl:number from="table|informaltable" level="any" format="1"/>
+          </xsl:attribute>
+          <xsl:if test="@width">
+            <xsl:attribute name="column-width">
+              <xsl:choose>
+                <xsl:when test="$fop.extensions != 0 and 
+                                contains(@width, '%')">
+                  <xsl:value-of select="concat('proportional-column-width(',
+                                               substring-before(@width, '%'),
+                                               ')')"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="@width"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </xsl:if>
+        </fo:table-column>
+      </xsl:for-each>
+    </xsl:when>
+    <xsl:when test="$fop.extensions != 0">
+      <xsl:if test="$number &lt;= $count">
+        <fo:table-column column-number="{$number}"
+                         column-width="{6.5 div $count}in"/>
+        <xsl:call-template name="make-html-table-columns">
+          <xsl:with-param name="count" select="$count"/>
+          <xsl:with-param name="number" select="$number + 1"/>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="tbody" mode="htmlTable">
+  <fo:table-body border-bottom-width="0.25pt"
+                 border-bottom-style="solid"
+                 border-bottom-color="black"
+                 start-indent="0pt"
+                 end-indent="0pt">
+    <xsl:apply-templates mode="htmlTable"/>
+  </fo:table-body>
+</xsl:template>
+
+<xsl:template match="td" mode="htmlTable">
+  <xsl:variable name="bgcolor">
+    <xsl:call-template name="pi.dbfo_bgcolor"/>
+  </xsl:variable>
+  <fo:table-cell xsl:use-attribute-sets="table.cell.padding">
+    <xsl:call-template name="table.cell.properties">
+      <xsl:with-param name="bgcolor.pi" select="$bgcolor"/>
+      <xsl:with-param name="rowsep.inherit" select="0"/>
+      <xsl:with-param name="colsep.inherit" select="0"/>
+    </xsl:call-template>
+    <fo:block>
+      <xsl:call-template name="table.cell.block.properties"/>
+      <xsl:apply-templates/>
+    </fo:block>
+  </fo:table-cell>
+</xsl:template>
+
+<xsl:template match="tfoot" mode="htmlTable">
+  <fo:table-footer start-indent="0pt"
+                   end-indent="0pt">
+    <xsl:apply-templates mode="htmlTable"/>
+  </fo:table-footer>
+</xsl:template>
+
+<xsl:template match="th" mode="htmlTable">
+  <xsl:variable name="bgcolor">
+    <xsl:call-template name="pi.dbfo_bgcolor"/>
+  </xsl:variable>
+  <fo:table-cell xsl:use-attribute-sets="th.style table.cell.padding">
+    <xsl:call-template name="table.cell.properties">
+      <xsl:with-param name="bgcolor.pi" select="$bgcolor"/>
+      <xsl:with-param name="rowsep.inherit" select="0"/>
+      <xsl:with-param name="colsep.inherit" select="0"/>
+    </xsl:call-template>
+    <fo:block>
+      <xsl:call-template name="table.cell.block.properties"/>
+      <xsl:apply-templates/>
+    </fo:block>
+  </fo:table-cell>
+</xsl:template>
+
+<xsl:template match="thead" mode="htmlTable">
+  <fo:table-header border-bottom-width="0.25pt"
+                   border-bottom-style="solid"
+                   border-bottom-color="black"
+                   start-indent="0pt"
+                   end-indent="0pt"
+                   font-weight="bold">
+    <xsl:apply-templates mode="htmlTable"/>
+  </fo:table-header>
+</xsl:template>
+
+<xsl:template match="tr" mode="htmlTable">
+  <fo:table-row>
+    <xsl:call-template name="table.row.properties"/>
+    <xsl:apply-templates mode="htmlTable"/>
+  </fo:table-row>
+</xsl:template>
+
+</xsl:stylesheet>

+ 479 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/index.xsl

@@ -0,0 +1,479 @@
+<?xml version='1.0'?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY primary   'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
+<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))'>
+<!ENTITY tertiary  'normalize-space(concat(tertiary/@sortas, tertiary[not(@sortas)]))'>
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                xmlns:rx="http://www.renderx.com/XSL/Extensions"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="index">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+ <xsl:if test="$generate.index != 0">
+  <xsl:choose>
+    <xsl:when test="$make.index.markup != 0">
+      <fo:block>
+        <xsl:call-template name="generate-index-markup">
+          <xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
+        </xsl:call-template>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}">
+        <xsl:call-template name="index.titlepage"/>
+      </fo:block>
+      <xsl:apply-templates/>
+      <xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
+        <xsl:call-template name="generate-index">
+          <xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="book/index|part/index">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+ <xsl:if test="$generate.index != 0">
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster">
+      <xsl:with-param name="pageclass">
+        <xsl:if test="$make.index.markup != 0">body</xsl:if>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}">
+        <xsl:call-template name="index.titlepage"/>
+      </fo:block>
+      <xsl:apply-templates/>
+      <xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
+
+        <xsl:choose>
+          <xsl:when test="$make.index.markup != 0">
+            <fo:block wrap-option='no-wrap'
+                      white-space-collapse='false'
+                      xsl:use-attribute-sets="monospace.verbatim.properties"
+                      linefeed-treatment="preserve">
+              <xsl:call-template name="generate-index-markup">
+                <xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
+              </xsl:call-template>
+            </fo:block>
+          </xsl:when>
+          <xsl:when test="indexentry|indexdiv/indexentry">
+            <xsl:apply-templates/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="generate-index">
+              <xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:if>
+    </fo:flow>
+  </fo:page-sequence>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="setindex">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+ <xsl:if test="$generate.index != 0">
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster">
+      <xsl:with-param name="pageclass">
+        <xsl:choose>
+          <xsl:when test="$make.index.markup != 0">body</xsl:when>
+          <xsl:otherwise>index</xsl:otherwise>
+        </xsl:choose>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}">
+        <xsl:call-template name="setindex.titlepage"/>
+      </fo:block>
+      <xsl:apply-templates/>
+      <xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
+
+        <xsl:choose>
+          <xsl:when test="$make.index.markup != 0">
+            <fo:block wrap-option='no-wrap'
+                      white-space-collapse='false'
+                      xsl:use-attribute-sets="monospace.verbatim.properties"
+                      linefeed-treatment="preserve">
+              <xsl:call-template name="generate-index-markup">
+                <xsl:with-param name="scope" select="/"/>
+              </xsl:call-template>
+            </fo:block>
+          </xsl:when>
+          <xsl:when test="indexentry|indexdiv/indexentry">
+            <xsl:apply-templates/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="generate-index">
+              <xsl:with-param name="scope" select="/"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:if>
+    </fo:flow>
+  </fo:page-sequence>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="index/indexinfo"></xsl:template>
+<xsl:template match="index/info"></xsl:template>
+<xsl:template match="index/title"></xsl:template>
+<xsl:template match="index/subtitle"></xsl:template>
+<xsl:template match="index/titleabbrev"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="indexdiv.title">
+  <xsl:param name="title"/>
+  <xsl:param name="titlecontent"/>
+
+  <fo:block xsl:use-attribute-sets="index.div.title.properties">
+    <xsl:choose>
+      <xsl:when test="$title">
+        <xsl:apply-templates select="." mode="object.title.markup">
+          <xsl:with-param name="allow-anchors" select="1"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$titlecontent"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="indexdiv">
+  <fo:block>
+    <xsl:call-template name="indexdiv.titlepage"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="indexdiv/title"/>
+<xsl:template match="indexdiv/subtitle"/>
+<xsl:template match="indexdiv/titleabbrev"/>
+
+<!-- ==================================================================== -->
+
+<!-- Text used for distiguishing between normal and significant entries -->
+<xsl:variable name="significant.flag">.tnacifingis</xsl:variable>
+
+<xsl:template match="indexterm" name="indexterm">
+  <!-- Temporal workaround for bug in AXF -->
+  <xsl:variable name="wrapper.name">
+    <xsl:choose>
+      <xsl:when test="$axf.extensions != 0">
+        <xsl:call-template name="inline.or.block"/>
+      </xsl:when>
+      <xsl:otherwise>fo:wrapper</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:element name="{$wrapper.name}">
+    <xsl:attribute name="id">
+      <xsl:call-template name="object.id"/>
+    </xsl:attribute>
+    <xsl:choose>
+      <xsl:when test="$xep.extensions != 0">
+        <xsl:attribute name="rx:key">
+          <xsl:value-of select="&primary;"/>
+          <xsl:if test="@significance='preferred'"><xsl:value-of select="$significant.flag"/></xsl:if>
+          <xsl:if test="secondary">
+            <xsl:text>, </xsl:text>
+            <xsl:value-of select="&secondary;"/>
+          </xsl:if>
+          <xsl:if test="tertiary">
+            <xsl:text>, </xsl:text>
+            <xsl:value-of select="&tertiary;"/>
+          </xsl:if>
+        </xsl:attribute>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:comment>
+          <xsl:call-template name="comment-escape-string">
+            <xsl:with-param name="string">
+              <xsl:value-of select="primary"/>
+              <xsl:if test="secondary">
+                <xsl:text>, </xsl:text>
+                <xsl:value-of select="secondary"/>
+              </xsl:if>
+              <xsl:if test="tertiary">
+                <xsl:text>, </xsl:text>
+                <xsl:value-of select="tertiary"/>
+              </xsl:if>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:comment>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="indexterm[@class='startofrange']">
+  <xsl:choose>
+    <xsl:when test="$xep.extensions != 0">
+      <rx:begin-index-range>
+        <xsl:call-template name="anchor"/>
+        <xsl:attribute name="rx:key">
+          <xsl:value-of select="&primary;"/>
+          <xsl:if test="@significance='preferred'"><xsl:value-of select="$significant.flag"/></xsl:if>
+          <xsl:if test="secondary">
+            <xsl:text>, </xsl:text>
+            <xsl:value-of select="&secondary;"/>
+          </xsl:if>
+          <xsl:if test="tertiary">
+            <xsl:text>, </xsl:text>
+            <xsl:value-of select="&tertiary;"/>
+          </xsl:if>
+        </xsl:attribute>
+      </rx:begin-index-range>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="indexterm"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="indexterm[@class='endofrange']">
+  <xsl:choose>
+    <xsl:when test="$xep.extensions != 0">
+      <rx:end-index-range>
+        <xsl:attribute name="ref-id">
+          <xsl:value-of select="@startref"/>
+        </xsl:attribute>
+      </rx:end-index-range>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="indexterm"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="indexentry">
+  <fo:block>
+    <!-- don't process 'seeie's from here -->
+    <xsl:apply-templates select="primaryie|secondaryie|tertiaryie|seealsoie"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="primaryie">
+  <fo:block>
+    <xsl:apply-templates/>
+    <xsl:if test="following-sibling::seeie">
+      <xsl:text> (</xsl:text>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'see'"/>
+      </xsl:call-template>
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="following-sibling::seeie"/>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="secondaryie">
+  <fo:block start-indent="1pc">
+    <xsl:apply-templates/>
+    <xsl:if test="following-sibling::seeie">
+      <xsl:text> (</xsl:text>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'see'"/>
+      </xsl:call-template>
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="following-sibling::seeie"/>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="tertiaryie">
+  <fo:block start-indent="2pc">
+    <xsl:apply-templates/>
+    <xsl:if test="following-sibling::seeie">
+      <xsl:text> (</xsl:text>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'see'"/>
+      </xsl:call-template>
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="following-sibling::seeie"/>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="seeie">
+  <fo:inline>
+    <xsl:apply-templates/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="seealsoie">
+  <fo:block>
+    <xsl:attribute name="start-indent">
+      <xsl:choose>
+        <xsl:when test="preceding-sibling::tertiaryie">3pc</xsl:when>
+        <xsl:when test="preceding-sibling::secondaryie">2pc</xsl:when>
+        <xsl:otherwise>1pc</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+    <xsl:text>(</xsl:text>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'seealso'"/>
+    </xsl:call-template>
+    <xsl:text> </xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>)</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<!-- Determines if an object should be inserted as an fo:inline
+     or an fo:block.  Used for indexterms -->
+<xsl:template name="inline.or.block">
+  <xsl:param name="parentnode" select=".."/>
+
+  <xsl:variable name="parent" select="local-name($parentnode)"/>
+
+  <xsl:variable name="block.parents" select="'|answer|appendix|appendixinfo|article|articleinfo|bibliodiv|bibliography|bibliographyinfo|blockinfo|blockquote|bookinfo|callout|caution|chapter|chapterinfo|dedication|example|figure|formalpara|funcsynopsisinfo|glossary|glossaryinfo|glossdef|glossdiv|glossentry|highlights|important|index|indexinfo|info|informalexample|informalfigure|informaltable|itemizedlist|legalnotice|listitem|msgexplan|msgtext|note|objectinfo|orderedlist|partinfo|partintro|preface|prefaceinfo|procedure|qandadiv|qandaset|question|refentry|refentryinfo|referenceinfo|refmeta|refmiscinfo|refsect1|refsect1info|refsect2|refsect2info|refsect3|refsect3info|refsection|refsectioninfo|refsynopsisdiv|refsynopsisdivinfo|revdescription|screeninfo|sect1|sect1info|sect2|sect2info|sect3|sect3info|sect4|sect4info|sect5|sect5info|section|sectioninfo|setindex|setindexinfo|setinfo|sidebar|sidebarinfo|simplesect|step|table|task|taskprerequisites|taskrelated|tasksummary|tip|variablelist|warning|'"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($parent, $block.parents)">fo:block</xsl:when>
+    <xsl:otherwise>fo:inline</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 34 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/info.xsl

@@ -0,0 +1,34 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- These templates define the "default behavior" for info
+     elements.  Even if you don't process the *info wrappers,
+     some of these elements are needed because the elements are
+     processed from named templates that are called with modes.
+     Since modes aren't sticky, these rules apply. 
+     (TODO: clarify this comment) -->
+
+<!-- ==================================================================== -->
+<!-- called from named templates in a given mode -->
+
+<xsl:template match="corpauthor">
+  <fo:inline>
+    <xsl:apply-templates/>
+  </fo:inline>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 1234 - 0
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$
+     ********************************************************************
+
+     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>
+

+ 21 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/keywords.xsl

@@ -0,0 +1,21 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<xsl:template match="keywordset"></xsl:template>
+<xsl:template match="subjectset"></xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 1275 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/lists.xsl

@@ -0,0 +1,1275 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="itemizedlist">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="pi-label-width">
+    <xsl:call-template name="pi.dbfo_label-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="label-width">
+    <xsl:choose>
+      <xsl:when test="$pi-label-width = ''">
+	<xsl:value-of select="$itemizedlist.label.width"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:value-of select="$pi-label-width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="title">
+    <xsl:apply-templates select="title" mode="list.title.mode"/>
+  </xsl:if>
+
+  <!-- Preserve order of PIs and comments -->
+  <xsl:apply-templates 
+      select="*[not(self::listitem
+                or self::title
+                or self::titleabbrev)]
+              |comment()[not(preceding-sibling::listitem)]
+              |processing-instruction()[not(preceding-sibling::listitem)]"/>
+
+  <xsl:variable name="content">
+    <xsl:apply-templates 
+          select="listitem
+                  |comment()[preceding-sibling::listitem]
+                  |processing-instruction()[preceding-sibling::listitem]"/>
+  </xsl:variable>
+
+  <!-- nested lists don't add extra list-block spacing -->
+  <xsl:choose>
+    <xsl:when test="ancestor::listitem">
+      <fo:list-block id="{$id}" xsl:use-attribute-sets="itemizedlist.properties">
+	<xsl:attribute name="provisional-distance-between-starts">
+	  <xsl:value-of select="$label-width"/>
+	</xsl:attribute>
+        <xsl:copy-of select="$content"/>
+      </fo:list-block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing itemizedlist.properties">
+	<xsl:attribute name="provisional-distance-between-starts">
+	  <xsl:value-of select="$label-width"/>
+	</xsl:attribute>
+	<xsl:copy-of select="$content"/>
+      </fo:list-block>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="itemizedlist/title|orderedlist/title">
+  <!--nop-->
+</xsl:template>
+
+<xsl:template match="variablelist/title" mode="vl.as.list">
+  <!--nop-->
+</xsl:template>
+
+<xsl:template match="variablelist/title" mode="vl.as.blocks">
+  <!--nop-->
+</xsl:template>
+
+<xsl:template match="itemizedlist/titleabbrev|orderedlist/titleabbrev">
+  <!--nop-->
+</xsl:template>
+
+<xsl:template match="procedure/titleabbrev">
+  <!--nop-->
+</xsl:template>
+
+<xsl:template match="variablelist/titleabbrev" mode="vl.as.list">
+  <!--nop-->
+</xsl:template>
+
+<xsl:template match="variablelist/titleabbrev" mode="vl.as.blocks">
+  <!--nop-->
+</xsl:template>
+
+<xsl:template match="itemizedlist/listitem">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="item.contents">
+    <fo:list-item-label end-indent="label-end()" xsl:use-attribute-sets="itemizedlist.label.properties">
+      <fo:block>
+        <xsl:call-template name="itemizedlist.label.markup">
+          <xsl:with-param name="itemsymbol">
+            <xsl:call-template name="list.itemsymbol">
+              <xsl:with-param name="node" select="parent::itemizedlist"/>
+            </xsl:call-template>
+          </xsl:with-param>
+        </xsl:call-template>
+      </fo:block>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:choose>
+        <!-- * work around broken passivetex list-item-body rendering -->
+        <xsl:when test="$passivetex.extensions = '1'">
+          <xsl:apply-templates/>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block>
+            <xsl:apply-templates/>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:list-item-body>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="parent::*/@spacing = 'compact'">
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="compact.list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="itemizedlist.label.markup">
+  <xsl:param name="itemsymbol" select="'disc'"/>
+
+  <xsl:choose>
+    <xsl:when test="$itemsymbol='none'"></xsl:when>
+    <xsl:when test="$itemsymbol='disc'">&#x2022;</xsl:when>
+    <xsl:when test="$itemsymbol='bullet'">&#x2022;</xsl:when>
+    <xsl:when test="$itemsymbol='endash'">&#x2013;</xsl:when>
+    <xsl:when test="$itemsymbol='emdash'">&#x2014;</xsl:when>
+    <!-- Some of these may work in your XSL-FO processor and fonts -->
+    <!--
+    <xsl:when test="$itemsymbol='square'">&#x25A0;</xsl:when>
+    <xsl:when test="$itemsymbol='box'">&#x25A0;</xsl:when>
+    <xsl:when test="$itemsymbol='smallblacksquare'">&#x25AA;</xsl:when>
+    <xsl:when test="$itemsymbol='circle'">&#x25CB;</xsl:when>
+    <xsl:when test="$itemsymbol='opencircle'">&#x25CB;</xsl:when>
+    <xsl:when test="$itemsymbol='whitesquare'">&#x25A1;</xsl:when>
+    <xsl:when test="$itemsymbol='smallwhitesquare'">&#x25AB;</xsl:when>
+    <xsl:when test="$itemsymbol='round'">&#x25CF;</xsl:when>
+    <xsl:when test="$itemsymbol='blackcircle'">&#x25CF;</xsl:when>
+    <xsl:when test="$itemsymbol='whitebullet'">&#x25E6;</xsl:when>
+    <xsl:when test="$itemsymbol='triangle'">&#x2023;</xsl:when>
+    <xsl:when test="$itemsymbol='point'">&#x203A;</xsl:when>
+    <xsl:when test="$itemsymbol='hand'"><fo:inline 
+                         font-family="Wingdings 2">A</fo:inline></xsl:when>
+    -->
+    <xsl:otherwise>&#x2022;</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="orderedlist">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="pi-label-width">
+    <xsl:call-template name="pi.dbfo_label-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="label-width">
+    <xsl:choose>
+      <xsl:when test="$pi-label-width = ''">
+	<xsl:value-of select="$orderedlist.label.width"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:value-of select="$pi-label-width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="title">
+    <xsl:apply-templates select="title" mode="list.title.mode"/>
+  </xsl:if>
+
+  <!-- Preserve order of PIs and comments -->
+  <xsl:apply-templates 
+      select="*[not(self::listitem
+                or self::title
+                or self::titleabbrev)]
+              |comment()[not(preceding-sibling::listitem)]
+              |processing-instruction()[not(preceding-sibling::listitem)]"/>
+
+  <xsl:variable name="content">
+    <xsl:apply-templates 
+          select="listitem
+                  |comment()[preceding-sibling::listitem]
+                  |processing-instruction()[preceding-sibling::listitem]"/>
+  </xsl:variable>
+
+  <!-- nested lists don't add extra list-block spacing -->
+  <xsl:choose>
+    <xsl:when test="ancestor::listitem">
+      <fo:list-block id="{$id}" xsl:use-attribute-sets="orderedlist.properties">
+	<xsl:attribute name="provisional-distance-between-starts">
+	  <xsl:value-of select="$label-width"/>
+	</xsl:attribute>
+        <xsl:copy-of select="$content"/>
+      </fo:list-block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing orderedlist.properties">
+	<xsl:attribute name="provisional-distance-between-starts">
+	  <xsl:value-of select="$label-width"/>
+	</xsl:attribute>
+        <xsl:copy-of select="$content"/>
+      </fo:list-block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="orderedlist/listitem" mode="item-number">
+  <xsl:variable name="numeration">
+    <xsl:call-template name="list.numeration">
+      <xsl:with-param name="node" select="parent::orderedlist"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="type">
+    <xsl:choose>
+      <xsl:when test="$numeration='arabic'">1.</xsl:when>
+      <xsl:when test="$numeration='loweralpha'">a.</xsl:when>
+      <xsl:when test="$numeration='lowerroman'">i.</xsl:when>
+      <xsl:when test="$numeration='upperalpha'">A.</xsl:when>
+      <xsl:when test="$numeration='upperroman'">I.</xsl:when>
+      <!-- What!? This should never happen -->
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>Unexpected numeration: </xsl:text>
+          <xsl:value-of select="$numeration"/>
+        </xsl:message>
+        <xsl:value-of select="1."/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="item-number">
+    <xsl:call-template name="orderedlist-item-number"/>
+  </xsl:variable>
+
+  <xsl:if test="parent::orderedlist/@inheritnum='inherit'
+                and ancestor::listitem[parent::orderedlist]">
+    <xsl:apply-templates select="ancestor::listitem[parent::orderedlist][1]"
+                         mode="item-number"/>
+  </xsl:if>
+
+  <xsl:number value="$item-number" format="{$type}"/>
+</xsl:template>
+
+<xsl:template match="orderedlist/listitem">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="item.contents">
+    <fo:list-item-label end-indent="label-end()" xsl:use-attribute-sets="orderedlist.label.properties">
+      <fo:block>
+        <xsl:apply-templates select="." mode="item-number"/>
+      </fo:block>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <fo:block>
+        <xsl:apply-templates/>
+      </fo:block>
+    </fo:list-item-body>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="parent::*/@spacing = 'compact'">
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="compact.list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="listitem/*[1][local-name()='para' or 
+                                   local-name()='simpara' or 
+                                   local-name()='formalpara']
+                     |glossdef/*[1][local-name()='para' or 
+                                   local-name()='simpara' or 
+                                   local-name()='formalpara']
+                     |step/*[1][local-name()='para' or 
+                                   local-name()='simpara' or 
+                                   local-name()='formalpara']
+                     |callout/*[1][local-name()='para' or 
+                                   local-name()='simpara' or 
+                                   local-name()='formalpara']"
+              priority="2">
+  <fo:block>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="variablelist">
+  <xsl:variable name="presentation">
+    <xsl:call-template name="pi.dbfo_list-presentation"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$presentation = 'list'">
+      <xsl:apply-templates select="." mode="vl.as.list"/>
+    </xsl:when>
+    <xsl:when test="$presentation = 'blocks'">
+      <xsl:apply-templates select="." mode="vl.as.blocks"/>
+    </xsl:when>
+    <xsl:when test="$variablelist.as.blocks != 0">
+      <xsl:apply-templates select="." mode="vl.as.blocks"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="vl.as.list"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="variablelist" mode="vl.as.list">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="term-width">
+    <xsl:call-template name="pi.dbfo_term-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="termlength">
+    <xsl:choose>
+      <xsl:when test="$term-width != ''">
+        <xsl:value-of select="$term-width"/>
+      </xsl:when>
+      <xsl:when test="@termlength">
+        <xsl:variable name="termlength.is.number">
+          <xsl:value-of select="@termlength + 0"/>
+        </xsl:variable>
+        <xsl:choose>
+          <xsl:when test="string($termlength.is.number) = 'NaN'">
+            <!-- if the term length isn't just a number, assume it's a measurement -->
+            <xsl:value-of select="@termlength"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="@termlength"/>
+            <xsl:choose>
+              <!-- workaround for passivetex lack of support for non-constant expressions -->
+              <xsl:when test="$passivetex.extensions != 0">
+                <xsl:text>em</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>em * 0.60</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="longest.term">
+          <xsl:with-param name="terms" select="varlistentry/term"/>
+          <xsl:with-param name="maxlength" select="$variablelist.max.termlength"/>
+        </xsl:call-template>
+        <xsl:choose>
+          <!-- workaround for passivetex lack of support for non-constant expressions -->
+          <xsl:when test="$passivetex.extensions != 0">
+            <xsl:text>em</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>em * 0.60</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+<!--
+  <xsl:message>
+    <xsl:text>term width: </xsl:text>
+    <xsl:value-of select="$termlength"/>
+  </xsl:message>
+-->
+
+  <xsl:variable name="label-separation">1em</xsl:variable>
+  <xsl:variable name="distance-between-starts">
+    <xsl:choose>
+      <!-- workaround for passivetex lack of support for non-constant expressions -->
+      <xsl:when test="$passivetex.extensions != 0">
+        <xsl:value-of select="$termlength"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$termlength"/>
+        <xsl:text>+</xsl:text>
+        <xsl:value-of select="$label-separation"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="title">
+    <xsl:apply-templates select="title" mode="list.title.mode"/>
+  </xsl:if>
+
+  <!-- Preserve order of PIs and comments -->
+  <xsl:apply-templates 
+    select="*[not(self::varlistentry
+              or self::title
+              or self::titleabbrev)]
+            |comment()[not(preceding-sibling::varlistentry)]
+            |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
+
+  <xsl:variable name="content">
+    <xsl:apply-templates mode="vl.as.list"
+      select="varlistentry
+              |comment()[preceding-sibling::varlistentry]
+              |processing-instruction()[preceding-sibling::varlistentry]"/>
+  </xsl:variable>
+
+  <!-- nested lists don't add extra list-block spacing -->
+  <xsl:choose>
+    <xsl:when test="ancestor::listitem">
+      <fo:list-block id="{$id}"
+                     provisional-distance-between-starts=
+                        "{$distance-between-starts}"
+                     provisional-label-separation="{$label-separation}">
+        <xsl:copy-of select="$content"/>
+      </fo:list-block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-block id="{$id}"
+                     provisional-distance-between-starts=
+                        "{$distance-between-starts}"
+                     provisional-label-separation="{$label-separation}"
+                     xsl:use-attribute-sets="list.block.spacing">
+        <xsl:copy-of select="$content"/>
+      </fo:list-block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="longest.term">
+  <xsl:param name="longest" select="0"/>
+  <xsl:param name="terms" select="."/>
+  <xsl:param name="maxlength" select="-1"/>
+
+  <!-- Process out any indexterms in the term -->
+  <xsl:variable name="term.text">
+    <xsl:apply-templates select="$terms[1]"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$longest &gt; $maxlength and $maxlength &gt; 0">
+      <xsl:value-of select="$maxlength"/>
+    </xsl:when>
+    <xsl:when test="not($terms)">
+      <xsl:value-of select="$longest"/>
+    </xsl:when>
+    <xsl:when test="string-length($term.text) &gt; $longest">
+      <xsl:call-template name="longest.term">
+        <xsl:with-param name="longest" 
+            select="string-length($term.text)"/>
+        <xsl:with-param name="maxlength" select="$maxlength"/>
+        <xsl:with-param name="terms" select="$terms[position() &gt; 1]"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="longest.term">
+        <xsl:with-param name="longest" select="$longest"/>
+        <xsl:with-param name="maxlength" select="$maxlength"/>
+        <xsl:with-param name="terms" select="$terms[position() &gt; 1]"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="varlistentry" mode="vl.as.list">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <xsl:variable name="item.contents">
+    <fo:list-item-label end-indent="label-end()" text-align="start">
+      <fo:block>
+        <xsl:apply-templates select="term"/>
+      </fo:block>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <fo:block>
+        <xsl:apply-templates select="listitem"/>
+      </fo:block>
+    </fo:list-item-body>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="parent::*/@spacing = 'compact'">
+      <fo:list-item id="{$id}"
+          xsl:use-attribute-sets="compact.list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:list-item id="{$id}" xsl:use-attribute-sets="list.item.spacing">
+        <xsl:copy-of select="$item.contents"/>
+      </fo:list-item>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<xsl:template match="variablelist" mode="vl.as.blocks">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <!-- termlength is irrelevant -->
+
+  <xsl:if test="title">
+    <xsl:apply-templates select="title" mode="list.title.mode"/>
+  </xsl:if>
+
+  <!-- Preserve order of PIs and comments -->
+  <xsl:apply-templates 
+    select="*[not(self::varlistentry
+              or self::title
+              or self::titleabbrev)]
+            |comment()[not(preceding-sibling::varlistentry)]
+            |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
+
+  <xsl:variable name="content">
+    <xsl:apply-templates mode="vl.as.blocks"
+      select="varlistentry
+              |comment()[preceding-sibling::varlistentry]
+              |processing-instruction()[preceding-sibling::varlistentry]"/>
+  </xsl:variable>
+
+  <!-- nested lists don't add extra list-block spacing -->
+  <xsl:choose>
+    <xsl:when test="ancestor::listitem">
+      <fo:block id="{$id}">
+        <xsl:copy-of select="$content"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}" xsl:use-attribute-sets="list.block.spacing">
+        <xsl:copy-of select="$content"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="varlistentry" mode="vl.as.blocks">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"  
+      keep-together.within-column="always" 
+      keep-with-next.within-column="always">
+    <xsl:apply-templates select="term"/>
+  </fo:block>
+
+  <fo:block margin-left="0.25in">
+    <xsl:apply-templates select="listitem"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="varlistentry/term">
+  <fo:inline>
+    <xsl:call-template name="simple.xlink">
+      <xsl:with-param name="content">
+        <xsl:apply-templates/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </fo:inline>
+  <xsl:choose>
+    <xsl:when test="not(following-sibling::term)"/> <!-- do nothing -->
+    <xsl:otherwise>
+      <!-- * if we have multiple terms in the same varlistentry, generate -->
+      <!-- * a separator (", " by default) and/or an additional line -->
+      <!-- * break after each one except the last -->
+      <fo:inline><xsl:value-of select="$variablelist.term.separator"/></fo:inline>
+      <xsl:if test="not($variablelist.term.break.after = '0')">
+        <fo:block/>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="varlistentry/listitem">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="title" mode="list.title.mode">
+  <xsl:call-template name="formal.object.heading">
+    <xsl:with-param name="object" select=".."/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="simplelist|simplelist[@type='vert']">
+  <!-- with no type specified, the default is 'vert' -->
+
+  <xsl:variable name="explicit.table.width">
+    <xsl:call-template name="dbfo-attribute">
+      <xsl:with-param name="pis"
+		      select="processing-instruction('dbfo')"/>
+      <xsl:with-param name="attribute" select="'list-width'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="table.width">
+    <xsl:choose>
+      <xsl:when test="$explicit.table.width != ''">
+        <xsl:value-of select="$explicit.table.width"/>
+      </xsl:when>
+      <xsl:when test="$default.table.width = ''">
+        <xsl:text>100%</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$default.table.width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:table xsl:use-attribute-sets="normal.para.spacing">
+
+    <xsl:choose>
+      <xsl:when test="$axf.extensions != 0 or $xep.extensions != 0">
+	<xsl:attribute name="table-layout">auto</xsl:attribute>
+        <xsl:if test="$explicit.table.width != ''">
+          <xsl:attribute name="width"><xsl:value-of 
+	  select="$explicit.table.width"/></xsl:attribute>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:attribute name="table-layout">fixed</xsl:attribute>
+        <xsl:attribute name="width"><xsl:value-of 
+                                      select="$table.width"/></xsl:attribute>
+      </xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:call-template name="simplelist.table.columns">
+      <xsl:with-param name="cols">
+        <xsl:choose>
+          <xsl:when test="@columns">
+            <xsl:value-of select="@columns"/>
+          </xsl:when>
+          <xsl:otherwise>1</xsl:otherwise>
+        </xsl:choose>
+      </xsl:with-param>
+    </xsl:call-template>
+    <fo:table-body start-indent="0pt" end-indent="0pt">
+      <xsl:call-template name="simplelist.vert">
+        <xsl:with-param name="cols">
+          <xsl:choose>
+            <xsl:when test="@columns">
+              <xsl:value-of select="@columns"/>
+            </xsl:when>
+            <xsl:otherwise>1</xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+      </xsl:call-template>
+    </fo:table-body>
+  </fo:table>
+</xsl:template>
+
+<xsl:template match="simplelist[@type='inline']">
+  <!-- if dbchoice PI exists, use that to determine the choice separator -->
+  <!-- (that is, equivalent of "and" or "or" in current locale), or literal -->
+  <!-- value of "choice" otherwise -->
+  <fo:inline><xsl:variable name="localized-choice-separator">
+    <xsl:choose>
+      <xsl:when test="processing-instruction('dbchoice')">
+        <xsl:call-template name="select.choice.separator"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- empty -->
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:for-each select="member">
+    <xsl:apply-templates/>
+    <xsl:choose>
+      <xsl:when test="position() = last()"/> <!-- do nothing -->
+      <xsl:otherwise>
+	<xsl:text>, </xsl:text>
+	<xsl:if test="position() = last() - 1">
+	  <xsl:if test="$localized-choice-separator != ''">
+	    <xsl:value-of select="$localized-choice-separator"/>
+	    <xsl:text> </xsl:text>
+	  </xsl:if>
+	</xsl:if>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:for-each></fo:inline>
+</xsl:template>
+
+<xsl:template match="simplelist[@type='horiz']">
+
+  <xsl:variable name="explicit.table.width">
+    <xsl:call-template name="pi.dbfo_list-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="table.width">
+    <xsl:choose>
+      <xsl:when test="$explicit.table.width != ''">
+        <xsl:value-of select="$explicit.table.width"/>
+      </xsl:when>
+      <xsl:when test="$default.table.width = ''">
+        <xsl:text>100%</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$default.table.width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:table xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:choose>
+      <xsl:when test="$axf.extensions != 0 or $xep.extensions != 0">
+        <xsl:attribute name="table-layout">auto</xsl:attribute>
+        <xsl:if test="$explicit.table.width != ''">
+          <xsl:attribute name="width"><xsl:value-of 
+                             select="$explicit.table.width"/></xsl:attribute>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:attribute name="table-layout">fixed</xsl:attribute>
+        <xsl:attribute name="width"><xsl:value-of 
+                                      select="$table.width"/></xsl:attribute>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:call-template name="simplelist.table.columns">
+      <xsl:with-param name="cols">
+        <xsl:choose>
+          <xsl:when test="@columns">
+            <xsl:value-of select="@columns"/>
+          </xsl:when>
+          <xsl:otherwise>1</xsl:otherwise>
+        </xsl:choose>
+      </xsl:with-param>
+    </xsl:call-template>
+    <fo:table-body start-indent="0pt" end-indent="0pt">
+      <xsl:call-template name="simplelist.horiz">
+        <xsl:with-param name="cols">
+          <xsl:choose>
+            <xsl:when test="@columns">
+              <xsl:value-of select="@columns"/>
+            </xsl:when>
+            <xsl:otherwise>1</xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
+      </xsl:call-template>
+    </fo:table-body>
+  </fo:table>
+</xsl:template>
+
+<xsl:template name="simplelist.table.columns">
+  <xsl:param name="cols" select="1"/>
+  <xsl:param name="curcol" select="1"/>
+  <fo:table-column column-number="{$curcol}"
+                   column-width="proportional-column-width(1)"/>
+  <xsl:if test="$curcol &lt; $cols">
+    <xsl:call-template name="simplelist.table.columns">
+      <xsl:with-param name="cols" select="$cols"/>
+      <xsl:with-param name="curcol" select="$curcol + 1"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="simplelist.horiz">
+  <xsl:param name="cols">1</xsl:param>
+  <xsl:param name="cell">1</xsl:param>
+  <xsl:param name="members" select="./member"/>
+
+  <xsl:if test="$cell &lt;= count($members)">
+    <fo:table-row>
+      <xsl:call-template name="simplelist.horiz.row">
+        <xsl:with-param name="cols" select="$cols"/>
+        <xsl:with-param name="cell" select="$cell"/>
+        <xsl:with-param name="members" select="$members"/>
+      </xsl:call-template>
+   </fo:table-row>
+    <xsl:call-template name="simplelist.horiz">
+      <xsl:with-param name="cols" select="$cols"/>
+      <xsl:with-param name="cell" select="$cell + $cols"/>
+      <xsl:with-param name="members" select="$members"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="simplelist.horiz.row">
+  <xsl:param name="cols">1</xsl:param>
+  <xsl:param name="cell">1</xsl:param>
+  <xsl:param name="members" select="./member"/>
+  <xsl:param name="curcol">1</xsl:param>
+
+  <xsl:if test="$curcol &lt;= $cols">
+    <fo:table-cell>
+      <fo:block>
+        <xsl:if test="$members[position()=$cell]">
+          <xsl:apply-templates select="$members[position()=$cell]"/>
+        </xsl:if>
+      </fo:block>
+    </fo:table-cell>
+    <xsl:call-template name="simplelist.horiz.row">
+      <xsl:with-param name="cols" select="$cols"/>
+      <xsl:with-param name="cell" select="$cell+1"/>
+      <xsl:with-param name="members" select="$members"/>
+      <xsl:with-param name="curcol" select="$curcol+1"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="simplelist.vert">
+  <xsl:param name="cols">1</xsl:param>
+  <xsl:param name="cell">1</xsl:param>
+  <xsl:param name="members" select="./member"/>
+  <xsl:param name="rows"
+             select="floor((count($members)+$cols - 1) div $cols)"/>
+
+  <xsl:if test="$cell &lt;= $rows">
+    <fo:table-row>
+      <xsl:call-template name="simplelist.vert.row">
+        <xsl:with-param name="cols" select="$cols"/>
+        <xsl:with-param name="rows" select="$rows"/>
+        <xsl:with-param name="cell" select="$cell"/>
+        <xsl:with-param name="members" select="$members"/>
+      </xsl:call-template>
+   </fo:table-row>
+    <xsl:call-template name="simplelist.vert">
+      <xsl:with-param name="cols" select="$cols"/>
+      <xsl:with-param name="cell" select="$cell+1"/>
+      <xsl:with-param name="members" select="$members"/>
+      <xsl:with-param name="rows" select="$rows"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="simplelist.vert.row">
+  <xsl:param name="cols">1</xsl:param>
+  <xsl:param name="rows">1</xsl:param>
+  <xsl:param name="cell">1</xsl:param>
+  <xsl:param name="members" select="./member"/>
+  <xsl:param name="curcol">1</xsl:param>
+
+  <xsl:if test="$curcol &lt;= $cols">
+    <fo:table-cell>
+      <fo:block>
+        <xsl:if test="$members[position()=$cell]">
+          <xsl:apply-templates select="$members[position()=$cell]"/>
+        </xsl:if>
+      </fo:block>
+    </fo:table-cell>
+    <xsl:call-template name="simplelist.vert.row">
+      <xsl:with-param name="cols" select="$cols"/>
+      <xsl:with-param name="rows" select="$rows"/>
+      <xsl:with-param name="cell" select="$cell+$rows"/>
+      <xsl:with-param name="members" select="$members"/>
+      <xsl:with-param name="curcol" select="$curcol+1"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="member">
+  <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="procedure">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <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>
+
+  <!-- Preserve order of PIs and comments -->
+  <xsl:variable name="preamble"
+        select="*[not(self::step
+                  or self::title
+                  or self::titleabbrev)]
+                |comment()[not(preceding-sibling::step)]
+                |processing-instruction()[not(preceding-sibling::step)]"/>
+
+  <xsl:variable name="steps" 
+                select="step
+                        |comment()[preceding-sibling::step]
+                        |processing-instruction()[preceding-sibling::step]"/>
+
+  <fo:block id="{$id}" xsl:use-attribute-sets="procedure.properties list.block.spacing">
+    <xsl:if test="./title and $placement = 'before'">
+      <!-- n.b. gentext code tests for $formal.procedures and may make an "informal" -->
+      <!-- heading even though we called formal.object.heading. odd but true. -->
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="$preamble"/>
+
+    <fo:list-block xsl:use-attribute-sets="list.block.spacing"
+                   provisional-distance-between-starts="2em"
+                   provisional-label-separation="0.2em">
+      <xsl:apply-templates select="$steps"/>
+    </fo:list-block>
+
+    <xsl:if test="./title and $placement != 'before'">
+      <!-- n.b. gentext code tests for $formal.procedures and may make an "informal" -->
+      <!-- heading even though we called formal.object.heading. odd but true. -->
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="procedure/title">
+</xsl:template>
+
+<xsl:template match="substeps">
+  <fo:list-block xsl:use-attribute-sets="list.block.spacing"
+                 provisional-distance-between-starts="2em"
+                 provisional-label-separation="0.2em">
+    <xsl:apply-templates/>
+  </fo:list-block>
+</xsl:template>
+
+<xsl:template match="procedure/step|substeps/step">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:list-item xsl:use-attribute-sets="list.item.spacing">
+    <fo:list-item-label end-indent="label-end()">
+      <fo:block id="{$id}">
+        <!-- dwc: fix for one step procedures. Use a bullet if there's no step 2 -->
+        <xsl:choose>
+          <xsl:when test="count(../step) = 1">
+            <xsl:text>&#x2022;</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="." mode="number">
+              <xsl:with-param name="recursive" select="0"/>
+            </xsl:apply-templates>.
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:block>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <fo:block>
+        <xsl:apply-templates/>
+      </fo:block>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<xsl:template match="stepalternatives">
+  <fo:list-block provisional-distance-between-starts="2em"
+                 provisional-label-separation="0.2em">
+    <xsl:apply-templates select="step"/>
+  </fo:list-block>
+</xsl:template>
+
+<xsl:template match="stepalternatives/step">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:list-item xsl:use-attribute-sets="list.item.spacing">
+    <fo:list-item-label end-indent="label-end()">
+      <fo:block id="{$id}">
+        <xsl:text>&#x2022;</xsl:text>
+      </fo:block>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <fo:block>
+        <xsl:apply-templates/>
+      </fo:block>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<xsl:template match="step/title">
+  <fo:block font-weight="bold"
+            keep-together.within-column="always" 
+            keep-with-next.within-column="always">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="segmentedlist">
+  <xsl:variable name="presentation">
+    <xsl:call-template name="pi.dbfo_list-presentation"/>
+  </xsl:variable>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$presentation = 'table'">
+      <fo:block id="{$id}">
+        <xsl:apply-templates select="." mode="seglist-table"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="$presentation = 'list'">
+      <fo:block id="{$id}">
+        <xsl:apply-templates/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="$segmentedlist.as.table != 0">
+      <fo:block id="{$id}">
+        <xsl:apply-templates select="." mode="seglist-table"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}">
+        <xsl:apply-templates/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="segmentedlist/title">
+  <xsl:apply-templates select="." mode="list.title.mode" />
+</xsl:template>
+
+<xsl:template match="segtitle">
+</xsl:template>
+
+<xsl:template match="segtitle" mode="segtitle-in-seg">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="seglistitem">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <fo:block id="{$id}">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="seg">
+  <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
+  <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
+  <xsl:variable name="segtitles" select="$seglist/segtitle"/>
+
+  <!--
+     Note: segtitle is only going to be the right thing in a well formed
+     SegmentedList.  If there are too many Segs or too few SegTitles,
+     you'll get something odd...maybe an error
+  -->
+
+  <fo:block>
+    <fo:inline font-weight="bold">
+      <xsl:apply-templates select="$segtitles[$segnum=position()]"
+                           mode="segtitle-in-seg"/>
+      <xsl:text>: </xsl:text>
+    </fo:inline>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="segmentedlist" mode="seglist-table">
+  <xsl:apply-templates select="title" mode="list.title.mode" />
+  <fo:table>
+    <fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
+    <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
+    <fo:table-header start-indent="0pt" end-indent="0pt">
+      <fo:table-row>
+        <xsl:apply-templates select="segtitle" mode="seglist-table"/>
+      </fo:table-row>
+    </fo:table-header>
+    <fo:table-body start-indent="0pt" end-indent="0pt">
+      <xsl:apply-templates select="seglistitem" mode="seglist-table"/>
+    </fo:table-body>
+  </fo:table>
+</xsl:template>
+
+<xsl:template match="segtitle" mode="seglist-table">
+  <fo:table-cell>
+    <fo:block font-weight="bold">
+      <xsl:apply-templates/>
+    </fo:block>
+  </fo:table-cell>
+</xsl:template>
+
+<xsl:template match="seglistitem" mode="seglist-table">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <fo:table-row id="{$id}">
+    <xsl:apply-templates mode="seglist-table"/>
+  </fo:table-row>
+</xsl:template>
+
+<xsl:template match="seg" mode="seglist-table">
+  <fo:table-cell>
+    <fo:block>
+      <xsl:apply-templates/>
+    </fo:block>
+  </fo:table-cell>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="calloutlist">
+  <xsl:variable name="id">
+  <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}"
+            text-align="{$alignment}">
+    <!-- The above restores alignment altered by image align attribute -->
+    <xsl:if test="title|info/title">
+      <xsl:apply-templates select="(title|info/title)[1]" 
+                           mode="list.title.mode"/>
+    </xsl:if>
+
+    <!-- Preserve order of PIs and comments -->
+    <xsl:apply-templates 
+         select="*[not(self::callout or self::title or self::titleabbrev)]
+                   |comment()[not(preceding-sibling::callout)]
+                   |processing-instruction()[not(preceding-sibling::callout)]"/>
+
+    <fo:list-block space-before.optimum="1em"
+                   space-before.minimum="0.8em"
+                   space-before.maximum="1.2em"
+                   provisional-distance-between-starts="2.2em"
+                   provisional-label-separation="0.2em">
+      <xsl:apply-templates select="callout
+                                |comment()[preceding-sibling::callout]
+                                |processing-instruction()[preceding-sibling::callout]"/>
+    </fo:list-block>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="calloutlist/title">
+</xsl:template>
+
+<xsl:template match="callout">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+  <fo:list-item id="{$id}">
+    <fo:list-item-label end-indent="label-end()">
+      <fo:block>
+        <xsl:call-template name="callout.arearefs">
+          <xsl:with-param name="arearefs" select="@arearefs"/>
+        </xsl:call-template>
+      </fo:block>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <fo:block>
+        <xsl:apply-templates/>
+      </fo:block>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<xsl:template name="callout.arearefs">
+  <xsl:param name="arearefs"></xsl:param>
+  <xsl:if test="$arearefs!=''">
+    <xsl:choose>
+      <xsl:when test="substring-before($arearefs,' ')=''">
+        <xsl:call-template name="callout.arearef">
+          <xsl:with-param name="arearef" select="$arearefs"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="callout.arearef">
+          <xsl:with-param name="arearef"
+                          select="substring-before($arearefs,' ')"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:call-template name="callout.arearefs">
+      <xsl:with-param name="arearefs"
+                      select="substring-after($arearefs,' ')"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="callout.arearef">
+  <xsl:param name="arearef"></xsl:param>
+  <xsl:variable name="targets" select="key('id',$arearef)"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+
+  <xsl:choose>
+    <xsl:when test="count($target)=0">
+      <xsl:value-of select="$arearef"/>
+      <xsl:text>: ???</xsl:text>
+    </xsl:when>
+    <xsl:when test="local-name($target)='co'">
+      <xsl:apply-templates select="$target" mode="callout-bug"/>
+    </xsl:when>
+    <xsl:when test="local-name($target)='areaset'">
+      <xsl:call-template name="callout-bug">
+        <xsl:with-param name="conum">
+          <xsl:apply-templates select="$target" mode="conumber"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="local-name($target)='area'">
+      <xsl:choose>
+        <xsl:when test="$target/parent::areaset">
+          <xsl:call-template name="callout-bug">
+            <xsl:with-param name="conum">
+              <xsl:apply-templates select="$target/parent::areaset"
+                                   mode="conumber"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="callout-bug">
+            <xsl:with-param name="conum">
+              <xsl:apply-templates select="$target" mode="conumber"/>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>???</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>
+

+ 128 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/math.xsl

@@ -0,0 +1,128 @@
+<?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:mml="http://www.w3.org/1998/Math/MathML"
+                exclude-result-prefixes="mml"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<xsl:template match="inlineequation">
+  <xsl:choose>
+    <xsl:when test="$passivetex.extensions != 0 and $tex.math.in.alt != ''">
+      <xsl:apply-templates select="alt[@role='tex'] | inlinemediaobject/textobject[@role='tex']">
+        <xsl:with-param name="output.delims">
+          <xsl:call-template name="tex.math.output.delims"/>
+        </xsl:with-param>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="alt">
+</xsl:template>
+
+<xsl:template match="mathphrase">
+  <fo:inline>
+    <xsl:apply-templates/>
+  </fo:inline>
+</xsl:template>
+
+<!-- "Support" for MathML -->
+
+<xsl:template match="mml:math" xmlns:mml="http://www.w3.org/1998/Math/MathML">
+  <fo:instream-foreign-object>
+    <xsl:copy>
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </fo:instream-foreign-object>
+</xsl:template>
+
+<xsl:template match="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="equation/graphic | informalequation/graphic">
+  <xsl:if test="$passivetex.extensions = 0 or $tex.math.in.alt = ''">
+    <fo:block>
+      <xsl:call-template name="process.image"/>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="inlineequation/alt[@role='tex'] | 
+                     inlineequation/inlinemediaobject/textobject[@role='tex']" priority="1">
+  <xsl:param name="output.delims" select="1"/>
+  <xsl:if test="$passivetex.extensions != 0 and $tex.math.in.alt != ''">
+    <xsl:processing-instruction name="xmltex">
+      <xsl:if test="$output.delims != 0">
+        <xsl:text>$</xsl:text>
+      </xsl:if>
+      <xsl:value-of select="."/>
+      <xsl:if test="$output.delims != 0">
+        <xsl:text>$</xsl:text>
+      </xsl:if>
+    </xsl:processing-instruction>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="equation/alt[@role='tex'] | informalequation/alt[@role='tex'] |
+                     equation/mediaobject/textobject[@role='tex'] |
+                     informalequation/mediaobject/textobject[@role='tex']" priority="1">
+  <xsl:variable name="output.delims">
+    <xsl:call-template name="tex.math.output.delims"/>
+  </xsl:variable>
+  <xsl:if test="$passivetex.extensions != 0 and $tex.math.in.alt != ''">
+    <xsl:processing-instruction name="xmltex">
+      <xsl:if test="$output.delims != 0">
+        <xsl:text>$$</xsl:text>
+      </xsl:if>
+      <xsl:value-of select="."/>
+      <xsl:if test="$output.delims != 0">
+        <xsl:text>$$</xsl:text>
+      </xsl:if>
+    </xsl:processing-instruction>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="alt[@role='tex']">
+  <xsl:if test="$passivetex.extensions != 0 and $tex.math.in.alt != ''">
+    <xsl:message>
+      Your equation is misplaced. It should be in inlineequation, equation or informalequation.
+    </xsl:message>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="tex.math.output.delims">
+  <xsl:variable name="pi.delims">
+    <xsl:call-template name="pi-attribute">
+      <xsl:with-param name="pis" select=".//processing-instruction('dbtex')"/>
+      <xsl:with-param name="attribute" select="'delims'"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="result">
+    <xsl:choose>
+      <xsl:when test="$pi.delims = 'no'">0</xsl:when>
+      <xsl:when test="$pi.delims = '' and $tex.math.delims = 0">0</xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:value-of select="$result"/>
+</xsl:template>
+
+</xsl:stylesheet>

+ 2314 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/pagesetup.xsl

@@ -0,0 +1,2314 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the DocBook XSL Stylesheet distribution.
+     See ../README or http://docbook.sf.net/ for copyright
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:param name="body.fontset">
+  <xsl:value-of select="$body.font.family"/>
+  <xsl:if test="$body.font.family != ''
+                and $symbol.font.family  != ''">,</xsl:if>
+    <xsl:value-of select="$symbol.font.family"/>
+</xsl:param>
+
+<xsl:param name="title.fontset">
+  <xsl:value-of select="$title.font.family"/>
+  <xsl:if test="$title.font.family != ''
+                and $symbol.font.family  != ''">,</xsl:if>
+    <xsl:value-of select="$symbol.font.family"/>
+</xsl:param>
+
+<!-- PassiveTeX can't handle the math expression for
+     title.margin.left being negative, so ignore it.
+     margin-left="{$page.margin.outer} - {$title.margin.left}"
+-->
+<xsl:param name="margin.left.outer">
+  <xsl:choose>
+    <xsl:when test="$passivetex.extensions != 0">
+      <xsl:value-of select="$page.margin.outer"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$page.margin.outer"/>
+      <xsl:text> - </xsl:text>
+      <xsl:value-of select="$title.margin.left"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+<xsl:param name="margin.left.inner">
+  <xsl:choose>
+    <xsl:when test="$passivetex.extensions != 0">
+      <xsl:value-of select="$page.margin.inner"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$page.margin.inner"/>
+      <xsl:text> - </xsl:text>
+      <xsl:value-of select="$title.margin.left"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+<xsl:template name="setup.pagemasters">
+  <fo:layout-master-set>
+    <!-- blank pages -->
+    <fo:simple-page-master master-name="blank"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.outer}"
+                           margin-right="{$page.margin.inner}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">blank</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body display-align="center"
+                      margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}">
+        <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
+          <xsl:attribute name="region-name">blank-body</xsl:attribute>
+        </xsl:if>
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-blank"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-blank"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <!-- title pages -->
+    <fo:simple-page-master master-name="titlepage-first"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">titlepage-first</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.titlepage}"
+                      column-count="{$column.count.titlepage}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-first"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-first"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="titlepage-odd"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">titlepage-odd</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.titlepage}"
+                      column-count="{$column.count.titlepage}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-odd"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-odd"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="titlepage-even"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.outer}"
+                           margin-right="{$page.margin.inner}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">titlepage-even</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.titlepage}"
+                      column-count="{$column.count.titlepage}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-even"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-even"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <!-- list-of-title pages -->
+    <fo:simple-page-master master-name="lot-first"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">lot-first</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.lot}"
+                      column-count="{$column.count.lot}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-first"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-first"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="lot-odd"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">lot-odd</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.lot}"
+                      column-count="{$column.count.lot}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-odd"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-odd"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="lot-even"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.outer}"
+                           margin-right="{$page.margin.inner}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">lot-even</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.lot}"
+                      column-count="{$column.count.lot}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-even"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-even"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <!-- frontmatter pages -->
+    <fo:simple-page-master master-name="front-first"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">front-first</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.front}"
+                      column-count="{$column.count.front}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-first"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-first"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="front-odd"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">front-odd</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.front}"
+                      column-count="{$column.count.front}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-odd"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-odd"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="front-even"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.outer}"
+                           margin-right="{$page.margin.inner}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">front-even</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.front}"
+                      column-count="{$column.count.front}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-even"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-even"
+                       extent="{$region.after.extent}"
+                        display-align="after"/>
+    </fo:simple-page-master>
+
+    <!-- body pages -->
+    <fo:simple-page-master master-name="body-first"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">body-first</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.body}"
+                      column-count="{$column.count.body}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-first"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-first"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="body-odd"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">body-odd</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.body}"
+                      column-count="{$column.count.body}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-odd"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-odd"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="body-even"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.outer}"
+                           margin-right="{$page.margin.inner}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">body-even</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.body}"
+                      column-count="{$column.count.body}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-even"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-even"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <!-- backmatter pages -->
+    <fo:simple-page-master master-name="back-first"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">back-first</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.back}"
+                      column-count="{$column.count.back}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-first"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-first"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="back-odd"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">back-odd</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.back}"
+                      column-count="{$column.count.back}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-odd"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-odd"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="back-even"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$margin.left.outer}"
+                           margin-right="{$page.margin.inner}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">back-even</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.back}"
+                      column-count="{$column.count.back}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-even"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-even"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <!-- index pages -->
+    <fo:simple-page-master master-name="index-first"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$page.margin.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">index-first</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.index}"
+                      column-count="{$column.count.index}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-first"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-first"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="index-odd"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$page.margin.inner}"
+                           margin-right="{$page.margin.outer}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">index-odd</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.index}"
+                      column-count="{$column.count.index}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-odd"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-odd"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <fo:simple-page-master master-name="index-even"
+                           page-width="{$page.width}"
+                           page-height="{$page.height}"
+                           margin-top="{$page.margin.top}"
+                           margin-bottom="{$page.margin.bottom}"
+                           margin-left="{$page.margin.outer}"
+                           margin-right="{$page.margin.inner}">
+      <xsl:if test="$axf.extensions != 0">
+        <xsl:call-template name="axf-page-master-properties">
+          <xsl:with-param name="page.master">index-even</xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+      <fo:region-body margin-bottom="{$body.margin.bottom}"
+                      margin-top="{$body.margin.top}"
+                      column-gap="{$column.gap.index}"
+                      column-count="{$column.count.index}">
+      </fo:region-body>
+      <fo:region-before region-name="xsl-region-before-even"
+                        extent="{$region.before.extent}"
+                        display-align="before"/>
+      <fo:region-after region-name="xsl-region-after-even"
+                       extent="{$region.after.extent}"
+                       display-align="after"/>
+    </fo:simple-page-master>
+
+    <xsl:if test="$draft.mode != 'no'">
+      <!-- draft blank pages -->
+      <fo:simple-page-master master-name="blank-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.outer}"
+                             margin-right="{$page.margin.inner}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">blank-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-blank"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-blank"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <!-- draft title pages -->
+      <fo:simple-page-master master-name="titlepage-first-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">titlepage-first-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.titlepage}"
+                        column-count="{$column.count.titlepage}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-first"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-first"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="titlepage-odd-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">titlepage-odd-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.titlepage}"
+                        column-count="{$column.count.titlepage}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-odd"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-odd"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="titlepage-even-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.outer}"
+                             margin-right="{$page.margin.inner}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">titlepage-even-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.titlepage}"
+                        column-count="{$column.count.titlepage}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-even"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-even"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <!-- draft list-of-title pages -->
+      <fo:simple-page-master master-name="lot-first-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">lot-first-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.lot}"
+                        column-count="{$column.count.lot}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-first"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-first"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="lot-odd-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">lot-odd-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.lot}"
+                        column-count="{$column.count.lot}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-odd"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-odd"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="lot-even-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.outer}"
+                             margin-right="{$page.margin.inner}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">lot-even-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.lot}"
+                        column-count="{$column.count.lot}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-even"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-even"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <!-- draft frontmatter pages -->
+      <fo:simple-page-master master-name="front-first-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">front-first-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.front}"
+                        column-count="{$column.count.front}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-first"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-first"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="front-odd-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">front-odd-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.front}"
+                        column-count="{$column.count.front}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-odd"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-odd"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="front-even-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.outer}"
+                             margin-right="{$page.margin.inner}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">front-even-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.front}"
+                        column-count="{$column.count.front}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-even"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-even"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <!-- draft body pages -->
+      <fo:simple-page-master master-name="body-first-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">body-first-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.body}"
+                        column-count="{$column.count.body}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-first"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-first"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="body-odd-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">body-odd-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.body}"
+                        column-count="{$column.count.body}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-odd"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-odd"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="body-even-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.outer}"
+                             margin-right="{$page.margin.inner}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">body-even-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.body}"
+                        column-count="{$column.count.body}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-even"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-even"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <!-- draft backmatter pages -->
+      <fo:simple-page-master master-name="back-first-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">back-first-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.back}"
+                        column-count="{$column.count.back}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-first"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-first"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="back-odd-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">back-odd-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.back}"
+                        column-count="{$column.count.back}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-odd"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-odd"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="back-even-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$margin.left.outer}"
+                             margin-right="{$page.margin.inner}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">back-even-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.back}"
+                        column-count="{$column.count.back}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-even"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-even"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <!-- draft index pages -->
+      <fo:simple-page-master master-name="index-first-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$page.margin.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">index-first-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.index}"
+                        column-count="{$column.count.index}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-first"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-first"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="index-odd-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-left="{$page.margin.inner}"
+                             margin-right="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">index-odd-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.index}"
+                        column-count="{$column.count.index}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-odd"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-odd"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+
+      <fo:simple-page-master master-name="index-even-draft"
+                             page-width="{$page.width}"
+                             page-height="{$page.height}"
+                             margin-top="{$page.margin.top}"
+                             margin-bottom="{$page.margin.bottom}"
+                             margin-right="{$page.margin.inner}"
+                             margin-left="{$page.margin.outer}">
+        <xsl:if test="$axf.extensions != 0">
+          <xsl:call-template name="axf-page-master-properties">
+            <xsl:with-param name="page.master">index-even-draft</xsl:with-param>
+          </xsl:call-template>
+        </xsl:if>
+        <fo:region-body margin-bottom="{$body.margin.bottom}"
+                        margin-top="{$body.margin.top}"
+                        column-gap="{$column.gap.index}"
+                        column-count="{$column.count.index}">
+          <xsl:if test="$draft.watermark.image != ''">
+            <xsl:attribute name="background-image">
+              <xsl:call-template name="fo-external-image">
+                <xsl:with-param name="filename" select="$draft.watermark.image"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:attribute name="background-attachment">fixed</xsl:attribute>
+            <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
+            <xsl:attribute name="background-position-horizontal">center</xsl:attribute>
+            <xsl:attribute name="background-position-vertical">center</xsl:attribute>
+          </xsl:if>
+        </fo:region-body>
+        <fo:region-before region-name="xsl-region-before-even"
+                          extent="{$region.before.extent}"
+                          display-align="before"/>
+        <fo:region-after region-name="xsl-region-after-even"
+                         extent="{$region.after.extent}"
+                         display-align="after"/>
+      </fo:simple-page-master>
+    </xsl:if>
+
+    <!-- setup for title page(s) -->
+    <fo:page-sequence-master master-name="titlepage">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank"
+                                              blank-or-not-blank="blank"/>
+        <fo:conditional-page-master-reference master-reference="titlepage-first"
+                                              page-position="first"/>
+        <fo:conditional-page-master-reference master-reference="titlepage-odd"
+                                              odd-or-even="odd"/>
+        <fo:conditional-page-master-reference 
+                                              odd-or-even="even">
+          <xsl:attribute name="master-reference">
+            <xsl:choose>
+              <xsl:when test="$double.sided != 0">titlepage-even</xsl:when>
+              <xsl:otherwise>titlepage-odd</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:conditional-page-master-reference>
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+
+    <!-- setup for lots -->
+    <fo:page-sequence-master master-name="lot">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank"
+                                              blank-or-not-blank="blank"/>
+        <fo:conditional-page-master-reference master-reference="lot-first"
+                                              page-position="first"/>
+        <fo:conditional-page-master-reference master-reference="lot-odd"
+                                              odd-or-even="odd"/>
+        <fo:conditional-page-master-reference 
+                                              odd-or-even="even">
+          <xsl:attribute name="master-reference">
+            <xsl:choose>
+              <xsl:when test="$double.sided != 0">lot-even</xsl:when>
+              <xsl:otherwise>lot-odd</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:conditional-page-master-reference>
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+
+    <!-- setup front matter -->
+    <fo:page-sequence-master master-name="front">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank"
+                                              blank-or-not-blank="blank"/>
+        <fo:conditional-page-master-reference master-reference="front-first"
+                                              page-position="first"/>
+        <fo:conditional-page-master-reference master-reference="front-odd"
+                                              odd-or-even="odd"/>
+        <fo:conditional-page-master-reference 
+                                              odd-or-even="even">
+          <xsl:attribute name="master-reference">
+            <xsl:choose>
+              <xsl:when test="$double.sided != 0">front-even</xsl:when>
+              <xsl:otherwise>front-odd</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:conditional-page-master-reference>
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+
+    <!-- setup for body pages -->
+    <fo:page-sequence-master master-name="body">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank"
+                                              blank-or-not-blank="blank"/>
+        <fo:conditional-page-master-reference master-reference="body-first"
+                                              page-position="first"/>
+        <fo:conditional-page-master-reference master-reference="body-odd"
+                                              odd-or-even="odd"/>
+        <fo:conditional-page-master-reference 
+                                              odd-or-even="even">
+          <xsl:attribute name="master-reference">
+            <xsl:choose>
+              <xsl:when test="$double.sided != 0">body-even</xsl:when>
+              <xsl:otherwise>body-odd</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:conditional-page-master-reference>
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+
+    <!-- setup back matter -->
+    <fo:page-sequence-master master-name="back">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank"
+                                              blank-or-not-blank="blank"/>
+        <fo:conditional-page-master-reference master-reference="back-first"
+                                              page-position="first"/>
+        <fo:conditional-page-master-reference master-reference="back-odd"
+                                              odd-or-even="odd"/>
+        <fo:conditional-page-master-reference 
+                                              odd-or-even="even">
+          <xsl:attribute name="master-reference">
+            <xsl:choose>
+              <xsl:when test="$double.sided != 0">back-even</xsl:when>
+              <xsl:otherwise>back-odd</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:conditional-page-master-reference>
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+
+    <!-- setup back matter -->
+    <fo:page-sequence-master master-name="index">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference master-reference="blank"
+                                              blank-or-not-blank="blank"/>
+        <fo:conditional-page-master-reference master-reference="index-first"
+                                              page-position="first"/>
+        <fo:conditional-page-master-reference master-reference="index-odd"
+                                              odd-or-even="odd"/>
+        <fo:conditional-page-master-reference 
+                                              odd-or-even="even">
+          <xsl:attribute name="master-reference">
+            <xsl:choose>
+              <xsl:when test="$double.sided != 0">index-even</xsl:when>
+              <xsl:otherwise>index-odd</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:conditional-page-master-reference>
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+
+    <xsl:if test="$draft.mode != 'no'">
+      <!-- setup for draft title page(s) -->
+      <fo:page-sequence-master master-name="titlepage-draft">
+        <fo:repeatable-page-master-alternatives>
+          <fo:conditional-page-master-reference master-reference="blank-draft"
+                                                blank-or-not-blank="blank"/>
+          <fo:conditional-page-master-reference master-reference="titlepage-first-draft"
+                                                page-position="first"/>
+          <fo:conditional-page-master-reference master-reference="titlepage-odd-draft"
+                                                odd-or-even="odd"/>
+          <fo:conditional-page-master-reference 
+                                                odd-or-even="even">
+            <xsl:attribute name="master-reference">
+              <xsl:choose>
+                <xsl:when test="$double.sided != 0">titlepage-even-draft</xsl:when>
+                <xsl:otherwise>titlepage-odd-draft</xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </fo:conditional-page-master-reference>
+        </fo:repeatable-page-master-alternatives>
+      </fo:page-sequence-master>
+
+      <!-- setup for draft lots -->
+      <fo:page-sequence-master master-name="lot-draft">
+        <fo:repeatable-page-master-alternatives>
+          <fo:conditional-page-master-reference master-reference="blank-draft"
+                                                blank-or-not-blank="blank"/>
+          <fo:conditional-page-master-reference master-reference="lot-first-draft"
+                                                page-position="first"/>
+          <fo:conditional-page-master-reference master-reference="lot-odd-draft"
+                                                odd-or-even="odd"/>
+          <fo:conditional-page-master-reference 
+                                                odd-or-even="even">
+            <xsl:attribute name="master-reference">
+              <xsl:choose>
+                <xsl:when test="$double.sided != 0">lot-even-draft</xsl:when>
+                <xsl:otherwise>lot-odd-draft</xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </fo:conditional-page-master-reference>
+        </fo:repeatable-page-master-alternatives>
+      </fo:page-sequence-master>
+
+      <!-- setup draft front matter -->
+      <fo:page-sequence-master master-name="front-draft">
+        <fo:repeatable-page-master-alternatives>
+          <fo:conditional-page-master-reference master-reference="blank-draft"
+                                                blank-or-not-blank="blank"/>
+          <fo:conditional-page-master-reference master-reference="front-first-draft"
+                                                page-position="first"/>
+          <fo:conditional-page-master-reference master-reference="front-odd-draft"
+                                                odd-or-even="odd"/>
+          <fo:conditional-page-master-reference 
+                                                odd-or-even="even">
+            <xsl:attribute name="master-reference">
+              <xsl:choose>
+                <xsl:when test="$double.sided != 0">front-even-draft</xsl:when>
+                <xsl:otherwise>front-odd-draft</xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </fo:conditional-page-master-reference>
+        </fo:repeatable-page-master-alternatives>
+      </fo:page-sequence-master>
+
+      <!-- setup for draft body pages -->
+      <fo:page-sequence-master master-name="body-draft">
+        <fo:repeatable-page-master-alternatives>
+          <fo:conditional-page-master-reference master-reference="blank-draft"
+                                                blank-or-not-blank="blank"/>
+          <fo:conditional-page-master-reference master-reference="body-first-draft"
+                                                page-position="first"/>
+          <fo:conditional-page-master-reference master-reference="body-odd-draft"
+                                                odd-or-even="odd"/>
+          <fo:conditional-page-master-reference 
+                                                odd-or-even="even">
+            <xsl:attribute name="master-reference">
+              <xsl:choose>
+                <xsl:when test="$double.sided != 0">body-even-draft</xsl:when>
+                <xsl:otherwise>body-odd-draft</xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </fo:conditional-page-master-reference>
+        </fo:repeatable-page-master-alternatives>
+      </fo:page-sequence-master>
+
+      <!-- setup draft back matter -->
+      <fo:page-sequence-master master-name="back-draft">
+        <fo:repeatable-page-master-alternatives>
+          <fo:conditional-page-master-reference master-reference="blank-draft"
+                                                blank-or-not-blank="blank"/>
+          <fo:conditional-page-master-reference master-reference="back-first-draft"
+                                                page-position="first"/>
+          <fo:conditional-page-master-reference master-reference="back-odd-draft"
+                                                odd-or-even="odd"/>
+          <fo:conditional-page-master-reference 
+                                                odd-or-even="even">
+            <xsl:attribute name="master-reference">
+              <xsl:choose>
+                <xsl:when test="$double.sided != 0">back-even-draft</xsl:when>
+                <xsl:otherwise>back-odd-draft</xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </fo:conditional-page-master-reference>
+        </fo:repeatable-page-master-alternatives>
+      </fo:page-sequence-master>
+
+      <!-- setup draft index pages -->
+      <fo:page-sequence-master master-name="index-draft">
+        <fo:repeatable-page-master-alternatives>
+          <fo:conditional-page-master-reference master-reference="blank-draft"
+                                                blank-or-not-blank="blank"/>
+          <fo:conditional-page-master-reference master-reference="index-first-draft"
+                                                page-position="first"/>
+          <fo:conditional-page-master-reference master-reference="index-odd-draft"
+                                                odd-or-even="odd"/>
+          <fo:conditional-page-master-reference 
+                                                odd-or-even="even">
+            <xsl:attribute name="master-reference">
+              <xsl:choose>
+                <xsl:when test="$double.sided != 0">index-even-draft</xsl:when>
+                <xsl:otherwise>index-odd-draft</xsl:otherwise>
+              </xsl:choose>
+            </xsl:attribute>
+          </fo:conditional-page-master-reference>
+        </fo:repeatable-page-master-alternatives>
+      </fo:page-sequence-master>
+    </xsl:if>
+
+    <xsl:call-template name="user.pagemasters"/>
+
+    </fo:layout-master-set>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="user.pagemasters"/> <!-- intentionally empty -->
+
+<!-- ==================================================================== -->
+
+<xsl:template name="select.pagemaster">
+  <xsl:param name="element" select="local-name(.)"/>
+  <xsl:param name="pageclass" select="''"/>
+
+  <xsl:variable name="pagemaster">
+    <xsl:choose>
+      <xsl:when test="$pageclass != ''">
+        <xsl:value-of select="$pageclass"/>
+      </xsl:when>
+      <xsl:when test="$pageclass = 'lot'">lot</xsl:when>
+      <xsl:when test="$element = 'dedication'">front</xsl:when>
+      <xsl:when test="$element = 'preface'">front</xsl:when>
+      <xsl:when test="$element = 'appendix'">back</xsl:when>
+      <xsl:when test="$element = 'glossary'">back</xsl:when>
+      <xsl:when test="$element = 'bibliography'">back</xsl:when>
+      <xsl:when test="$element = 'index'">index</xsl:when>
+      <xsl:when test="$element = 'colophon'">back</xsl:when>
+      <xsl:otherwise>body</xsl:otherwise>
+    </xsl:choose>
+
+    <xsl:choose>
+      <xsl:when test="$draft.mode = 'yes'">
+        <xsl:text>-draft</xsl:text>
+      </xsl:when>
+      <xsl:when test="$draft.mode = 'no'">
+        <!-- nop -->
+      </xsl:when>
+      <xsl:when test="ancestor-or-self::*[@status][1]/@status = 'draft'">
+        <xsl:text>-draft</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- nop -->
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:call-template name="select.user.pagemaster">
+    <xsl:with-param name="element" select="$element"/>
+    <xsl:with-param name="pageclass" select="$pageclass"/>
+    <xsl:with-param name="default-pagemaster" select="$pagemaster"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="select.user.pagemaster">
+  <xsl:param name="element"/>
+  <xsl:param name="pageclass"/>
+  <xsl:param name="default-pagemaster"/>
+
+  <!-- by default, return the default. But if you've created your own
+       pagemasters in user.pagemasters, you might want to select one here. -->
+  <xsl:value-of select="$default-pagemaster"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="head.sep.rule">
+  <xsl:param name="pageclass"/>
+  <xsl:param name="sequence"/>
+  <xsl:param name="gentext-key"/>
+
+  <xsl:if test="$header.rule != 0">
+    <xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute>
+    <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+    <xsl:attribute name="border-bottom-color">black</xsl:attribute>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="foot.sep.rule">
+  <xsl:param name="pageclass"/>
+  <xsl:param name="sequence"/>
+  <xsl:param name="gentext-key"/>
+
+  <xsl:if test="$footer.rule != 0">
+    <xsl:attribute name="border-top-width">0.5pt</xsl:attribute>
+    <xsl:attribute name="border-top-style">solid</xsl:attribute>
+    <xsl:attribute name="border-top-color">black</xsl:attribute>
+  </xsl:if>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="running.head.mode">
+  <xsl:param name="master-reference" select="'unknown'"/>
+  <xsl:param name="gentext-key" select="local-name(.)"/>
+
+  <!-- remove -draft from reference -->
+  <xsl:variable name="pageclass">
+    <xsl:choose>
+      <xsl:when test="contains($master-reference, '-draft')">
+        <xsl:value-of select="substring-before($master-reference, '-draft')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$master-reference"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:static-content flow-name="xsl-region-before-first">
+    <fo:block xsl:use-attribute-sets="header.content.properties">
+      <xsl:call-template name="header.table">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="'first'"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+    </fo:block>
+  </fo:static-content>
+
+  <fo:static-content flow-name="xsl-region-before-odd">
+    <fo:block xsl:use-attribute-sets="header.content.properties">
+      <xsl:call-template name="header.table">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="'odd'"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+    </fo:block>
+  </fo:static-content>
+
+  <fo:static-content flow-name="xsl-region-before-even">
+    <fo:block xsl:use-attribute-sets="header.content.properties">
+      <xsl:call-template name="header.table">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="'even'"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+    </fo:block>
+  </fo:static-content>
+
+  <fo:static-content flow-name="xsl-region-before-blank">
+    <fo:block xsl:use-attribute-sets="header.content.properties">
+      <xsl:call-template name="header.table">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="'blank'"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+    </fo:block>
+  </fo:static-content>
+
+  <xsl:call-template name="footnote-separator"/>
+
+  <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
+    <xsl:call-template name="blank.page.content"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="footnote-separator">
+  <fo:static-content flow-name="xsl-footnote-separator">
+    <fo:block>
+      <fo:leader xsl:use-attribute-sets="footnote.sep.leader.properties"/>
+    </fo:block>
+  </fo:static-content>
+</xsl:template>
+
+<xsl:template name="blank.page.content">
+  <fo:static-content flow-name="blank-body">
+    <fo:block text-align="center"/>
+  </fo:static-content>
+</xsl:template>
+
+<xsl:template name="header.table">
+  <xsl:param name="pageclass" select="''"/>
+  <xsl:param name="sequence" select="''"/>
+  <xsl:param name="gentext-key" select="''"/>
+
+  <!-- default is a single table style for all headers -->
+  <!-- Customize it for different page classes or sequence location -->
+
+  <xsl:choose>
+      <xsl:when test="$pageclass = 'index'">
+          <xsl:attribute name="margin-left">0pt</xsl:attribute>
+      </xsl:when>
+  </xsl:choose>
+
+  <xsl:variable name="column1">
+    <xsl:choose>
+      <xsl:when test="$double.sided = 0">1</xsl:when>
+      <xsl:when test="$sequence = 'first' or $sequence = 'odd'">1</xsl:when>
+      <xsl:otherwise>3</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="column3">
+    <xsl:choose>
+      <xsl:when test="$double.sided = 0">3</xsl:when>
+      <xsl:when test="$sequence = 'first' or $sequence = 'odd'">3</xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="candidate">
+    <fo:table xsl:use-attribute-sets="header.table.properties">
+      <xsl:call-template name="head.sep.rule">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="$sequence"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+
+      <fo:table-column column-number="1">
+        <xsl:attribute name="column-width">
+          <xsl:text>proportional-column-width(</xsl:text>
+          <xsl:call-template name="header.footer.width">
+            <xsl:with-param name="location">header</xsl:with-param>
+            <xsl:with-param name="position" select="$column1"/>
+          </xsl:call-template>
+          <xsl:text>)</xsl:text>
+        </xsl:attribute>
+      </fo:table-column>
+      <fo:table-column column-number="2">
+        <xsl:attribute name="column-width">
+          <xsl:text>proportional-column-width(</xsl:text>
+          <xsl:call-template name="header.footer.width">
+            <xsl:with-param name="location">header</xsl:with-param>
+            <xsl:with-param name="position" select="2"/>
+          </xsl:call-template>
+          <xsl:text>)</xsl:text>
+        </xsl:attribute>
+      </fo:table-column>
+      <fo:table-column column-number="3">
+        <xsl:attribute name="column-width">
+          <xsl:text>proportional-column-width(</xsl:text>
+          <xsl:call-template name="header.footer.width">
+            <xsl:with-param name="location">header</xsl:with-param>
+            <xsl:with-param name="position" select="$column3"/>
+          </xsl:call-template>
+          <xsl:text>)</xsl:text>
+        </xsl:attribute>
+      </fo:table-column>
+
+      <fo:table-body>
+        <fo:table-row>
+          <xsl:attribute name="block-progression-dimension.minimum">
+            <xsl:value-of select="$header.table.height"/>
+          </xsl:attribute>
+          <fo:table-cell text-align="left"
+                         display-align="before">
+            <xsl:if test="$fop.extensions = 0">
+              <xsl:attribute name="relative-align">baseline</xsl:attribute>
+            </xsl:if>
+            <fo:block>
+              <xsl:call-template name="header.content">
+                <xsl:with-param name="pageclass" select="$pageclass"/>
+                <xsl:with-param name="sequence" select="$sequence"/>
+                <xsl:with-param name="position" select="'left'"/>
+                <xsl:with-param name="gentext-key" select="$gentext-key"/>
+              </xsl:call-template>
+            </fo:block>
+          </fo:table-cell>
+          <fo:table-cell text-align="center"
+                         display-align="before">
+            <xsl:if test="$fop.extensions = 0">
+              <xsl:attribute name="relative-align">baseline</xsl:attribute>
+            </xsl:if>
+            <fo:block>
+              <xsl:call-template name="header.content">
+                <xsl:with-param name="pageclass" select="$pageclass"/>
+                <xsl:with-param name="sequence" select="$sequence"/>
+                <xsl:with-param name="position" select="'center'"/>
+                <xsl:with-param name="gentext-key" select="$gentext-key"/>
+              </xsl:call-template>
+            </fo:block>
+          </fo:table-cell>
+          <fo:table-cell text-align="right"
+                         display-align="before">
+            <xsl:if test="$fop.extensions = 0">
+              <xsl:attribute name="relative-align">baseline</xsl:attribute>
+            </xsl:if>
+            <fo:block>
+              <xsl:call-template name="header.content">
+                <xsl:with-param name="pageclass" select="$pageclass"/>
+                <xsl:with-param name="sequence" select="$sequence"/>
+                <xsl:with-param name="position" select="'right'"/>
+                <xsl:with-param name="gentext-key" select="$gentext-key"/>
+              </xsl:call-template>
+            </fo:block>
+          </fo:table-cell>
+        </fo:table-row>
+      </fo:table-body>
+    </fo:table>
+  </xsl:variable>
+
+  <!-- Really output a header? -->
+  <xsl:choose>
+    <xsl:when test="$pageclass = 'titlepage' and $gentext-key = 'book'
+                    and $sequence='first'">
+      <!-- no, book titlepages have no headers at all -->
+    </xsl:when>
+    <xsl:when test="$sequence = 'blank' and $headers.on.blank.pages = 0">
+      <!-- no output -->
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$candidate"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="header.content">
+  <xsl:param name="pageclass" select="''"/>
+  <xsl:param name="sequence" select="''"/>
+  <xsl:param name="position" select="''"/>
+  <xsl:param name="gentext-key" select="''"/>
+
+<!--
+  <fo:block>
+    <xsl:value-of select="$pageclass"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$sequence"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$position"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$gentext-key"/>
+  </fo:block>
+-->
+
+  <fo:block>
+
+    <!-- sequence can be odd, even, first, blank -->
+    <!-- position can be left, center, right -->
+    <xsl:choose>
+      <xsl:when test="$sequence = 'blank'">
+        <!-- nothing -->
+      </xsl:when>
+
+      <xsl:when test="$position='left'">
+        <!-- Same for odd, even, empty, and blank sequences -->
+        <xsl:call-template name="draft.text"/>
+      </xsl:when>
+
+      <xsl:when test="($sequence='odd' or $sequence='even') and $position='center'">
+        <xsl:if test="$pageclass != 'titlepage'">
+          <xsl:choose>
+            <xsl:when test="ancestor::book and ($double.sided != 0)">
+              <fo:retrieve-marker retrieve-class-name="section.head.marker"
+                                  retrieve-position="first-including-carryover"
+                                  retrieve-boundary="page-sequence"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:if>
+      </xsl:when>
+
+      <xsl:when test="$position='center'">
+        <!-- nothing for empty and blank sequences -->
+      </xsl:when>
+
+      <xsl:when test="$position='right'">
+        <!-- Same for odd, even, empty, and blank sequences -->
+        <xsl:call-template name="draft.text"/>
+      </xsl:when>
+
+      <xsl:when test="$sequence = 'first'">
+        <!-- nothing for first pages -->
+      </xsl:when>
+
+      <xsl:when test="$sequence = 'blank'">
+        <!-- nothing for blank pages -->
+      </xsl:when>
+    </xsl:choose>
+  </fo:block>
+</xsl:template>
+
+<xsl:template name="header.footer.width">
+  <xsl:param name="location" select="'header'"/>
+  <xsl:param name="position" select="1"/>
+
+  <xsl:variable name="width.set">
+    <xsl:choose>
+      <xsl:when test="$location = 'header'">
+        <xsl:value-of select="normalize-space($header.column.widths)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="normalize-space($footer.column.widths)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+
+  <xsl:variable name="width">
+    <xsl:choose>
+      <xsl:when test="$position = 1">
+        <xsl:value-of select="substring-before($width.set, ' ')"/>
+      </xsl:when>
+      <xsl:when test="$position = 2">
+        <xsl:value-of select="substring-before(substring-after($width.set, ' '), ' ')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="substring-after(substring-after($width.set, ' '), ' ')"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <!-- Make sure it is a number -->
+  <xsl:choose>
+    <xsl:when test = "$width = number($width)">
+      <xsl:value-of select="$width"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>Error: value in <xsl:value-of select="$location"/>.column.widths at position <xsl:value-of select="$position"/> is not a number.</xsl:message>
+      <xsl:text>1</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="draft.text">
+  <xsl:choose>
+    <xsl:when test="$draft.mode = 'yes'">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Draft'"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$draft.mode = 'no'">
+      <!-- nop -->
+    </xsl:when>
+    <xsl:when test="ancestor-or-self::*[@status][1]/@status = 'draft'">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Draft'"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- nop -->
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="running.foot.mode">
+  <xsl:param name="master-reference" select="'unknown'"/>
+  <xsl:param name="gentext-key" select="local-name(.)"/>
+
+  <!-- remove -draft from reference -->
+  <xsl:variable name="pageclass">
+    <xsl:choose>
+      <xsl:when test="contains($master-reference, '-draft')">
+        <xsl:value-of select="substring-before($master-reference, '-draft')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$master-reference"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:static-content flow-name="xsl-region-after-first">
+    <fo:block xsl:use-attribute-sets="footer.content.properties">
+      <xsl:call-template name="footer.table">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="'first'"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+    </fo:block>
+  </fo:static-content>
+
+  <fo:static-content flow-name="xsl-region-after-odd">
+    <fo:block xsl:use-attribute-sets="footer.content.properties">
+      <xsl:call-template name="footer.table">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="'odd'"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+    </fo:block>
+  </fo:static-content>
+
+  <fo:static-content flow-name="xsl-region-after-even">
+    <fo:block xsl:use-attribute-sets="footer.content.properties">
+      <xsl:call-template name="footer.table">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="'even'"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+    </fo:block>
+  </fo:static-content>
+
+  <fo:static-content flow-name="xsl-region-after-blank">
+    <fo:block xsl:use-attribute-sets="footer.content.properties">
+      <xsl:call-template name="footer.table">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="'blank'"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+    </fo:block>
+  </fo:static-content>
+</xsl:template>
+
+<xsl:template name="footer.table">
+  <xsl:param name="pageclass" select="''"/>
+  <xsl:param name="sequence" select="''"/>
+  <xsl:param name="gentext-key" select="''"/>
+
+  <!-- default is a single table style for all footers -->
+  <!-- Customize it for different page classes or sequence location -->
+
+  <xsl:choose>
+      <xsl:when test="$pageclass = 'index'">
+          <xsl:attribute name="margin-left">0pt</xsl:attribute>
+      </xsl:when>
+  </xsl:choose>
+
+  <xsl:variable name="column1">
+    <xsl:choose>
+      <xsl:when test="$double.sided = 0">1</xsl:when>
+      <xsl:when test="$sequence = 'first' or $sequence = 'odd'">1</xsl:when>
+      <xsl:otherwise>3</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="column3">
+    <xsl:choose>
+      <xsl:when test="$double.sided = 0">3</xsl:when>
+      <xsl:when test="$sequence = 'first' or $sequence = 'odd'">3</xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="candidate">
+    <fo:table xsl:use-attribute-sets="footer.table.properties">
+      <xsl:call-template name="foot.sep.rule">
+        <xsl:with-param name="pageclass" select="$pageclass"/>
+        <xsl:with-param name="sequence" select="$sequence"/>
+        <xsl:with-param name="gentext-key" select="$gentext-key"/>
+      </xsl:call-template>
+      <fo:table-column column-number="1">
+        <xsl:attribute name="column-width">
+          <xsl:text>proportional-column-width(</xsl:text>
+          <xsl:call-template name="header.footer.width">
+            <xsl:with-param name="location">footer</xsl:with-param>
+            <xsl:with-param name="position" select="$column1"/>
+          </xsl:call-template>
+          <xsl:text>)</xsl:text>
+        </xsl:attribute>
+      </fo:table-column>
+      <fo:table-column column-number="2">
+        <xsl:attribute name="column-width">
+          <xsl:text>proportional-column-width(</xsl:text>
+          <xsl:call-template name="header.footer.width">
+            <xsl:with-param name="location">footer</xsl:with-param>
+            <xsl:with-param name="position" select="2"/>
+          </xsl:call-template>
+          <xsl:text>)</xsl:text>
+        </xsl:attribute>
+      </fo:table-column>
+      <fo:table-column column-number="3">
+        <xsl:attribute name="column-width">
+          <xsl:text>proportional-column-width(</xsl:text>
+          <xsl:call-template name="header.footer.width">
+            <xsl:with-param name="location">footer</xsl:with-param>
+            <xsl:with-param name="position" select="$column3"/>
+          </xsl:call-template>
+          <xsl:text>)</xsl:text>
+        </xsl:attribute>
+      </fo:table-column>
+
+      <fo:table-body>
+        <fo:table-row>
+          <xsl:attribute name="block-progression-dimension.minimum">
+            <xsl:value-of select="$footer.table.height"/>
+          </xsl:attribute>
+          <fo:table-cell text-align="left"
+                         display-align="after">
+            <xsl:if test="$fop.extensions = 0">
+              <xsl:attribute name="relative-align">baseline</xsl:attribute>
+            </xsl:if>
+            <fo:block>
+              <xsl:call-template name="footer.content">
+                <xsl:with-param name="pageclass" select="$pageclass"/>
+                <xsl:with-param name="sequence" select="$sequence"/>
+                <xsl:with-param name="position" select="'left'"/>
+                <xsl:with-param name="gentext-key" select="$gentext-key"/>
+              </xsl:call-template>
+            </fo:block>
+          </fo:table-cell>
+          <fo:table-cell text-align="center"
+                         display-align="after">
+            <xsl:if test="$fop.extensions = 0">
+              <xsl:attribute name="relative-align">baseline</xsl:attribute>
+            </xsl:if>
+            <fo:block>
+              <xsl:call-template name="footer.content">
+                <xsl:with-param name="pageclass" select="$pageclass"/>
+                <xsl:with-param name="sequence" select="$sequence"/>
+                <xsl:with-param name="position" select="'center'"/>
+                <xsl:with-param name="gentext-key" select="$gentext-key"/>
+              </xsl:call-template>
+            </fo:block>
+          </fo:table-cell>
+          <fo:table-cell text-align="right"
+                         display-align="after">
+            <xsl:if test="$fop.extensions = 0">
+              <xsl:attribute name="relative-align">baseline</xsl:attribute>
+            </xsl:if>
+            <fo:block>
+              <xsl:call-template name="footer.content">
+                <xsl:with-param name="pageclass" select="$pageclass"/>
+                <xsl:with-param name="sequence" select="$sequence"/>
+                <xsl:with-param name="position" select="'right'"/>
+                <xsl:with-param name="gentext-key" select="$gentext-key"/>
+              </xsl:call-template>
+            </fo:block>
+          </fo:table-cell>
+        </fo:table-row>
+      </fo:table-body>
+    </fo:table>
+  </xsl:variable>
+
+  <!-- Really output a footer? -->
+  <xsl:choose>
+    <xsl:when test="$pageclass='titlepage' and $gentext-key='book'
+                    and $sequence='first'">
+      <!-- no, book titlepages have no footers at all -->
+    </xsl:when>
+    <xsl:when test="$sequence = 'blank' and $footers.on.blank.pages = 0">
+      <!-- no output -->
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$candidate"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="footer.content">
+  <xsl:param name="pageclass" select="''"/>
+  <xsl:param name="sequence" select="''"/>
+  <xsl:param name="position" select="''"/>
+  <xsl:param name="gentext-key" select="''"/>
+
+<!--
+  <fo:block>
+    <xsl:value-of select="$pageclass"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$sequence"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$position"/>
+    <xsl:text>, </xsl:text>
+    <xsl:value-of select="$gentext-key"/>
+  </fo:block>
+-->
+
+  <fo:block>
+    <!-- pageclass can be front, body, back -->
+    <!-- sequence can be odd, even, first, blank -->
+    <!-- position can be left, center, right -->
+    <xsl:choose>
+      <xsl:when test="$pageclass = 'titlepage'">
+        <!-- nop; no footer on title pages -->
+      </xsl:when>
+
+      <xsl:when test="$double.sided != 0 and $sequence = 'even'
+                      and $position='left'">
+        <fo:page-number/>
+      </xsl:when>
+
+      <xsl:when test="$double.sided != 0 and ($sequence = 'odd' or $sequence = 'first')
+                      and $position='right'">
+        <fo:page-number/>
+      </xsl:when>
+
+      <xsl:when test="$double.sided = 0 and $position='center'">
+        <fo:page-number/>
+      </xsl:when>
+
+      <xsl:when test="$sequence='blank'">
+        <xsl:choose>
+          <xsl:when test="$double.sided != 0 and $position = 'left'">
+            <fo:page-number/>
+          </xsl:when>
+          <xsl:when test="$double.sided = 0 and $position = 'center'">
+            <fo:page-number/>
+          </xsl:when>
+          <xsl:otherwise>
+            <!-- nop -->
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+
+
+      <xsl:otherwise>
+        <!-- nop -->
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="page.number.format">
+  <xsl:param name="element" select="local-name(.)"/>
+  <xsl:param name="master-reference" select="''"/>
+
+  <xsl:choose>
+    <xsl:when test="$element = 'toc' and self::book">i</xsl:when>
+    <xsl:when test="$element = 'preface'">i</xsl:when>
+    <xsl:when test="$element = 'dedication'">i</xsl:when>
+    <xsl:otherwise>1</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="initial.page.number">
+  <xsl:param name="element" select="local-name(.)"/>
+  <xsl:param name="master-reference" select="''"/>
+
+  <!-- Select the first content that the stylesheet places
+       after the TOC -->
+  <xsl:variable name="first.book.content" 
+                select="ancestor::book/*[
+                          not(self::title or
+                              self::subtitle or
+                              self::titleabbrev or
+                              self::bookinfo or
+                              self::info or
+                              self::dedication or
+                              self::preface or
+                              self::toc or
+                              self::lot)][1]"/>
+  <xsl:choose>
+    <!-- double-sided output -->
+    <xsl:when test="$double.sided != 0">
+      <xsl:choose>
+        <xsl:when test="$element = 'toc'">auto-odd</xsl:when>
+        <xsl:when test="$element = 'book'">1</xsl:when>
+        <!-- preface typically continues TOC roman numerals -->
+        <!-- Change page.number.format if not -->
+        <xsl:when test="$element = 'preface'">auto-odd</xsl:when>
+        <xsl:when test="($element = 'dedication' or $element = 'article') 
+                    and not(preceding::chapter
+                            or preceding::preface
+                            or preceding::appendix
+                            or preceding::article
+                            or preceding::dedication
+                            or parent::part
+                            or parent::reference)">1</xsl:when>
+        <xsl:when test="generate-id($first.book.content) =
+                        generate-id(.)">1</xsl:when>
+        <xsl:otherwise>auto-odd</xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+
+    <!-- single-sided output -->
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$element = 'toc'">auto</xsl:when>
+        <xsl:when test="$element = 'book'">1</xsl:when>
+        <xsl:when test="$element = 'preface'">auto</xsl:when>
+       <xsl:when test="($element = 'dedication' or $element = 'article') and
+                        not(preceding::chapter
+                            or preceding::preface
+                            or preceding::appendix
+                            or preceding::article
+                            or preceding::dedication
+                            or parent::part
+                            or parent::reference)">1</xsl:when>
+        <xsl:when test="generate-id($first.book.content) =
+                        generate-id(.)">1</xsl:when>
+        <xsl:otherwise>auto</xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="force.page.count">
+  <xsl:param name="element" select="local-name(.)"/>
+  <xsl:param name="master-reference" select="''"/>
+
+  <xsl:choose>
+    <!-- double-sided output -->
+    <xsl:when test="$double.sided != 0">end-on-even</xsl:when>
+    <!-- single-sided output -->
+    <xsl:otherwise>no-force</xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="set.flow.properties">
+  <xsl:param name="element" select="local-name(.)"/>
+  <xsl:param name="master-reference" select="''"/>
+
+  <!-- This template is called after each <fo:flow> starts. -->
+  <!-- Customize this template to set attributes on fo:flow -->
+
+  <!-- remove -draft from reference -->
+  <xsl:variable name="pageclass">
+    <xsl:choose>
+      <xsl:when test="contains($master-reference, '-draft')">
+        <xsl:value-of select="substring-before($master-reference, '-draft')"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$master-reference"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$fop.extensions != 0 or $passivetex.extensions != 0">
+      <!-- body.start.indent does not work well with these processors -->
+    </xsl:when>
+    <xsl:when test="starts-with($pageclass, 'body') or
+                    starts-with($pageclass, 'lot') or
+                    starts-with($pageclass, 'front') or
+                    $element = 'preface' or
+                    (starts-with($pageclass, 'back') and
+                    $element = 'appendix')">
+      <xsl:attribute name="start-indent">
+        <xsl:value-of select="$body.start.indent"/>
+      </xsl:attribute>
+      <xsl:attribute name="end-indent">
+        <xsl:value-of select="$body.end.indent"/>
+      </xsl:attribute>
+    </xsl:when>
+  </xsl:choose>
+
+</xsl:template>
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 886 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/param.xsl

@@ -0,0 +1,886 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!-- This file is generated from param.xweb -->
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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:attribute-set name="abstract.properties">
+  <xsl:attribute name="start-indent">0.0in</xsl:attribute>
+  <xsl:attribute name="end-indent">0.0in</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="abstract.title.properties">
+  <xsl:attribute name="font-family"><xsl:value-of select="$title.fontset"/></xsl:attribute>
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+  <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master, 'pt')"/></xsl:attribute>
+  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master, 'pt * 0.8')"/></xsl:attribute>
+  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master, 'pt * 1.2')"/></xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="text-align">center</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="admon.graphics.extension" select="'.png'"/>
+<xsl:param name="admon.graphics" select="0"/>
+<xsl:param name="admon.graphics.path">images/</xsl:param>
+<xsl:param name="admon.textlabel" select="1"/>
+<xsl:attribute-set name="admonition.properties"/>
+<xsl:attribute-set name="admonition.title.properties">
+  <xsl:attribute name="font-size">14pt</xsl:attribute>
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="graphical.admonition.properties">
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">1.2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="nongraphical.admonition.properties">
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+  <xsl:attribute name="margin-left">0.25in</xsl:attribute>
+  <xsl:attribute name="margin-right">0.25in</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="alignment">justify</xsl:param>
+<xsl:param name="appendix.autolabel" select="'A'"/>
+<xsl:param name="arbortext.extensions" select="0"/>
+<xsl:attribute-set name="article.appendix.title.properties" use-attribute-sets="section.title.properties                          section.title.level1.properties">
+  <xsl:attribute name="margin-left">
+    <xsl:value-of select="$title.margin.left"/>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="author.othername.in.middle" select="1"/>
+<xsl:param name="autotoc.label.separator" select="'. '"/>
+<xsl:param name="axf.extensions" select="0"/>
+<xsl:param name="biblioentry.item.separator">. </xsl:param>
+<xsl:attribute-set name="biblioentry.properties" use-attribute-sets="normal.para.spacing">
+  <xsl:attribute name="start-indent">0.5in</xsl:attribute>
+  <xsl:attribute name="text-indent">-0.5in</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="bibliography.collection" select="'http://docbook.sourceforge.net/release/bibliography/bibliography.xml'"/>
+<xsl:param name="bibliography.numbered" select="0"/>
+<xsl:param name="bibliography.style" select="'normal'"/>
+<xsl:attribute-set name="blockquote.properties">
+<xsl:attribute name="margin-left">0.5in</xsl:attribute>
+<xsl:attribute name="margin-right">0.5in</xsl:attribute>
+<xsl:attribute name="space-after.minimum">0.5em</xsl:attribute>
+<xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+<xsl:attribute name="space-after.maximum">2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="body.font.family" select="'serif'"/>
+<xsl:param name="body.font.master">10</xsl:param>
+<xsl:param name="body.font.size">
+ <xsl:value-of select="$body.font.master"/><xsl:text>pt</xsl:text>
+</xsl:param>
+<xsl:param name="body.margin.bottom" select="'0.5in'"/>
+<xsl:param name="body.margin.top" select="'0.5in'"/>
+<xsl:param name="body.start.indent">
+  <xsl:choose>
+    <xsl:when test="$fop.extensions != 0">0pt</xsl:when>
+    <xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
+    <xsl:otherwise>4pc</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="body.end.indent" select="'0pt'"/>
+<xsl:param name="bridgehead.in.toc" select="0"/>
+<xsl:param name="callout.defaultcolumn" select="'60'"/>
+
+<xsl:param name="callout.graphics.extension" select="'.svg'"/>
+<xsl:param name="callout.graphics" select="'1'"/>
+<xsl:param name="callout.icon.size">7pt</xsl:param>
+
+<xsl:param name="callout.graphics.number.limit" select="'30'"/>
+<xsl:param name="callout.graphics.path" select="'images/callouts/'"/>
+<xsl:param name="callout.unicode.font" select="'ZapfDingbats'"/>
+<xsl:param name="callout.unicode" select="0"/>
+<xsl:param name="callout.unicode.number.limit" select="'10'"/>
+<xsl:param name="callout.unicode.start.character" select="10102"/>
+<xsl:param name="callouts.extension" select="'1'"/>
+<xsl:param name="chapter.autolabel" select="1"/>
+<xsl:param name="collect.xref.targets" select="'no'"/>
+<xsl:param name="column.count.back" select="1"/>
+<xsl:param name="column.count.body" select="1"/>
+<xsl:param name="column.count.front" select="1"/>
+<xsl:param name="column.count.index" select="2"/>
+<xsl:param name="column.count.lot" select="1"/>
+<xsl:param name="column.count.titlepage" select="1"/>
+<xsl:param name="column.gap.back" select="'12pt'"/>
+<xsl:param name="column.gap.body" select="'12pt'"/>
+<xsl:param name="column.gap.front" select="'12pt'"/>
+<xsl:param name="column.gap.index" select="'12pt'"/>
+<xsl:param name="column.gap.lot" select="'12pt'"/>
+<xsl:param name="column.gap.titlepage" select="'12pt'"/>
+<xsl:attribute-set name="compact.list.item.spacing">
+  <xsl:attribute name="space-before.optimum">0em</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">0.2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="component.label.includes.part.label" select="0"/>
+<xsl:attribute-set name="component.title.properties">
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+  <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master, 'pt')"/></xsl:attribute>
+  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master, 'pt * 0.8')"/></xsl:attribute>
+  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master, 'pt * 1.2')"/></xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="text-align">
+    <xsl:choose>
+      <xsl:when test="((parent::article | parent::articleinfo | parent::info/parent::article) and not(ancestor::book) and not(self::bibliography))         or (parent::slides | parent::slidesinfo)">center</xsl:when>
+      <xsl:otherwise>left</xsl:otherwise>
+    </xsl:choose>
+  </xsl:attribute>
+  <xsl:attribute name="start-indent"><xsl:value-of select="$title.margin.left"/></xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="component.titlepage.properties">
+</xsl:attribute-set>
+<xsl:param name="crop.marks" select="0"/>
+<xsl:param name="crop.mark.width" select="'0.5pt'"/>
+<xsl:param name="crop.mark.offset" select="'24pt'"/>
+<xsl:param name="crop.mark.bleed" select="'6pt'"/>
+<xsl:param name="current.docid" select="''"/> 
+<xsl:param name="default.float.class">
+  <xsl:choose>
+    <xsl:when test="contains($stylesheet.result.type,'html')">left</xsl:when>
+    <xsl:otherwise>before</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="default.image.width" select="''"/>
+<xsl:param name="default.table.width" select="''"/>
+<xsl:param name="default.table.frame" select="'all'"/>
+<xsl:param name="default.units" select="'pt'"/>
+<xsl:param name="dingbat.font.family" select="'serif'"/>
+<xsl:param name="double.sided" select="0"/>
+<xsl:param name="draft.mode" select="'maybe'"/>
+<xsl:param name="draft.watermark.image" select="'http://docbook.sourceforge.net/release/images/draft.png'"/>
+
+<xsl:param name="ebnf.assignment">
+  <fo:inline xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="{$monospace.font.family}">
+    <xsl:text>::=</xsl:text>
+  </fo:inline>
+</xsl:param>
+
+<xsl:param name="ebnf.statement.terminator"/>
+<xsl:param name="email.delimiters.enabled">1</xsl:param>
+<xsl:attribute-set name="equation.properties" use-attribute-sets="formal.object.properties"/>
+<xsl:attribute-set name="example.properties" use-attribute-sets="formal.object.properties"/>
+<xsl:attribute-set name="figure.properties" use-attribute-sets="formal.object.properties"/>
+<xsl:param name="firstterm.only.link" select="0"/>
+<xsl:attribute-set name="footer.content.properties">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$body.fontset"/>
+  </xsl:attribute>
+  <xsl:attribute name="margin-left">
+    <xsl:value-of select="$title.margin.left"/>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="footer.rule" select="1"/>
+<xsl:param name="footer.column.widths" select="'1 1 1'"/>
+<xsl:param name="footer.table.height" select="'14pt'"/>
+<xsl:attribute-set name="footer.table.properties">
+  <xsl:attribute name="table-layout">fixed</xsl:attribute>
+  <xsl:attribute name="width">100%</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="footers.on.blank.pages" select="1"/>
+<xsl:param name="footnote.font.size">
+ <xsl:value-of select="$body.font.master * 0.8"/><xsl:text>pt</xsl:text>
+</xsl:param>
+<xsl:param name="footnote.number.format" select="'1'"/>
+<xsl:param name="footnote.number.symbols" select="''"/>
+<xsl:attribute-set name="footnote.mark.properties">
+  <xsl:attribute name="font-size">75%</xsl:attribute>
+  <xsl:attribute name="font-weight">normal</xsl:attribute>
+  <xsl:attribute name="font-style">normal</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="footnote.properties">
+  <xsl:attribute name="font-family"><xsl:value-of select="$body.fontset"/></xsl:attribute>
+  <xsl:attribute name="font-size"><xsl:value-of select="$footnote.font.size"/></xsl:attribute>
+  <xsl:attribute name="font-weight">normal</xsl:attribute>
+  <xsl:attribute name="font-style">normal</xsl:attribute>
+  <xsl:attribute name="text-align"><xsl:value-of select="$alignment"/></xsl:attribute>
+  <xsl:attribute name="start-indent">0pt</xsl:attribute>
+  <xsl:attribute name="text-indent">0pt</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="footnote.sep.leader.properties">
+  <xsl:attribute name="color">black</xsl:attribute>
+  <xsl:attribute name="leader-pattern">rule</xsl:attribute>
+  <xsl:attribute name="leader-length">1in</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="fop.extensions" select="0"/>
+<xsl:param name="fop1.extensions" select="0"/>
+<xsl:attribute-set name="formal.object.properties">
+  <xsl:attribute name="space-before.minimum">0.5em</xsl:attribute>
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">2em</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0.5em</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">2em</xsl:attribute>
+  <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="formal.procedures" select="1"/>
+<xsl:param name="formal.title.placement">
+figure before
+example before
+equation before
+table before
+procedure before
+task before
+</xsl:param>
+<xsl:attribute-set name="formal.title.properties" use-attribute-sets="normal.para.spacing">
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 1.2"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="funcsynopsis.decoration" select="1"/>
+<xsl:param name="funcsynopsis.style">kr</xsl:param>
+<xsl:param name="function.parens">0</xsl:param>
+<xsl:param name="generate.index" select="1"/>
+<xsl:param name="generate.section.toc.level" select="0"/>
+
+<xsl:param name="generate.toc">
+/appendix toc,title
+article/appendix  nop
+/article  toc,title
+book      toc,title,figure,table,example,equation
+/chapter  toc,title
+part      toc,title
+/preface  toc,title
+reference toc,title
+/sect1    toc
+/sect2    toc
+/sect3    toc
+/sect4    toc
+/sect5    toc
+/section  toc
+set       toc,title
+</xsl:param>
+<xsl:param name="glossary.as.blocks" select="0"/>
+<xsl:param name="glossary.collection" select="''"/>
+<xsl:param name="glossary.sort" select="0"/>
+<xsl:param name="glossentry.show.acronym" select="'no'"/>
+<xsl:param name="glosslist.as.blocks" select="0"/>
+<xsl:param name="glossterm.auto.link" select="0"/>
+<xsl:param name="glossterm.separation" select="'0.25in'"/>
+<xsl:param name="glossterm.width" select="'2in'"/>
+<xsl:param name="graphic.default.extension"/>
+<xsl:attribute-set name="header.content.properties">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$body.fontset"/>
+  </xsl:attribute>
+  <xsl:attribute name="margin-left">
+    <xsl:value-of select="$title.margin.left"/>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="header.rule" select="1"/>
+<xsl:param name="header.column.widths" select="'1 1 1'"/>
+<xsl:param name="header.table.height" select="'14pt'"/>
+<xsl:attribute-set name="header.table.properties">
+  <xsl:attribute name="table-layout">fixed</xsl:attribute>
+  <xsl:attribute name="width">100%</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="headers.on.blank.pages" select="1"/>
+<xsl:param name="highlight.default.language" select="''"/>
+<xsl:param name="highlight.source" select="0"/>
+<xsl:param name="hyphenate">true</xsl:param>
+<xsl:param name="hyphenate.verbatim" select="0"/>
+<xsl:param name="hyphenate.verbatim.characters" select="''"/>
+<xsl:param name="ignore.image.scaling" select="0"/>
+<xsl:param name="img.src.path"/>
+<xsl:param name="index.method" select="'basic'"/>
+<xsl:param name="index.on.role" select="0"/>
+<xsl:param name="index.on.type" select="0"/>
+<xsl:attribute-set name="index.page.number.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="informalequation.properties" use-attribute-sets="informal.object.properties"/>
+<xsl:attribute-set name="informalexample.properties" use-attribute-sets="informal.object.properties"/>
+<xsl:attribute-set name="informalfigure.properties" use-attribute-sets="informal.object.properties"/>
+<xsl:attribute-set name="informal.object.properties">
+  <xsl:attribute name="space-before.minimum">0.5em</xsl:attribute>
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">2em</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0.5em</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="informaltable.properties" use-attribute-sets="informal.object.properties"/>
+<xsl:attribute-set name="index.preferred.page.properties">
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="index.div.title.properties">
+  <xsl:attribute name="margin-left">0pt</xsl:attribute>
+  <xsl:attribute name="font-size">14.4pt</xsl:attribute>
+  <xsl:attribute name="font-family"><xsl:value-of select="$title.fontset"/></xsl:attribute>
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+  <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master,'pt')"/></xsl:attribute>
+  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master,'pt * 0.8')"/></xsl:attribute>
+  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master,'pt * 1.2')"/></xsl:attribute>
+  <xsl:attribute name="start-indent">0pt</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="index.entry.properties">
+  <xsl:attribute name="start-indent">0pt</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="index.number.separator" select="''"/>
+<xsl:param name="index.range.separator" select="''"/>
+<xsl:param name="index.term.separator" select="''"/>
+<xsl:param name="insert.link.page.number">no</xsl:param>
+<xsl:param name="insert.xref.page.number">no</xsl:param>
+<xsl:attribute-set name="itemizedlist.properties" use-attribute-sets="list.block.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="itemizedlist.label.properties">
+</xsl:attribute-set>
+<xsl:param name="itemizedlist.label.width" select="'1.0em'"/>
+
+<xsl:param name="keep.relative.image.uris" select="0"/>
+<xsl:param name="l10n.gentext.default.language" select="'en'"/>
+<xsl:param name="l10n.gentext.language" select="''"/>
+<xsl:param name="l10n.gentext.use.xref.language" select="0"/>
+<xsl:param name="l10n.lang.value.rfc.compliant" select="1"/>
+<xsl:param name="label.from.part" select="'0'"/>
+<xsl:param name="line-height" select="'normal'"/>
+<xsl:param name="linenumbering.everyNth" select="'5'"/>
+<xsl:param name="linenumbering.extension" select="'1'"/>
+<xsl:param name="linenumbering.separator" select="' '"/>
+<xsl:param name="linenumbering.width" select="'3'"/>
+<xsl:attribute-set name="list.block.properties">
+  <xsl:attribute name="provisional-label-separation">0.2em</xsl:attribute>
+  <xsl:attribute name="provisional-distance-between-starts">1.5em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="list.block.spacing">
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">1.2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="list.item.spacing">
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="make.index.markup" select="0"/>
+<xsl:param name="make.single.year.ranges" select="0"/>
+<xsl:param name="make.year.ranges" select="0"/>
+<xsl:attribute-set name="margin.note.properties">
+  <xsl:attribute name="font-size">90%</xsl:attribute>
+  <xsl:attribute name="text-align">start</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="margin.note.title.properties">
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="text-align">start</xsl:attribute>
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="margin.note.float.type" select="'none'"/>
+<xsl:param name="margin.note.width" select="'1in'"/>
+<xsl:param name="marker.section.level" select="2"/>
+<xsl:param name="menuchoice.menu.separator"> &#8594; </xsl:param>
+<xsl:param name="menuchoice.separator" select="'+'"/>
+<xsl:param name="monospace.font.family" select="'monospace'"/>
+<xsl:attribute-set name="monospace.properties">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$monospace.font.family"/>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="monospace.verbatim.properties" use-attribute-sets="verbatim.properties monospace.properties">
+  <xsl:attribute name="text-align">start</xsl:attribute>
+  <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="nominal.table.width" select="'6in'"/>
+<xsl:attribute-set name="normal.para.spacing">
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="olink.doctitle" select="'no'"/> 
+<xsl:param name="olink.base.uri" select="''"/> 
+<xsl:param name="olink.debug" select="0"/>
+<xsl:attribute-set name="olink.properties">
+  <xsl:attribute name="show-destination">replace</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="olink.lang.fallback.sequence" select="''"/> 
+<xsl:attribute-set name="orderedlist.properties" use-attribute-sets="list.block.properties">
+  <xsl:attribute name="provisional-distance-between-starts">2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="orderedlist.label.properties">
+</xsl:attribute-set>
+<xsl:param name="orderedlist.label.width" select="'1.2em'"/>
+<xsl:param name="prefer.internal.olink" select="0"/>
+<xsl:param name="insert.olink.page.number">no</xsl:param>
+<xsl:param name="insert.olink.pdf.frag" select="0"/>
+<xsl:param name="page.height">
+  <xsl:choose>
+    <xsl:when test="$page.orientation = 'portrait'">
+      <xsl:value-of select="$page.height.portrait"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$page.width.portrait"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="page.height.portrait">
+  <xsl:choose>
+    <xsl:when test="$paper.type = 'A4landscape'">210mm</xsl:when>
+    <xsl:when test="$paper.type = 'USletter'">11in</xsl:when>
+    <xsl:when test="$paper.type = 'USlandscape'">8.5in</xsl:when>
+    <xsl:when test="$paper.type = '4A0'">2378mm</xsl:when>
+    <xsl:when test="$paper.type = '2A0'">1682mm</xsl:when>
+    <xsl:when test="$paper.type = 'A0'">1189mm</xsl:when>
+    <xsl:when test="$paper.type = 'A1'">841mm</xsl:when>
+    <xsl:when test="$paper.type = 'A2'">594mm</xsl:when>
+    <xsl:when test="$paper.type = 'A3'">420mm</xsl:when>
+    <xsl:when test="$paper.type = 'A4'">297mm</xsl:when>
+    <xsl:when test="$paper.type = 'A5'">210mm</xsl:when>
+    <xsl:when test="$paper.type = 'A6'">148mm</xsl:when>
+    <xsl:when test="$paper.type = 'A7'">105mm</xsl:when>
+    <xsl:when test="$paper.type = 'A8'">74mm</xsl:when>
+    <xsl:when test="$paper.type = 'A9'">52mm</xsl:when>
+    <xsl:when test="$paper.type = 'A10'">37mm</xsl:when>
+    <xsl:when test="$paper.type = 'B0'">1414mm</xsl:when>
+    <xsl:when test="$paper.type = 'B1'">1000mm</xsl:when>
+    <xsl:when test="$paper.type = 'B2'">707mm</xsl:when>
+    <xsl:when test="$paper.type = 'B3'">500mm</xsl:when>
+    <xsl:when test="$paper.type = 'B4'">353mm</xsl:when>
+    <xsl:when test="$paper.type = 'B5'">250mm</xsl:when>
+    <xsl:when test="$paper.type = 'B6'">176mm</xsl:when>
+    <xsl:when test="$paper.type = 'B7'">125mm</xsl:when>
+    <xsl:when test="$paper.type = 'B8'">88mm</xsl:when>
+    <xsl:when test="$paper.type = 'B9'">62mm</xsl:when>
+    <xsl:when test="$paper.type = 'B10'">44mm</xsl:when>
+    <xsl:when test="$paper.type = 'C0'">1297mm</xsl:when>
+    <xsl:when test="$paper.type = 'C1'">917mm</xsl:when>
+    <xsl:when test="$paper.type = 'C2'">648mm</xsl:when>
+    <xsl:when test="$paper.type = 'C3'">458mm</xsl:when>
+    <xsl:when test="$paper.type = 'C4'">324mm</xsl:when>
+    <xsl:when test="$paper.type = 'C5'">229mm</xsl:when>
+    <xsl:when test="$paper.type = 'C6'">162mm</xsl:when>
+    <xsl:when test="$paper.type = 'C7'">114mm</xsl:when>
+    <xsl:when test="$paper.type = 'C8'">81mm</xsl:when>
+    <xsl:when test="$paper.type = 'C9'">57mm</xsl:when>
+    <xsl:when test="$paper.type = 'C10'">40mm</xsl:when>
+    <xsl:otherwise>11in</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="page.margin.bottom" select="'0.5in'"/>
+<xsl:param name="page.margin.inner">
+  <xsl:choose>
+    <xsl:when test="$double.sided != 0">1.25in</xsl:when>
+    <xsl:otherwise>1in</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="page.margin.outer">
+  <xsl:choose>
+    <xsl:when test="$double.sided != 0">0.75in</xsl:when>
+    <xsl:otherwise>1in</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="page.margin.top" select="'0.5in'"/>
+<xsl:param name="page.orientation" select="'portrait'"/>
+<xsl:param name="page.width">
+  <xsl:choose>
+    <xsl:when test="$page.orientation = 'portrait'">
+      <xsl:value-of select="$page.width.portrait"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$page.height.portrait"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="page.width.portrait">
+  <xsl:choose>
+    <xsl:when test="$paper.type = 'USletter'">8.5in</xsl:when>
+    <xsl:when test="$paper.type = '4A0'">1682mm</xsl:when>
+    <xsl:when test="$paper.type = '2A0'">1189mm</xsl:when>
+    <xsl:when test="$paper.type = 'A0'">841mm</xsl:when>
+    <xsl:when test="$paper.type = 'A1'">594mm</xsl:when>
+    <xsl:when test="$paper.type = 'A2'">420mm</xsl:when>
+    <xsl:when test="$paper.type = 'A3'">297mm</xsl:when>
+    <xsl:when test="$paper.type = 'A4'">210mm</xsl:when>
+    <xsl:when test="$paper.type = 'A5'">148mm</xsl:when>
+    <xsl:when test="$paper.type = 'A6'">105mm</xsl:when>
+    <xsl:when test="$paper.type = 'A7'">74mm</xsl:when>
+    <xsl:when test="$paper.type = 'A8'">52mm</xsl:when>
+    <xsl:when test="$paper.type = 'A9'">37mm</xsl:when>
+    <xsl:when test="$paper.type = 'A10'">26mm</xsl:when>
+    <xsl:when test="$paper.type = 'B0'">1000mm</xsl:when>
+    <xsl:when test="$paper.type = 'B1'">707mm</xsl:when>
+    <xsl:when test="$paper.type = 'B2'">500mm</xsl:when>
+    <xsl:when test="$paper.type = 'B3'">353mm</xsl:when>
+    <xsl:when test="$paper.type = 'B4'">250mm</xsl:when>
+    <xsl:when test="$paper.type = 'B5'">176mm</xsl:when>
+    <xsl:when test="$paper.type = 'B6'">125mm</xsl:when>
+    <xsl:when test="$paper.type = 'B7'">88mm</xsl:when>
+    <xsl:when test="$paper.type = 'B8'">62mm</xsl:when>
+    <xsl:when test="$paper.type = 'B9'">44mm</xsl:when>
+    <xsl:when test="$paper.type = 'B10'">31mm</xsl:when>
+    <xsl:when test="$paper.type = 'C0'">917mm</xsl:when>
+    <xsl:when test="$paper.type = 'C1'">648mm</xsl:when>
+    <xsl:when test="$paper.type = 'C2'">458mm</xsl:when>
+    <xsl:when test="$paper.type = 'C3'">324mm</xsl:when>
+    <xsl:when test="$paper.type = 'C4'">229mm</xsl:when>
+    <xsl:when test="$paper.type = 'C5'">162mm</xsl:when>
+    <xsl:when test="$paper.type = 'C6'">114mm</xsl:when>
+    <xsl:when test="$paper.type = 'C7'">81mm</xsl:when>
+    <xsl:when test="$paper.type = 'C8'">57mm</xsl:when>
+    <xsl:when test="$paper.type = 'C9'">40mm</xsl:when>
+    <xsl:when test="$paper.type = 'C10'">28mm</xsl:when>
+    <xsl:otherwise>8.5in</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="paper.type" select="'USletter'"/>
+<xsl:param name="part.autolabel" select="'I'"/>
+<xsl:param name="passivetex.extensions" select="0"/>
+<xsl:attribute-set name="pgwide.properties">
+  <xsl:attribute name="start-indent">0pt</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="preface.autolabel" select="0"/>
+<xsl:param name="preferred.mediaobject.role"/>
+<xsl:attribute-set name="procedure.properties" use-attribute-sets="formal.object.properties"/>
+<xsl:param name="process.empty.source.toc" select="0"/>
+<xsl:param name="process.source.toc" select="0"/>
+<xsl:param name="profile.arch" select="''"/>
+<xsl:param name="profile.audience" select="''"/>
+<xsl:param name="profile.attribute" select="''"/>
+<xsl:param name="profile.condition" select="''"/>
+<xsl:param name="profile.conformance" select="''"/>
+<xsl:param name="profile.lang" select="''"/>
+<xsl:param name="profile.os" select="''"/>
+<xsl:param name="profile.revision" select="''"/>
+<xsl:param name="profile.revisionflag" select="''"/>
+<xsl:param name="profile.role" select="''"/>
+<xsl:param name="profile.security" select="''"/>
+<xsl:param name="profile.separator" select="';'"/>
+<xsl:param name="profile.status" select="''"/>
+<xsl:param name="profile.userlevel" select="''"/>
+<xsl:param name="profile.value" select="''"/>
+<xsl:param name="profile.vendor" select="''"/>
+<xsl:param name="profile.wordsize" select="''"/>
+<xsl:param name="punct.honorific" select="'.'"/>
+<xsl:param name="qanda.defaultlabel">number</xsl:param>
+<xsl:param name="qanda.in.toc" select="0"/>
+<xsl:param name="qanda.nested.in.toc" select="0"/>
+<xsl:param name="qanda.inherit.numeration" select="1"/>
+<xsl:param name="qandadiv.autolabel" select="1"/>
+<xsl:attribute-set name="qanda.title.level1.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 2.0736"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="qanda.title.level2.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 1.728"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="qanda.title.level3.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 1.44"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="qanda.title.level4.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 1.2"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="qanda.title.level5.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="qanda.title.level6.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="qanda.title.properties">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$title.font.family"/>
+  </xsl:attribute>
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <!-- font size is calculated dynamically by qanda.heading template -->
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.optimum">1.0em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="refentry.generate.name" select="1"/>
+<xsl:param name="refentry.generate.title" select="0"/>
+<xsl:param name="refentry.pagebreak" select="1"/>
+<xsl:attribute-set name="refentry.title.properties">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$title.font.family"/>
+  </xsl:attribute>
+  <xsl:attribute name="font-size">18pt</xsl:attribute>
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="space-after">1em</xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.optimum">1.0em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">0.5em</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">0.6em</xsl:attribute>
+  <xsl:attribute name="start-indent"><xsl:value-of select="$title.margin.left"/></xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="refentry.xref.manvolnum" select="1"/>
+<xsl:param name="reference.autolabel" select="'I'"/>
+<xsl:param name="refclass.suppress" select="0"/>
+<xsl:param name="region.after.extent" select="'0.4in'"/>
+<xsl:param name="region.before.extent" select="'0.4in'"/>
+<xsl:attribute-set name="revhistory.table.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="revhistory.table.cell.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="revhistory.title.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="root.properties">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$body.fontset"/>
+  </xsl:attribute>
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.size"/>
+  </xsl:attribute>
+  <xsl:attribute name="text-align">
+    <xsl:value-of select="$alignment"/>
+  </xsl:attribute>
+  <xsl:attribute name="line-height">
+    <xsl:value-of select="$line-height"/>
+  </xsl:attribute>
+  <xsl:attribute name="font-selection-strategy">character-by-character</xsl:attribute>
+  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="rootid" select="''"/>
+<xsl:param name="runinhead.default.title.end.punct" select="'.'"/>
+<xsl:param name="runinhead.title.end.punct" select="'.!?:'"/>
+<xsl:param name="sans.font.family" select="'sans-serif'"/>
+<xsl:param name="section.autolabel" select="0"/>
+<xsl:param name="section.autolabel.max.depth" select="8"/>
+<xsl:param name="section.container.element" select="'block'"/>
+<xsl:param name="section.label.includes.component.label" select="0"/>
+<xsl:attribute-set name="section.title.level1.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 2.0736"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="section.title.level2.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 1.728"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="section.title.level3.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 1.44"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="section.title.level4.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master * 1.2"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="section.title.level5.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="section.title.level6.properties">
+  <xsl:attribute name="font-size">
+    <xsl:value-of select="$body.font.master"/>
+    <xsl:text>pt</xsl:text>
+  </xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="section.title.properties">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$title.font.family"/>
+  </xsl:attribute>
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <!-- font size is calculated dynamically by section.heading template -->
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.optimum">1.0em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+  <xsl:attribute name="text-align">left</xsl:attribute>
+  <xsl:attribute name="start-indent"><xsl:value-of select="$title.margin.left"/></xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="section.level1.properties" use-attribute-sets="section.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="section.level2.properties" use-attribute-sets="section.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="section.level3.properties" use-attribute-sets="section.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="section.level4.properties" use-attribute-sets="section.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="section.level5.properties" use-attribute-sets="section.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="section.level6.properties" use-attribute-sets="section.properties">
+</xsl:attribute-set>
+<xsl:attribute-set name="section.properties">
+</xsl:attribute-set>
+<xsl:param name="segmentedlist.as.table" select="0"/>
+<xsl:param name="shade.verbatim" select="0"/>
+
+<xsl:attribute-set name="shade.verbatim.style">
+  <xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="show.comments">1</xsl:param>
+<xsl:attribute-set name="sidebar.properties" use-attribute-sets="formal.object.properties">
+  <xsl:attribute name="border-style">solid</xsl:attribute>
+  <xsl:attribute name="border-width">1pt</xsl:attribute>
+  <xsl:attribute name="border-color">black</xsl:attribute>
+  <xsl:attribute name="background-color">#DDDDDD</xsl:attribute>
+  <xsl:attribute name="padding-left">12pt</xsl:attribute>
+  <xsl:attribute name="padding-right">12pt</xsl:attribute>
+  <xsl:attribute name="padding-top">6pt</xsl:attribute>
+  <xsl:attribute name="padding-bottom">6pt</xsl:attribute>
+  <xsl:attribute name="margin-left">0pt</xsl:attribute>
+  <xsl:attribute name="margin-right">0pt</xsl:attribute>
+<!--
+  <xsl:attribute name="margin-top">6pt</xsl:attribute>
+  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
+-->
+</xsl:attribute-set>
+<xsl:attribute-set name="sidebar.title.properties">
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="text-align">start</xsl:attribute>
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="sidebar.float.type" select="'none'"/>
+<xsl:param name="sidebar.float.width" select="'1in'"/>
+<xsl:param name="simplesect.in.toc" select="0"/>
+<xsl:attribute-set name="subscript.properties">
+  <xsl:attribute name="font-size">75%</xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="superscript.properties">
+  <xsl:attribute name="font-size">75%</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="symbol.font.family" select="'Symbol,ZapfDingbats'"/>
+
+<xsl:param name="table.cell.border.color" select="'black'"/>
+<xsl:param name="table.cell.border.style" select="'solid'"/>
+<xsl:param name="table.cell.border.thickness" select="'0.5pt'"/>
+<xsl:attribute-set name="table.cell.padding">
+  <xsl:attribute name="padding-left">2pt</xsl:attribute>
+  <xsl:attribute name="padding-right">2pt</xsl:attribute>
+  <xsl:attribute name="padding-top">2pt</xsl:attribute>
+  <xsl:attribute name="padding-bottom">2pt</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="table.footnote.number.format" select="'a'"/>
+<xsl:param name="table.footnote.number.symbols" select="''"/>
+<xsl:attribute-set name="table.footnote.properties">
+  <xsl:attribute name="font-family"><xsl:value-of select="$body.fontset"/></xsl:attribute>
+  <xsl:attribute name="font-size"><xsl:value-of select="$footnote.font.size"/></xsl:attribute>
+  <xsl:attribute name="font-weight">normal</xsl:attribute>
+  <xsl:attribute name="font-style">normal</xsl:attribute>
+  <xsl:attribute name="space-before">2pt</xsl:attribute>
+  <xsl:attribute name="text-align"><xsl:value-of select="$alignment"/></xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:param name="table.frame.border.color" select="'black'"/>
+<xsl:param name="table.frame.border.style" select="'solid'"/>
+<xsl:param name="table.frame.border.thickness" select="'0.5pt'"/>
+<xsl:attribute-set name="table.properties" use-attribute-sets="formal.object.properties"/>
+<xsl:param name="tablecolumns.extension" select="'1'"/>
+<xsl:attribute-set name="table.table.properties">
+  <xsl:attribute name="border-before-width.conditionality">retain</xsl:attribute>
+  <xsl:attribute name="border-collapse">collapse</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="target.database.document" select="''"/>
+<xsl:param name="targets.filename" select="'target.db'"/>
+<xsl:param name="textdata.default.encoding" select="''"/>
+<xsl:param name="tex.math.delims" select="'1'"/>
+<xsl:param name="tex.math.in.alt" select="''"/>
+<xsl:param name="textinsert.extension" select="'1'"/>
+<xsl:param name="title.font.family" select="'sans-serif'"/>
+<xsl:param name="title.margin.left">
+  <xsl:choose>
+    <xsl:when test="$fop.extensions != 0">-4pc</xsl:when>
+    <xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
+    <xsl:otherwise>0pt</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+<xsl:param name="toc.indent.width" select="24"/>
+<xsl:attribute-set name="toc.line.properties">
+  <xsl:attribute name="text-align-last">justify</xsl:attribute>
+  <xsl:attribute name="text-align">start</xsl:attribute>
+  <xsl:attribute name="end-indent"><xsl:value-of select="concat($toc.indent.width, 'pt')"/></xsl:attribute>
+  <xsl:attribute name="last-line-end-indent"><xsl:value-of select="concat('-', $toc.indent.width, 'pt')"/></xsl:attribute>
+</xsl:attribute-set>
+<xsl:attribute-set name="toc.margin.properties">
+  <xsl:attribute name="space-before.minimum">0.5em</xsl:attribute>
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">2em</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0.5em</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">2em</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="toc.max.depth">8</xsl:param>
+<xsl:param name="toc.section.depth">2</xsl:param>
+<xsl:param name="ulink.footnotes" select="0"/>
+<xsl:param name="ulink.hyphenate" select="''"/>
+<xsl:param name="ulink.hyphenate.chars" select="'/'"/>
+<xsl:param name="ulink.show" select="1"/>
+<xsl:param name="use.extensions" select="'0'"/>
+<xsl:param name="use.local.olink.style" select="0"/> 
+<xsl:param name="use.role.as.xrefstyle" select="1"/>
+<xsl:param name="use.role.for.mediaobject" select="1"/>
+<xsl:param name="use.svg" select="1"/>
+<xsl:param name="variablelist.as.blocks" select="0"/>
+<xsl:param name="variablelist.max.termlength">24</xsl:param>
+<xsl:param name="variablelist.term.separator">, </xsl:param>
+<xsl:param name="variablelist.term.break.after">0</xsl:param>
+<xsl:attribute-set name="verbatim.properties">
+  <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+  <xsl:attribute name="space-after.minimum">0.8em</xsl:attribute>
+  <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+  <xsl:attribute name="space-after.maximum">1.2em</xsl:attribute>
+  <xsl:attribute name="hyphenate">false</xsl:attribute>
+  <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
+  <xsl:attribute name="white-space-collapse">false</xsl:attribute>
+  <xsl:attribute name="white-space-treatment">preserve</xsl:attribute>
+  <xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>
+  <xsl:attribute name="text-align">start</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="xep.extensions" select="0"/>
+<xsl:attribute-set name="xep.index.item.properties" use-attribute-sets="index.page.number.properties">
+  <xsl:attribute name="merge-subsequent-page-numbers">true</xsl:attribute>
+  <xsl:attribute name="link-back">true</xsl:attribute>
+</xsl:attribute-set>
+<xsl:param name="xref.label-page.separator"><xsl:text> </xsl:text></xsl:param>
+<xsl:param name="xref.label-title.separator">: </xsl:param>
+<xsl:attribute-set name="xref.properties">
+</xsl:attribute-set>
+<xsl:param name="xref.title-page.separator"><xsl:text> </xsl:text></xsl:param>
+<xsl:param name="xref.with.number.and.title" select="1"/>
+
+</xsl:stylesheet>

+ 36 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/passivetex.xsl

@@ -0,0 +1,36 @@
+<?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$
+     ********************************************************************
+      This extension stops PassiveTeX from merging subsequent '-' to 
+      dashes. You must set passivetex.extensions to '1' if you want get
+      this functionality.
+     ******************************************************************** -->
+
+<xsl:template name="passivetex.dash.subst">
+  <xsl:param name="string"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($string, '--')">
+      <xsl:variable name="rest">
+        <xsl:call-template name="passivetex.dash.subst">
+          <xsl:with-param name="string"
+                          select="concat('-', substring-after($string, '--'))"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:value-of select="concat(substring-before($string, '--'),
+                                   '-&#x200b;',
+                                   $rest)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$string"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 140 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/pdf2index

@@ -0,0 +1,140 @@
+#!/usr/bin/perl -- # -*- Perl -*-
+
+# this needs some cleanup...
+
+my $PSTOTEXT = "pstotext";
+
+my $pdf = shift @ARGV;
+
+my $index = "";
+my $inindex = 0;
+open (F, "$PSTOTEXT $pdf |");
+while (<F>) {
+    if (/^<\/index/) {
+	$index .= $_;
+	$inindex = 0;
+    }
+    $inindex = 1 if /^<index/;
+
+    if ($inindex) {
+	$index .= $_ if /^\s*</;
+    }
+}
+
+my $cindex = "";
+while ($index =~ /^(.*?)((<phrase role=\"pageno\">.*?<\/phrase>\s*)+)/s) {
+    $cindex .= $1;
+    $_ = $2;
+    $index = $'; # '
+
+    my @pages = m/<phrase role=\"pageno\">.*?<\/phrase>\s*/sg;
+
+    # Expand ranges
+    if ($#pages >= 0) {
+	my @mpages = ();
+	foreach my $page (@pages) {
+	    my $pageno = &pageno($page);
+	    if ($pageno =~ /^([0-9]+)[^0-9]([0-9]+)$/) { # funky -
+		for (my $count = $1; $count <= $2; $count++) {
+		    push (@mpages, "<phrase role=\"$pageno\">$count</phrase>");
+		}
+	    } else {
+		push (@mpages, $page);
+	    }
+	}
+	@pages = sort rangesort @mpages;
+    }
+
+    # Remove duplicates...
+    if ($#pages > 0) {
+	my @mpages = ();
+	my $current = "";
+	foreach my $page (@pages) {
+	    my $pageno = &pageno($page);
+	    if ($pageno ne $current) {
+		push (@mpages, $page);
+		$current = $pageno;
+	    }
+	}
+	@pages = @mpages;
+    }
+
+    # Collapse ranges...
+    if ($#pages > 1) {
+	my @cpages = ();
+	while (@pages) {
+	    my $count = 0;
+	    my $len = &rangelen($count, @pages);
+	    if ($len <= 2) {
+		my $page = shift @pages;
+		push (@cpages, $page);
+	    } else {
+		my $fpage = shift @pages;
+		my $lpage = "";
+		while ($len > 1) {
+		    $lpage = shift @pages;
+		    $len--;
+		}
+		my $fpno = &pageno($fpage);
+		my $lpno = &pageno($lpage);
+		$fpage =~ s/>$fpno</>${fpno}-$lpno</s;
+		push (@cpages, $fpage);
+	    }
+	}
+	@pages = @cpages;
+    }
+
+    my $page = shift @pages;
+    $page =~ s/\s*$//s;
+    $cindex .= $page;
+    while (@pages) {
+	$page = shift @pages;
+	$page =~ s/\s*$//s;
+	$cindex .= ", $page";
+    }
+}
+$cindex .= $index;
+
+print "$cindex\n";
+
+sub pageno {
+    my $page = shift;
+
+    $page =~ s/^<phrase.*?>//;
+    $page =~ s/^<link.*?>//;
+
+    return $1 if $page =~ /^([^<>]+)/;
+    return "?";
+}
+
+sub rangesort {
+    my $apno = &pageno($a);
+    my $bpno = &pageno($b);
+
+    # Make sure roman pages come before arabic ones, otherwise sort them in order
+    return -1 if ($apno !~ /^\d+/ && $bpno =~ /^\d+/);
+    return  1 if ($apno =~ /^\d+/ && $bpno !~ /^\d+/);
+    return $apno <=> $bpno;
+}
+
+sub rangelen {
+    my $count = shift;
+    my @pages = @_;
+    my $len = 1;
+    my $inrange = 1;
+
+    my $current = &pageno($pages[$count]);
+    while ($count < $#pages && $inrange) {
+	$count++;
+	my $next = &pageno($pages[$count]);
+	if ($current + 1 eq $next) {
+	    $current = $next;
+	    $inrange = 1;
+	    $len++;
+	} else {
+	    $inrange = 0;
+	}
+    }
+
+    return $len;
+}

+ 860 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/pi.xsl

@@ -0,0 +1,860 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                exclude-result-prefixes="doc"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<doc:reference xmlns="">
+<referenceinfo>
+<releaseinfo role="meta">
+$Id$
+</releaseinfo>
+<authorgroup>
+  <author>
+    <orgname>The DocBook Project Development Team</orgname>
+  </author>
+</authorgroup>
+<copyright>
+  <year>2007</year>
+  <holder>The DocBook Project</holder>
+</copyright>
+</referenceinfo>
+<title>FO Processing Instruction Reference</title>
+
+<partintro id="partintro">
+<title>Introduction</title>
+
+<para>This is generated reference documentation for all
+  user-configurable processing instructions (PIs) in the DocBook
+  XSL stylesheets for FO output.
+  <note>
+    <para>You add these PIs at particular points in a document to
+      cause specific “exceptions” to formatting/output behavior. To
+      make global changes in formatting/output behavior across an
+      entire document, it’s better to do it by setting an
+      appropriate stylesheet parameter (if there is one).</para>
+  </note>
+</para>
+</partintro>
+</doc:reference>
+
+<!-- ==================================================================== -->
+
+<doc:pi name="dbfo_background-color" xmlns="">
+<refpurpose>Sets background color for an image</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo background-color</tag> PI before or
+    after an image (<tag>graphic</tag>, <tag>inlinegraphic</tag>,
+    <tag>imagedata</tag>, or <tag>videodata</tag> element) as a
+    sibling to the element, to set a background color for the
+    image.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo background-color="<replaceable>color</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>background-color="<replaceable>color</replaceable>"</term>
+      <listitem>
+        <para>FIXME: A color value? [In hex, as a name, or what?]</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_background-color">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'background-color'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_bgcolor" xmlns="">
+<refpurpose>Sets background color on an table row or table cell</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo bgcolor</tag> PI as child of a table row
+    or cell to set a background color for that table row or cell.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo bgcolor="<replaceable>color</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>bgcolor="<replaceable>color</replaceable>"</term>
+      <listitem>
+        <para>FIXME: A color value? [In hex, as a name, or what?]</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_bgcolor">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'bgcolor'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_float-type" xmlns="">
+<refpurpose>Specifies float behavior for a sidebar</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo float-type</tag> PI to specify the float
+    behavior for a <tag>sidebar</tag> (to cause the sidebar to be
+  displayed as a marginal note).</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo float-type="margin.note"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>float-type="margin.note"</term>
+      <listitem>
+        <para>Specifies that the <tag>sidebar</tag> should be
+          displayed as a marginal note.</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_float-type">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'float-type'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_glossary-presentation" xmlns="">
+<refpurpose>Specifies presentation style for a glossary</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo glossary-presentation</tag> PI as a child of
+    a <tag>glossary</tag> to control its presentation style.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo glossary-presentation="list"|"blocks"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>glossary-presentation="list"</term>
+      <listitem>
+        <para>Displayed the glossary as a list</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>glossary-presentation="blocks"</term>
+      <listitem>
+        <para>Displays the glossary as blocks</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_glossary-presentation">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'glossary-presentation'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_glosslist-presentation" xmlns="">
+<refpurpose>Specifies presentation style for a glosslist</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo glosslist-presentation</tag> PI as a child of
+    a <tag>glosslist</tag> to control its presentation style.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo glosslist-presentation="list"|"blocks"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>glosslist-presentation="list"</term>
+      <listitem>
+        <para>Displayed the glosslist as a list</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>glosslist-presentation="blocks"</term>
+      <listitem>
+        <para>Displays the glosslist as blocks</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_glosslist-presentation">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'glosslist-presentation'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_glossterm-width" xmlns="">
+<refpurpose>Specifies the glossterm width for a glossary or
+  glosslist</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo glossterm-width</tag> PI as a child of a
+    <tag>glossary</tag> or <tag>glosslist</tag> to specify the
+    width for output of <tag>glossterm</tag> instances in the
+    output.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo glossterm-width="<replaceable>width</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>glossterm-width="<replaceable>width</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the glossterm width (in what units?)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_glossterm-width">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'glossterm-width'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_keep-together" xmlns="">
+<refpurpose>Specifies “keep” behavior for a table, example,
+  figure, or equation</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo keep-together</tag> PI as a child of a
+    formal object (<tag>table</tag>, <tag>example</tag>,
+    <tag>figure</tag>, or <tag>equation</tag>) or their informal
+    equivalents) to specify “keep” behavior for the object (to
+    allow the object to “break” across a page).</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo keep-together="auto"|"always"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>keep-together="auto"</term>
+      <listitem>
+        <para>Enables the object to break across a page</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>keep-together="always"</term>
+      <listitem>
+        <para>Prevents the object from breaking across a page (the
+          default stylesheet behavior)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_keep-together">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'keep-together'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_label-width" xmlns="">
+<refpurpose>Specifies the label width for an itemizedlist,
+  orderedlist, or qandaset</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo label-width</tag> PI as a child of an
+    <tag>itemizedlist</tag>, <tag>orderedlist</tag>, or
+    <tag>qandaset</tag> to specify the width of labels.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo label-width="<replaceable>width</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>label-width="<replaceable>width</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the label width (in what units?)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_label-width">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'label-width'"/>
+  </xsl:call-template>
+</xsl:template> 
+
+<doc:pi name="dbfo_linenumbering.everyNth" xmlns="">
+<refpurpose>Specifies the interval at which lines are numbered
+  output of verbatim environments</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo linenumbering.everyNth</tag> PI as a child
+    of a “verbatim” element – <tag>programlisting</tag>,
+    <tag>screen</tag>, <tag>synopsis</tag> — to specify
+    the interval at which lines are numbered.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo linenumbering.everyNth="<replaceable>N</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>linenumbering.everyNth="<replaceable>N</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies numbering interval; a number is
+          output before every <replaceable>N</replaceable>th line</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_linenumbering.everyNth">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis"
+      select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'linenumbering.everyNth'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_linenumbering.separator" xmlns="">
+<refpurpose>Specifies the separator text used between line numbers
+  and content in output of verbatim environments</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo linenumbering.separator</tag> PI as a child
+    of a “verbatim” element – <tag>programlisting</tag>,
+    <tag>screen</tag>, <tag>synopsis</tag> — to specify
+    the separator text output between the line numbers and content.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo linenumbering.separator="<replaceable>text</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>linenumbering.separator="<replaceable>text</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the text (zero or more characters)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_linenumbering.separator">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis"
+      select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'linenumbering.separator'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_linenumbering.width" xmlns="">
+<refpurpose>Specifies the width set aside for line numbers in
+  output of verbatim environments</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo linenumbering.width</tag> PI as a child
+    of a “verbatim” element – <tag>programlisting</tag>,
+    <tag>screen</tag>, <tag>synopsis</tag> — to specify
+    the width set aside for line numbers.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo linenumbering.width="<replaceable>width</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>linenumbering.width="<replaceable>width</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the width (in what units?)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_linenumbering.width">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis"
+      select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'linenumbering.width'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_list-width" xmlns="">
+<refpurpose>Specifies the width of a horizontal simplelist</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo list-width</tag> PI as a child of a
+    <tag>simplelist</tag> whose <tag class="attribute">class</tag>
+    value is <literal>horizontal</literal>, to specify the width
+    of the <tag>simplelist</tag>.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo list-width="<replaceable>width</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>list-width="<replaceable>width</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the <tag>simplelist</tag> width (in what units?)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_list-width">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'list-width'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_list-presentation" xmlns="">
+<refpurpose>Specifies presentation style for a variablelist or
+  segmentedlist</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo list-presentation</tag> PI as a child of
+    a <tag>variablelist</tag> or <tag>segmentedlist</tag> to
+    control the presentation style for the list (to cause it, for
+    example, to be displayed as a table).</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo list-presentation="list"|"blocks"|"table"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>list-presentation="list"</term>
+      <listitem>
+        <para>Displayed the list as a list</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>list-presentation="blocks"</term>
+      <listitem>
+        <para>(<tag>variablelist</tag> only) Displays the list as blocks</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>list-presentation="table"</term>
+      <listitem>
+        <para>(<tag>segmentedlist</tag> only) Displays the list as a table</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_list-presentation">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'list-presentation'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_orientation" xmlns="">
+<refpurpose>Specifies the orientation for table row or cell</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo orientation</tag> PI as a child of an
+    <tag>table</tag> row or cell to specify the orientation
+    (rotation) for the row or cell.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo orientation="0"|"90"|"180"|"270"|"-90"|"-180"|"-270"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>orientation="0"|"90"|"180"|"270"|"-90"|"-180"|"-270"</term>
+      <listitem>
+        <para>Specifies the number of degrees by which the cell or
+          row is rotated</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_orientation">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'orientation'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_pgwide" xmlns="">
+  <refpurpose>Species whether an <tag>equation</tag> or
+    <tag>example</tag> should rendered across the full width of a
+    page</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo pgwide</tag> PI as a child of an
+    <tag>equation</tag> or <tag>example</tag> to specify that the
+    content should rendered across the full width of the page.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo pgwide="0"|"1"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>pgwide="0"</term>
+      <listitem>
+        <para>If zero, the content is rendered across the current
+        text flow</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>pgwide="1"</term>
+      <listitem>
+        <para>If <code>1</code> (or any non-zero value), the
+          content is rendered across the full width of the page</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_pgwide">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'pgwide'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_rotated-width" xmlns="">
+  <refpurpose>Specifies the width for a table <tag>entry</tag> or
+    <tag>row</tag></refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo rotated-width</tag> PI as a child of an
+    <tag>entry</tag> or <tag>row</tag> instance to specify the
+    width of that the <tag>entry</tag> or <tag>row</tag>; or
+    use it higher up in table to cause the width to be inherited
+    recursively down.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo rotated-width="<replaceable>width</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>rotated-width="<replaceable>width</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the width of a row or cell (in what units?)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_rotated-width">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis"
+      select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'rotated-width'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_sidebar-width" xmlns="">
+<refpurpose>Specifies the width of a sidebar</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo sidebar-width</tag> PI as a child of a
+    <tag>sidebar</tag> to specify the width of the sidebar.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo sidebar-width="<replaceable>width</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>sidebar-width="<replaceable>width</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the <tag>sidebar</tag> width (in what units?)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_sidebar-width">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'sidebar-width'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_table-width" xmlns="">
+<refpurpose>Specifies the width for a table or for revhistory
+  output</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo table-width</tag> PI as a child of a
+    <tag>table</tag> or <tag>revhistory</tag> instance (which is
+    rendered as a table in output) to specify the width of the
+    table in output.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo table-width="<replaceable>width</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>table-width="<replaceable>width</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the table width (in what units?)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_table-width">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'table-width'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_term-width" xmlns="">
+<refpurpose>Specifies the term width for a variablelist</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo term-width</tag> PI as a child of a
+    <tag>variablelist</tag> to specify the width for
+    <tag>term</tag> output.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo term-width="<replaceable>width</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>term-width="<replaceable>width</replaceable>"</term>
+      <listitem>
+        <para>FIXME: Specifies the term width (in what units?)</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_term-width">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'term-width'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<doc:pi name="dbfo_toc" xmlns="">
+<refpurpose>Species whether a TOC should be generated for a qandaset</refpurpose>
+<refdescription>
+  <para>Use the <tag>dbfo toc</tag> PI as a child of a
+    <tag>jandaset</tag> to specify whether a table of contents
+    (TOC) is generated for the <tag>qandaset</tag>.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo toc="0"|"1"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>toc="0"</term>
+      <listitem>
+        <para>If zero, no TOC is generated</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>toc="1"</term>
+      <listitem>
+        <para>If <code>1</code> (or any non-zero value),
+          a TOC is generated</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo_toc">
+  <xsl:param name="node" select="."/>
+  <xsl:call-template name="dbfo-attribute">
+    <xsl:with-param name="pis" select="$node/processing-instruction('dbfo')"/>
+    <xsl:with-param name="attribute" select="'toc'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<doc:pi name="dbfo-need" xmlns="">
+<refpurpose>Specify a need for space (a kind of soft page break)</refpurpose>
+<refdescription>
+  <para>A “need” is a request for space on a page.  If the
+    requested space is not available, the page breaks and the
+    content that follows the need request appears on the next
+    page. If the requested space is available, then the request is
+    ignored.</para>
+</refdescription>
+  <refsynopsisdiv>
+    <synopsis><tag class="xmlpi">dbfo-need height="<replaceable>n</replaceable>"</tag></synopsis>
+    <synopsis><tag class="xmlpi">dbfo-need space-before="<replaceable>n</replaceable>"</tag></synopsis>
+  </refsynopsisdiv>
+<refparameter>
+  <variablelist>
+    <varlistentry><term>height="<replaceable>n</replaceable>"</term>
+      <listitem>
+        <para>FIXME: the amount of height(?) needed? In what units? pt?.</para>
+      </listitem>
+    </varlistentry>
+    <varlistentry><term>space-before"<replaceable>n</replaceable>"</term>
+      <listitem>
+        <para>FIXME: the amount of space needed before the
+          [something]? In what units? pt?.</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+</refparameter>
+</doc:pi>
+<xsl:template name="pi.dbfo-need">
+  <xsl:variable name="pi-height">
+    <xsl:call-template name="dbfo-attribute">
+      <xsl:with-param name="pis" select="."/>
+      <xsl:with-param name="attribute" select="'height'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="height">
+    <xsl:choose>
+      <xsl:when test="$pi-height != ''">
+        <xsl:value-of select="$pi-height"/>
+      </xsl:when>
+      <xsl:otherwise>0pt</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="pi-before">
+    <xsl:call-template name="dbfo-attribute">
+      <xsl:with-param name="pis" select="."/>
+      <xsl:with-param name="attribute" select="'space-before'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="spacer">
+    <fo:block-container width="100%" height="{$height}">
+      <fo:block><fo:leader leader-length="0pt"/></fo:block>
+    </fo:block-container>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$fop.extensions != 0">
+      <!-- Doesn't work in fop -->
+    </xsl:when>
+    <xsl:when test="$pi-before != '' and
+                    not(following-sibling::listitem) and
+                    not(following-sibling::step)">
+      <fo:block space-after="0pt" space-before="{$pi-before}">
+        <xsl:copy-of select="$spacer"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="following-sibling::para">
+      <fo:block space-after="0pt" 
+                xsl:use-attribute-sets="normal.para.spacing">
+        <xsl:copy-of select="$spacer"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="following-sibling::table or
+                    following-sibling::figure or
+                    following-sibling::example or
+                    following-sibling::equation">
+      <fo:block space-after="0pt" 
+                xsl:use-attribute-sets="formal.object.properties">
+        <xsl:copy-of select="$spacer"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="following-sibling::informaltable or
+                    following-sibling::informalfigure or
+                    following-sibling::informalexample or
+                    following-sibling::informalequation">
+      <fo:block space-after="0pt" 
+                xsl:use-attribute-sets="informal.object.properties">
+        <xsl:copy-of select="$spacer"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="following-sibling::itemizedlist or
+                    following-sibling::orderedlist or
+                    following-sibling::variablelist or
+                    following-sibling::simplelist">
+      <fo:block space-after="0pt" 
+                xsl:use-attribute-sets="informal.object.properties">
+        <xsl:copy-of select="$spacer"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:when test="following-sibling::listitem or
+                    following-sibling::step">
+      <fo:list-item space-after="0pt" 
+                xsl:use-attribute-sets="informal.object.properties">
+        <fo:list-item-label/>
+        <fo:list-item-body start-indent="0pt" end-indent="0pt">
+          <xsl:copy-of select="$spacer"/>
+        </fo:list-item-body>
+      </fo:list-item>
+    </xsl:when>
+    <xsl:when test="following-sibling::sect1 or
+                    following-sibling::sect2 or
+                    following-sibling::sect3 or
+                    following-sibling::sect4 or
+                    following-sibling::sect5 or
+                    following-sibling::section">
+      <fo:block space-after="0pt" 
+                xsl:use-attribute-sets="section.title.properties">
+        <xsl:copy-of select="$spacer"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block space-after="0pt" space-before="0em">
+        <xsl:copy-of select="$spacer"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:choose>
+    <xsl:when test="$fop.extensions != 0">
+      <!-- Doesn't work in fop -->
+    </xsl:when>
+    <xsl:when test="following-sibling::listitem or
+                    following-sibling::step">
+      <fo:list-item space-before.precedence="force"
+                space-before="-{$height}"
+                space-after="0pt"
+                space-after.precedence="force">
+        <fo:list-item-label/>
+        <fo:list-item-body start-indent="0pt" end-indent="0pt"/>
+      </fo:list-item>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block space-before.precedence="force"
+                space-before="-{$height}"
+                space-after="0pt"
+                space-after.precedence="force">
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="dbfo-attribute">
+  <!-- * dbfo-attribute is an interal utility template for retrieving -->
+  <!-- * pseudo-attributes/parameters from PIs -->
+  <xsl:param name="pis" select="processing-instruction('dbfo')"/>
+  <xsl:param name="attribute">filename</xsl:param>
+  <xsl:call-template name="pi-attribute">
+    <xsl:with-param name="pis" select="$pis"/>
+    <xsl:with-param name="attribute" select="$attribute"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<xsl:template match="processing-instruction()">
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="processing-instruction('dbfo-need')">
+  <xsl:call-template name="pi.dbfo-need"/>
+</xsl:template>
+
+</xsl:stylesheet>

+ 284 - 0
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$
+     ********************************************************************
+
+     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>

+ 76 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/ptc.xsl

@@ -0,0 +1,76 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		xmlns:fo="http://www.w3.org/1999/XSL/Format"
+		version="1.0">
+
+<!-- ================================================================ -->
+<!--                                                                  -->
+<!-- PTC/Arbortext Code for XSL 1.1 bookmark support                  -->
+<!--                                                                  -->
+<!-- ================================================================ -->
+
+<xsl:param name="ati.xsl11.bookmarks" select="1"/>
+
+<xsl:variable name="ati-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="ati-a-asc" select=
+"'aaaccccddeeeeeegggghhiiiiijklllllnnnnooorrrsssstttuuuuuuwyzzzAAACCCCDDEEEEEEGGGGHHIIIIIJKLLLLLNNNNOOORRRSSSSTTTUUUUUUWYYZZZ'"/>
+
+<xsl:template match="*" mode="ati.xsl11.bookmarks">
+  <xsl:apply-templates select="*" mode="ati.xsl11.bookmarks"/>
+</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="ati.xsl11.bookmarks">
+  <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::*">
+      <fo:bookmark internal-destination="{$id}">
+        <fo:bookmark-title>
+          <xsl:value-of select="translate($bookmark-label, $ati-a-dia, $ati-a-asc)"/>
+        </fo:bookmark-title>
+        <xsl:apply-templates select="*" mode="ati.xsl11.bookmarks"/>
+      </fo:bookmark>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:bookmark internal-destination="{$id}">
+        <fo:bookmark-title>
+          <xsl:value-of select="translate($bookmark-label, $ati-a-dia, $ati-a-asc)"/>
+        </fo:bookmark-title>
+      </fo:bookmark>
+
+      <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 section|sect1|refentry
+                        |article|bibliography|glossary
+                        |appendix">
+        <fo:bookmark internal-destination="toc...{$id}">
+          <fo:bookmark-title>
+            <xsl:call-template name="gentext">
+              <xsl:with-param name="key" select="'TableofContents'"/>
+            </xsl:call-template>
+          </fo:bookmark-title>
+        </fo:bookmark>
+      </xsl:if>
+      <xsl:apply-templates select="*" mode="ati.xsl11.bookmarks"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 393 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/qandaset.xsl

@@ -0,0 +1,393 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="qandaset" name="process.qandaset">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="label-width">
+    <xsl:call-template name="pi.dbfo_label-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="label-length">
+    <xsl:choose>
+      <xsl:when test="$label-width != ''">
+        <xsl:value-of select="$label-width"/>
+      </xsl:when>
+      <xsl:when test="descendant::label">
+        <xsl:call-template name="longest.term">
+          <xsl:with-param name="terms" select="descendant::label"/>
+          <xsl:with-param name="maxlength" select="20"/>
+        </xsl:call-template>
+        <xsl:text>em * 0.50</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>2.5em</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  
+  <xsl:variable name="toc">
+    <xsl:call-template name="pi.dbfo_toc"/>
+  </xsl:variable>
+
+  <xsl:variable name="toc.params">
+    <xsl:call-template name="find.path.params">
+      <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="content">
+    <fo:block id="{$id}">
+      <xsl:choose>
+        <xsl:when test="parent::*">
+          <xsl:if test="blockinfo/title|info/title|title">
+            <xsl:apply-templates select="(blockinfo/title|
+                                          info/title|title)[1]"/>
+          </xsl:if>
+        </xsl:when>
+        <!-- If it is the root element -->
+        <xsl:otherwise>
+          <xsl:call-template name="qandaset.titlepage"/>
+        </xsl:otherwise>
+      </xsl:choose>
+  
+      <xsl:if test="(contains($toc.params, 'toc') and $toc != '0') 
+                    or $toc = '1'">
+        <xsl:call-template name="qandaset.toc">
+          <xsl:with-param name="toc.title.p"
+                          select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+      </xsl:if>
+
+      <xsl:call-template name="qandaset.toc.separator"/>
+
+      <xsl:apply-templates select="*[local-name(.) != 'title'
+                                   and local-name(.) != 'titleabbrev'
+                                   and local-name(.) != 'qandadiv'
+                                   and local-name(.) != 'qandaentry']"/>
+      <xsl:apply-templates select="qandadiv"/>
+  
+      <xsl:if test="qandaentry">
+        <fo:list-block xsl:use-attribute-sets="list.block.spacing"
+                       provisional-label-separation="0.2em">
+          <xsl:attribute name="provisional-distance-between-starts">
+            <xsl:choose>
+              <xsl:when test="$label-length != ''">
+                <xsl:value-of select="$label-length"/>
+              </xsl:when>
+              <xsl:otherwise>2.5em</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+          <xsl:apply-templates select="qandaentry"/>
+        </fo:list-block>
+      </xsl:if>
+    </fo:block>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="parent::*">
+      <xsl:copy-of select="$content"/>
+    </xsl:when>
+    <!-- Otherwise create a page sequence -->
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="page.sequence">
+        <xsl:with-param name="content" select="$content"/>
+        <xsl:with-param name="master-reference" select="'body'"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+  
+</xsl:template>
+
+<xsl:template match="qandaset/blockinfo/title|qandset/info/title|qandaset/title">
+  <xsl:variable name="enclsect" select="(ancestor::section
+                                        | ancestor::simplesect
+                                        | ancestor::sect5
+                                        | ancestor::sect4
+                                        | ancestor::sect3
+                                        | ancestor::sect2
+                                        | ancestor::sect1
+                                        | ancestor::refsect3
+                                        | ancestor::refsect2
+                                        | ancestor::refsect1)[last()]"/>
+  <xsl:variable name="sectlvl">
+    <xsl:call-template name="section.level">
+      <xsl:with-param name="node" select="$enclsect"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:call-template name="qanda.heading">
+    <xsl:with-param name="level" select="$sectlvl + 1"/>
+    <xsl:with-param name="marker" select="0"/>
+    <xsl:with-param name="title">
+      <xsl:apply-templates/>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="qandaset/blockinfo|qandaset/info">
+  <!-- what should this template really do? -->
+  <xsl:apply-templates select="legalnotice" mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="qandadiv">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="label-width">
+    <xsl:call-template name="pi.dbfo_label-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="label-length">
+    <xsl:choose>
+      <xsl:when test="$label-width != ''">
+        <xsl:value-of select="$label-width"/>
+      </xsl:when>
+      <xsl:when test="descendant::label">
+        <xsl:call-template name="longest.term">
+          <xsl:with-param name="terms" select="descendant::label"/>
+          <xsl:with-param name="maxlength" select="20"/>
+        </xsl:call-template>
+        <xsl:text>*0.6em</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>2.5em</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:apply-templates select="(blockinfo/title|info/title|title)[1]"/>
+    <xsl:apply-templates select="*[local-name(.) != 'title'
+                                 and local-name(.) != 'titleabbrev'
+                                 and local-name(.) != 'qandadiv'
+                                 and local-name(.) != 'qandaentry']"/>
+    <fo:block>
+      <xsl:apply-templates select="qandadiv"/>
+
+      <xsl:if test="qandaentry">
+        <fo:list-block xsl:use-attribute-sets="list.block.spacing"
+                       provisional-label-separation="0.2em">
+          <xsl:attribute name="provisional-distance-between-starts">
+            <xsl:choose>
+              <xsl:when test="$label-length != ''">
+                <xsl:value-of select="$label-length"/>
+              </xsl:when>
+              <xsl:otherwise>2.5em</xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+          <xsl:apply-templates select="qandaentry"/>
+        </fo:list-block>
+      </xsl:if>
+    </fo:block>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="qandadiv/blockinfo/title|qandadiv/info/title|qandadiv/title">
+  <xsl:variable name="enclsect" select="(ancestor::section
+                                        | ancestor::simplesect
+                                        | ancestor::sect5
+                                        | ancestor::sect4
+                                        | ancestor::sect3
+                                        | ancestor::sect2
+                                        | ancestor::sect1
+                                        | ancestor::refsect3
+                                        | ancestor::refsect2
+                                        | ancestor::refsect1)[last()]"/>
+  <xsl:variable name="sectlvl">
+    <xsl:call-template name="section.level">
+      <xsl:with-param name="node" select="$enclsect"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:call-template name="qanda.heading">
+    <xsl:with-param name="level"  select="$sectlvl + 1 + count(ancestor::qandadiv)"/>
+    <xsl:with-param name="marker" select="0"/>
+    <xsl:with-param name="title">
+      <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
+      <xsl:if test="$qandadiv.autolabel != 0">
+        <xsl:apply-templates select="." mode="intralabel.punctuation"/>
+        <xsl:text> </xsl:text>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="qandaentry">
+  <!-- Omit revhistory from fo:list-block because it is a table -->
+  <xsl:apply-templates select="question|answer"/>
+</xsl:template>
+
+<xsl:template match="question">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="entry.id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="parent::*"/>
+    </xsl:call-template>
+  </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="label.content">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:if test="$deflabel = 'number' and not(label)">
+          <xsl:apply-templates select="." mode="intralabel.punctuation"/>
+        </xsl:if>
+      </xsl:variable>
+
+  <fo:list-item id="{$entry.id}" xsl:use-attribute-sets="list.item.spacing">
+    <fo:list-item-label id="{$id}" end-indent="label-end()">
+        <xsl:if test="string-length($label.content) &gt; 0">
+			<fo:block font-weight="bold">
+			  <xsl:copy-of select="$label.content"/>          
+			</fo:block>
+        </xsl:if>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:choose>
+        <xsl:when test="$deflabel = 'none' and not(label)">
+          <fo:block font-weight="bold">
+            <xsl:apply-templates select="*[local-name(.)!='label']"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="*[local-name(.)!='label']"/>
+        </xsl:otherwise>
+      </xsl:choose>
+      <!-- Uncomment this line to get revhistory output in the question -->
+      <!-- <xsl:apply-templates select="preceding-sibling::revhistory"/> -->
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<xsl:template match="answer">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+  <xsl:variable name="entry.id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="parent::*"/>
+    </xsl:call-template>
+  </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="answer.label">
+        <xsl:apply-templates select="." mode="label.markup"/>
+      </xsl:variable>
+
+  <fo:list-item xsl:use-attribute-sets="list.item.spacing">
+    <fo:list-item-label id="{$id}" end-indent="label-end()">
+      <xsl:choose>
+        <xsl:when test="string-length($answer.label) &gt; 0">
+			<fo:block font-weight="bold">
+			  <xsl:copy-of select="$answer.label"/>
+			</fo:block>
+        </xsl:when>
+        <xsl:otherwise>
+			<fo:block/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:list-item-label>
+    <fo:list-item-body start-indent="body-start()">
+      <xsl:apply-templates select="*[local-name(.)!='label' and local-name(.) != 'qandaentry']"/>
+      <!-- * handle nested answer/qandaentry instances -->
+      <!-- * (bug 1509043 from Daniel Leidert) -->
+      <xsl:if test="descendant::question">
+        <xsl:call-template name="process.qandaset"/>
+      </xsl:if>
+    </fo:list-item-body>
+  </fo:list-item>
+</xsl:template>
+
+<xsl:template match="label">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template name="qanda.heading">
+  <xsl:param name="level" select="1"/>
+  <xsl:param name="marker" select="0"/>
+  <xsl:param name="title"/>
+  <xsl:param name="titleabbrev"/>
+
+  <fo:block xsl:use-attribute-sets="qanda.title.properties">
+    <xsl:if test="$marker != 0">
+      <fo:marker marker-class-name="section.head.marker">
+        <xsl:choose>
+          <xsl:when test="$titleabbrev = ''">
+            <xsl:value-of select="$title"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$titleabbrev"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:marker>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="$level=1">
+        <fo:block xsl:use-attribute-sets="qanda.title.level1.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=2">
+        <fo:block xsl:use-attribute-sets="qanda.title.level2.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=3">
+        <fo:block xsl:use-attribute-sets="qanda.title.level3.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=4">
+        <fo:block xsl:use-attribute-sets="qanda.title.level4.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=5">
+        <fo:block xsl:use-attribute-sets="qanda.title.level5.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:otherwise>
+        <fo:block xsl:use-attribute-sets="qanda.title.level6.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:block>
+</xsl:template>
+
+</xsl:stylesheet>

+ 637 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/refentry.xsl

@@ -0,0 +1,637 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="reference">
+   <xsl:if test="not(partintro)">
+    <xsl:variable name="id">
+      <xsl:call-template name="object.id"/>
+    </xsl:variable>
+    <xsl:variable name="master-reference">
+      <xsl:call-template name="select.pagemaster"/>
+    </xsl:variable>
+
+    <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="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="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 id="{$id}">
+          <xsl:call-template name="reference.titlepage"/>
+        </fo:block>
+        <!-- Create one page sequence if no pagebreaks needed -->
+        <xsl:if test="$refentry.pagebreak = 0">
+          <xsl:apply-templates select="refentry"/>
+        </xsl:if>
+      </fo:flow>
+    </fo:page-sequence>
+  </xsl:if>
+  <xsl:apply-templates select="partintro"/>
+  <xsl:if test="$refentry.pagebreak != 0">
+    <xsl:apply-templates select="refentry"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="reference" mode="reference.titlepage.mode">
+  <xsl:call-template name="reference.titlepage"/>
+</xsl:template>
+
+<xsl:template match="reference/partintro">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="ancestor::reference"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}">
+        <xsl:apply-templates select=".." mode="reference.titlepage.mode"/>
+      </fo:block>
+      <xsl:if test="title">
+        <xsl:call-template name="partintro.titlepage"/>
+      </xsl:if>
+      <xsl:apply-templates/>
+      <!-- Create one page sequence if no pagebreaks needed -->
+      <xsl:if test="$refentry.pagebreak = 0">
+        <xsl:apply-templates select="../refentry"/>
+      </xsl:if>
+    </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="reference/docinfo|refentry/refentryinfo"></xsl:template>
+<xsl:template match="reference/info"></xsl:template>
+<xsl:template match="reference/title"></xsl:template>
+<xsl:template match="reference/subtitle"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="refentry">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <xsl:variable name="refentry.content">
+    <fo:block id="{$id}">
+      <xsl:apply-templates/>
+    </fo:block>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="not(parent::*) or 
+                    (parent::reference and $refentry.pagebreak != 0) or 
+                    parent::part">
+      <!-- make a page sequence -->
+      <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="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="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>
+
+          <xsl:copy-of select="$refentry.content"/>
+        </fo:flow>
+      </fo:page-sequence>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block>
+        <xsl:if test="$refentry.pagebreak != 0">
+          <xsl:attribute name="break-before">page</xsl:attribute>
+        </xsl:if>
+        <xsl:copy-of select="$refentry.content"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="refmeta">
+</xsl:template>
+
+<xsl:template match="manvolnum">
+  <xsl:if test="$refentry.xref.manvolnum != 0">
+    <xsl:text>(</xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>)</xsl:text>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="refmiscinfo">
+</xsl:template>
+
+<xsl:template match="refentrytitle">
+  <xsl:call-template name="inline.charseq"/>
+</xsl:template>
+
+<xsl:template match="refnamediv">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+
+    <!-- if refentry.generate.name is non-zero, then we need to generate a -->
+    <!-- localized "Name" subheading for this refnamdiv (unless it has a -->
+    <!-- preceding sibling that is a refnamediv, in which case we have already -->
+    <!-- generated a "Name" subheading, so we don't need to do it again -->
+    <xsl:if test="$refentry.generate.name != 0">
+        <xsl:choose>
+          <xsl:when test="preceding-sibling::refnamediv">
+            <!-- no generated title on secondary refnamedivs! -->
+          </xsl:when>
+          <xsl:otherwise>
+            <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                      xsl:use-attribute-sets="refnamediv.titlepage.recto.style"
+                      font-family="{$title.fontset}">
+              <!-- Contents of what is now the format.refentry.subheading -->
+              <!-- template were formerly intended to be used only to -->
+              <!-- process those subsections of Refentry that have "real" -->
+              <!-- title children. So as a kludge to get around the fact -->
+              <!-- that the template still basically "expects" to be -->
+              <!-- processing that kind of a node, when we call the -->
+              <!-- template to process generated titles, we must call it -->
+              <!-- with values for the "offset" and "section" parameters -->
+              <!-- that are different from the default values in the -->
+              <!-- format.refentry.subheading template itself. Because -->
+              <!-- those defaults are the values appropriate for processing -->
+              <!-- "real" title nodes. -->
+              <xsl:call-template name="format.refentry.subheading">
+                <xsl:with-param name="section" select="self::*"/>
+                <xsl:with-param name="offset" select="1"/>
+                <xsl:with-param name="gentext.key" select="'RefName'"/>
+              </xsl:call-template>
+            </fo:block>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:if>
+
+      <xsl:if test="$refentry.generate.title != 0">
+  <xsl:variable name="section.level">
+    <xsl:call-template name="refentry.level">
+      <xsl:with-param name="node" select="ancestor::refentry"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="reftitle">
+        <xsl:choose>
+          <xsl:when test="../refmeta/refentrytitle">
+            <xsl:apply-templates select="../refmeta/refentrytitle"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="refname[1]"/>
+          </xsl:otherwise>
+        </xsl:choose>
+  </xsl:variable>
+
+  <!-- xsl:use-attribute-sets takes only a Qname, not a variable -->
+    <xsl:choose>
+      <xsl:when test="preceding-sibling::refnamediv">
+	<!-- no title on secondary refnamedivs! -->
+      </xsl:when>
+      <xsl:when test="$section.level = 1">
+        <fo:block xsl:use-attribute-sets="refentry.title.properties">
+          <fo:block xsl:use-attribute-sets="section.title.level1.properties">
+            <xsl:value-of select="$reftitle"/>
+          </fo:block>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$section.level = 2">
+        <fo:block xsl:use-attribute-sets="refentry.title.properties">
+          <fo:block xsl:use-attribute-sets="section.title.level2.properties">
+            <xsl:value-of select="$reftitle"/>
+          </fo:block>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$section.level = 3">
+        <fo:block xsl:use-attribute-sets="refentry.title.properties">
+          <fo:block xsl:use-attribute-sets="section.title.level3.properties">
+            <xsl:value-of select="$reftitle"/>
+          </fo:block>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$section.level = 4">
+        <fo:block xsl:use-attribute-sets="refentry.title.properties">
+          <fo:block xsl:use-attribute-sets="section.title.level4.properties">
+            <xsl:value-of select="$reftitle"/>
+          </fo:block>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$section.level = 5">
+        <fo:block xsl:use-attribute-sets="refentry.title.properties">
+          <fo:block xsl:use-attribute-sets="section.title.level5.properties">
+            <xsl:value-of select="$reftitle"/>
+          </fo:block>
+        </fo:block>
+      </xsl:when>
+      <xsl:otherwise>
+        <fo:block xsl:use-attribute-sets="refentry.title.properties">
+          <fo:block xsl:use-attribute-sets="section.title.level6.properties">
+            <xsl:value-of select="$reftitle"/>
+          </fo:block>
+        </fo:block>
+      </xsl:otherwise>
+    </xsl:choose>
+    </xsl:if>
+
+    <fo:block>
+      <xsl:if test="not(following-sibling::refnamediv)">
+	<xsl:attribute name="space-after">1em</xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </fo:block>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="refname">
+  <xsl:if test="not(preceding-sibling::refdescriptor)">
+    <xsl:apply-templates/>
+    <xsl:if test="following-sibling::refname">
+      <xsl:text>, </xsl:text>
+    </xsl:if>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="refpurpose">
+  <xsl:if test="node()">
+    <xsl:text> </xsl:text>
+    <xsl:call-template name="dingbat">
+      <xsl:with-param name="dingbat">em-dash</xsl:with-param>
+    </xsl:call-template>
+    <xsl:text> </xsl:text>
+    <xsl:apply-templates/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="refdescriptor">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="refclass">
+  <xsl:if test="$refclass.suppress = 0">
+  <fo:block font-weight="bold">
+    <xsl:if test="@role">
+      <xsl:value-of select="@role"/>
+      <xsl:text>: </xsl:text>
+    </xsl:if>
+    <xsl:apply-templates/>
+  </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="refsynopsisdiv">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:if test="not(refsynopsisdivinfo/title|docinfo/title|info/title|title)">
+      <!-- * if we there is no appropriate title for this Refsynopsisdiv, -->
+      <!-- * then we need to call format.refentry.subheading to generate one -->
+      <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                xsl:use-attribute-sets="refsynopsisdiv.titlepage.recto.style"
+                font-family="{$title.fontset}">
+        <!-- Contents of what is now the format.refentry.subheading -->
+        <!-- template were formerly intended to be used only to -->
+        <!-- process those subsections of Refentry that have "real" -->
+        <!-- title children. So as a kludge to get around the fact -->
+        <!-- that the template still basically "expects" to be -->
+        <!-- processing that kind of a node, when we call the -->
+        <!-- template to process generated titles, we must call it -->
+        <!-- with values for the "offset" and "section" parameters -->
+        <!-- that are different from the default values in the -->
+        <!-- format.refentry.subheading template itself. Because -->
+        <!-- those defaults are the values appropriate for processing -->
+        <!-- "real" title nodes. -->
+        <xsl:call-template name="format.refentry.subheading">
+          <xsl:with-param name="section" select="parent::*"/>
+          <xsl:with-param name="offset" select="1"/>
+          <xsl:with-param name="gentext.key" select="'RefSynopsisDiv'"/>
+        </xsl:call-template>
+      </fo:block>
+    </xsl:if>
+    <xsl:call-template name="refsynopsisdiv.titlepage"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="refsection">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:call-template name="refsection.titlepage"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="refsect1">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:call-template name="refsect1.titlepage"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="refsect2">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:call-template name="refsect2.titlepage"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="refsect3">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:call-template name="refsect3.titlepage"/>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="refsynopsisdiv/title
+                     |refsection/title
+                     |refsect1/title
+                     |refsect2/title
+                     |refsect3/title">
+  <!-- nop; titlepage.mode instead -->
+</xsl:template>
+
+<xsl:template match="refsynopsisdiv/title
+                     |refsection/title
+                     |refsect1/title
+                     |refsect2/title
+                     |refsect3/title
+                     |refsynopsisdiv/info/title
+                     |refsection/info/title
+                     |refsect1/info/title
+                     |refsect2/info/title
+                     |refsect3/info/title"
+              mode="titlepage.mode"
+              priority="2">
+  <xsl:call-template name="format.refentry.subheading"/>
+</xsl:template>
+
+<xsl:template name="format.refentry.subheading">
+<!-- This template is now called to process generated titles for -->
+<!-- Refnamediv and Refsynopsisdiv, as well as "real" titles for -->
+<!-- Refsynopsisdiv, Refsection, and Refsect[1-3]. -->
+<!-- -->
+<!-- But the contents of this template were formerly intended to be used -->
+<!-- only to process those subsections of Refentry that have "real" title -->
+<!-- children. So as a kludge to get around the fact that the template -->
+<!-- still basically "expects" to be processing that kind of a node, the -->
+<!-- "offset" parameter was added and the "section" variable was changed to -->
+<!-- a parameter so that when called for a generated title on a Refnamediv -->
+<!-- or Refsynopsisdiv, we can call it like this: -->
+<!-- -->
+<!--     <xsl:call-template name="format.refentry.subheading"> -->
+<!--       <xsl:with-param name="section" select="self::*"/> -->
+<!--       <xsl:with-param name="offset" select="1"/> -->
+<!--       <xsl:with-param name="gentext.key" select="'RefName'"/> -->
+<!--     </xsl:call-template> -->
+<!-- -->
+  <xsl:param name="section" 
+             select="(ancestor::refsynopsysdiv 
+                     |ancestor::refsection
+                     |ancestor::refsect1
+                     |ancestor::refsect2
+                     |ancestor::refsect3)[last()]"/>
+  <xsl:param name="offset" select="0"/>
+  <xsl:param name="gentext.key"/>
+
+  <fo:block keep-with-next.within-column="always">
+    <xsl:variable name="id">
+      <xsl:call-template name="object.id">
+        <xsl:with-param name="object" select="$section"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:variable name="level">
+      <xsl:call-template name="section.level">
+        <xsl:with-param name="node" select="$section"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:variable name="title">
+      <!-- If we have a non-empty value for the $gentext.key param, then we -->
+      <!-- generate an appropriate title here. Otherwise, we have a real -->
+      <!-- title child, so we copy contents of that to the result tree. -->
+      <xsl:choose>
+        <xsl:when test="$gentext.key != ''">
+          <xsl:call-template name="gentext">
+            <xsl:with-param name="key" select="$gentext.key"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="$section" mode="object.title.markup">
+            <xsl:with-param name="allow-anchors" select="1"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:if test="$passivetex.extensions != 0">
+      <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex" 
+                      fotex-bookmark-level="{$level + 2 + $offset}" 
+                      fotex-bookmark-label="{$id}">
+        <xsl:value-of select="$title"/>
+      </fotex:bookmark>
+    </xsl:if>
+
+    <xsl:if test="$axf.extensions != 0">
+      <xsl:attribute name="axf:outline-level">
+        <xsl:value-of select="count(ancestor::*)-1 + $offset"/>
+      </xsl:attribute>
+      <xsl:attribute name="axf:outline-expand">false</xsl:attribute>
+      <xsl:attribute name="axf:outline-title">
+        <xsl:value-of select="$title"/>
+      </xsl:attribute>
+    </xsl:if>
+
+    <xsl:call-template name="section.heading">
+      <xsl:with-param name="level" select="$level + $offset"/>
+      <xsl:with-param name="title" select="$title"/>
+    </xsl:call-template>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="refsectioninfo|refsection/info"></xsl:template>
+<xsl:template match="refsect1info|refsect1/info"></xsl:template>
+<xsl:template match="refsect2info|refsect2/info"></xsl:template>
+<xsl:template match="refsect3info|refsect3/info"></xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 764 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/sections.xsl

@@ -0,0 +1,764 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="section">
+  <xsl:choose>
+    <xsl:when test="$rootid = @id or $rootid = @xml:id">
+      <xsl:call-template name="section.page.sequence"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="id">
+        <xsl:call-template name="object.id"/>
+      </xsl:variable>
+
+      <xsl:variable name="renderas">
+        <xsl:choose>
+          <xsl:when test="@renderas = 'sect1'">1</xsl:when>
+          <xsl:when test="@renderas = 'sect2'">2</xsl:when>
+          <xsl:when test="@renderas = 'sect3'">3</xsl:when>
+          <xsl:when test="@renderas = 'sect4'">4</xsl:when>
+          <xsl:when test="@renderas = 'sect5'">5</xsl:when>
+          <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="level">
+        <xsl:choose>
+          <xsl:when test="$renderas != ''">
+            <xsl:value-of select="$renderas"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="section.level"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <!-- xsl:use-attribute-sets takes only a Qname, not a variable -->
+      <xsl:choose>
+        <xsl:when test="$level = 1">
+          <xsl:element name="fo:{$section.container.element}"
+		       use-attribute-sets="section.level1.properties">
+            <xsl:attribute name="id"><xsl:value-of 
+                                select="$id"/></xsl:attribute>
+            <xsl:call-template name="section.content"/>
+          </xsl:element>
+        </xsl:when>
+        <xsl:when test="$level = 2">
+          <xsl:element name="fo:{$section.container.element}"
+		       use-attribute-sets="section.level2.properties">
+            <xsl:attribute name="id"><xsl:value-of 
+                                select="$id"/></xsl:attribute>
+            <xsl:call-template name="section.content"/>
+          </xsl:element>
+        </xsl:when>
+        <xsl:when test="$level = 3">
+          <xsl:element name="fo:{$section.container.element}"
+                       use-attribute-sets="section.level3.properties">
+            <xsl:attribute name="id"><xsl:value-of 
+                                select="$id"/></xsl:attribute>
+            <xsl:call-template name="section.content"/>
+          </xsl:element>
+        </xsl:when>
+        <xsl:when test="$level = 4">
+          <xsl:element name="fo:{$section.container.element}"
+                       use-attribute-sets="section.level4.properties">
+            <xsl:attribute name="id"><xsl:value-of 
+                                select="$id"/></xsl:attribute>
+            <xsl:call-template name="section.content"/>
+          </xsl:element>
+        </xsl:when>
+        <xsl:when test="$level = 5">
+          <xsl:element name="fo:{$section.container.element}"
+		       use-attribute-sets="section.level5.properties">
+            <xsl:attribute name="id"><xsl:value-of 
+                                select="$id"/></xsl:attribute>
+            <xsl:call-template name="section.content"/>
+          </xsl:element>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:element name="fo:{$section.container.element}"
+		       use-attribute-sets="section.level6.properties">
+            <xsl:attribute name="id"><xsl:value-of 
+                                select="$id"/></xsl:attribute>
+            <xsl:call-template name="section.content"/>
+          </xsl:element>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="section.content">
+  <xsl:call-template name="section.titlepage"/>
+
+  <xsl:variable name="toc.params">
+    <xsl:call-template name="find.path.params">
+      <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:if test="contains($toc.params, 'toc')
+                and (count(ancestor::section)+1) &lt;= 
+		$generate.section.toc.level">
+    <xsl:call-template name="section.toc">
+      <xsl:with-param name="toc.title.p" 
+                      select="contains($toc.params, 'title')"/>
+    </xsl:call-template>
+   <xsl:call-template name="section.toc.separator"/>
+  </xsl:if>
+
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="/section" name="section.page.sequence">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}" 
+            xsl:use-attribute-sets="section.level1.properties">
+        <xsl:call-template name="section.titlepage"/>
+      </fo:block>
+
+      <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 (count(ancestor::section)+1) &lt;= 
+		    $generate.section.toc.level">
+        <xsl:call-template name="section.toc">
+          <xsl:with-param name="toc.title.p" 
+                          select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+        <xsl:call-template name="section.toc.separator"/>
+      </xsl:if>
+
+      <xsl:apply-templates/>
+   </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="section/title
+                     |simplesect/title
+                     |sect1/title
+                     |sect2/title
+                     |sect3/title
+                     |sect4/title
+                     |sect5/title
+                     |section/info/title
+                     |simplesect/info/title
+                     |sect1/info/title
+                     |sect2/info/title
+                     |sect3/info/title
+                     |sect4/info/title
+                     |sect5/info/title
+                     |section/sectioninfo/title
+                     |sect1/sect1info/title
+                     |sect2/sect2info/title
+                     |sect3/sect3info/title
+                     |sect4/sect4info/title
+                     |sect5/sect5info/title"
+              mode="titlepage.mode"
+              priority="2">
+
+  <xsl:variable name="section" 
+                select="(ancestor::section |
+                        ancestor::simplesect |
+                        ancestor::sect1 |
+                        ancestor::sect2 |
+                        ancestor::sect3 |
+                        ancestor::sect4 |
+                        ancestor::sect5)[position() = last()]"/>
+
+  <fo:block keep-with-next.within-column="always">
+    <xsl:variable name="id">
+      <xsl:call-template name="object.id">
+        <xsl:with-param name="object" select="$section"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:variable name="renderas">
+      <xsl:choose>
+        <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
+        <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
+        <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
+        <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
+        <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
+        <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+  
+    <xsl:variable name="level">
+      <xsl:choose>
+        <xsl:when test="$renderas != ''">
+          <xsl:value-of select="$renderas"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="section.level">
+            <xsl:with-param name="node" select="$section"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="marker">
+      <xsl:choose>
+        <xsl:when test="$level &lt;= $marker.section.level">1</xsl:when>
+        <xsl:otherwise>0</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="title">
+      <xsl:apply-templates select="$section" mode="object.title.markup">
+        <xsl:with-param name="allow-anchors" select="1"/>
+      </xsl:apply-templates>
+    </xsl:variable>
+
+    <xsl:variable name="marker.title">
+      <xsl:apply-templates select="$section" mode="titleabbrev.markup">
+        <xsl:with-param name="allow-anchors" select="0"/>
+      </xsl:apply-templates>
+    </xsl:variable>
+
+    <xsl:if test="$passivetex.extensions != 0">
+      <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex" 
+                      fotex-bookmark-level="{$level + 2}" 
+                      fotex-bookmark-label="{$id}">
+        <xsl:value-of select="$marker.title"/>
+      </fotex:bookmark>
+    </xsl:if>
+
+    <xsl:if test="$axf.extensions != 0">
+      <xsl:attribute name="axf:outline-level">
+        <xsl:value-of select="count(ancestor::*)-1"/>
+      </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:call-template name="section.heading">
+      <xsl:with-param name="level" select="$level"/>
+      <xsl:with-param name="title" select="$title"/>
+      <xsl:with-param name="marker" select="$marker"/>
+      <xsl:with-param name="marker.title" select="$marker.title"/>
+    </xsl:call-template>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="sect1">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:element name="fo:{$section.container.element}"
+               use-attribute-sets="section.level1.properties">
+    <xsl:attribute name="id"><xsl:value-of 
+                        select="$id"/></xsl:attribute>
+    <xsl:call-template name="sect1.titlepage"/>
+
+    <xsl:variable name="toc.params">
+      <xsl:call-template name="find.path.params">
+        <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:if test="contains($toc.params, 'toc')
+                  and $generate.section.toc.level &gt;= 1">
+      <xsl:call-template name="section.toc">
+        <xsl:with-param name="toc.title.p" 
+                        select="contains($toc.params, 'title')"/>
+      </xsl:call-template>
+      <xsl:call-template name="section.toc.separator"/>
+    </xsl:if>
+
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="/sect1">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <xsl:variable name="master-reference">
+    <xsl:call-template name="select.pagemaster"/>
+  </xsl:variable>
+
+  <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="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="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 id="{$id}" 
+                xsl:use-attribute-sets="section.level1.properties">
+        <xsl:call-template name="sect1.titlepage"/>
+      </fo:block>
+
+      <xsl:variable name="toc.params">
+        <xsl:call-template name="find.path.params">
+          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:if test="contains($toc.params, 'toc')
+                    and $generate.section.toc.level &gt;= 1">
+        <xsl:call-template name="section.toc">
+          <xsl:with-param name="toc.title.p" 
+                          select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+        <xsl:call-template name="section.toc.separator"/>
+      </xsl:if>
+
+      <xsl:apply-templates/>
+   </fo:flow>
+  </fo:page-sequence>
+</xsl:template>
+
+<xsl:template match="sect2">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:element name="fo:{$section.container.element}"
+	       use-attribute-sets="section.level2.properties">
+    <xsl:attribute name="id"><xsl:value-of 
+                        select="$id"/></xsl:attribute>
+    <xsl:call-template name="sect2.titlepage"/>
+
+    <xsl:variable name="toc.params">
+      <xsl:call-template name="find.path.params">
+        <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:if test="contains($toc.params, 'toc')
+                   and $generate.section.toc.level &gt;= 2">
+      <xsl:call-template name="section.toc">
+        <xsl:with-param name="toc.title.p" 
+                        select="contains($toc.params, 'title')"/>
+      </xsl:call-template>
+      <xsl:call-template name="section.toc.separator"/>
+    </xsl:if>
+
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="sect3">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:element name="fo:{$section.container.element}"
+	       use-attribute-sets="section.level3.properties">
+    <xsl:attribute name="id"><xsl:value-of 
+                        select="$id"/></xsl:attribute>
+    <xsl:call-template name="sect3.titlepage"/>
+
+    <xsl:variable name="toc.params">
+      <xsl:call-template name="find.path.params">
+        <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:if test="contains($toc.params, 'toc')
+                  and $generate.section.toc.level &gt;= 3">
+      <xsl:call-template name="section.toc">
+        <xsl:with-param name="toc.title.p" 
+                        select="contains($toc.params, 'title')"/>
+      </xsl:call-template>
+      <xsl:call-template name="section.toc.separator"/>
+    </xsl:if>
+
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="sect4">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:element name="fo:{$section.container.element}"
+	       use-attribute-sets="section.level4.properties">
+    <xsl:attribute name="id"><xsl:value-of 
+                        select="$id"/></xsl:attribute>
+    <xsl:call-template name="sect4.titlepage"/>
+
+    <xsl:variable name="toc.params">
+      <xsl:call-template name="find.path.params">
+        <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:if test="contains($toc.params, 'toc')
+                  and $generate.section.toc.level &gt;= 4">
+      <xsl:call-template name="section.toc">
+        <xsl:with-param name="toc.title.p" 
+                        select="contains($toc.params, 'title')"/>
+      </xsl:call-template>
+      <xsl:call-template name="section.toc.separator"/>
+    </xsl:if>
+
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="sect5">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:element name="fo:{$section.container.element}"
+	       use-attribute-sets="section.level5.properties">
+    <xsl:attribute name="id"><xsl:value-of 
+                        select="$id"/></xsl:attribute>
+    <xsl:call-template name="sect5.titlepage"/>
+
+    <xsl:variable name="toc.params">
+      <xsl:call-template name="find.path.params">
+        <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+      </xsl:call-template>
+    </xsl:variable>
+
+    <xsl:if test="contains($toc.params, 'toc')
+                  and $generate.section.toc.level &gt;= 5">
+      <xsl:call-template name="section.toc">
+        <xsl:with-param name="toc.title.p" 
+                        select="contains($toc.params, 'title')"/>
+      </xsl:call-template>
+      <xsl:call-template name="section.toc.separator"/>
+    </xsl:if>
+
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="simplesect">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:element name="fo:{$section.container.element}">
+    <xsl:attribute name="id"><xsl:value-of 
+                        select="$id"/></xsl:attribute>
+    <xsl:call-template name="simplesect.titlepage"/>
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template match="sectioninfo"></xsl:template>
+<xsl:template match="section/info"></xsl:template>
+<xsl:template match="section/title"></xsl:template>
+<xsl:template match="section/titleabbrev"></xsl:template>
+<xsl:template match="section/subtitle"></xsl:template>
+
+<xsl:template match="sect1info"></xsl:template>
+<xsl:template match="sect1/info"></xsl:template>
+<xsl:template match="sect1/title"></xsl:template>
+<xsl:template match="sect1/titleabbrev"></xsl:template>
+<xsl:template match="sect1/subtitle"></xsl:template>
+
+<xsl:template match="sect2info"></xsl:template>
+<xsl:template match="sect2/info"></xsl:template>
+<xsl:template match="sect2/title"></xsl:template>
+<xsl:template match="sect2/titleabbrev"></xsl:template>
+<xsl:template match="sect2/subtitle"></xsl:template>
+
+<xsl:template match="sect3info"></xsl:template>
+<xsl:template match="sect3/info"></xsl:template>
+<xsl:template match="sect3/title"></xsl:template>
+<xsl:template match="sect3/titleabbrev"></xsl:template>
+<xsl:template match="sect3/subtitle"></xsl:template>
+
+<xsl:template match="sect4info"></xsl:template>
+<xsl:template match="sect4/info"></xsl:template>
+<xsl:template match="sect4/title"></xsl:template>
+<xsl:template match="sect4/titleabbrev"></xsl:template>
+<xsl:template match="sect4/subtitle"></xsl:template>
+
+<xsl:template match="sect5info"></xsl:template>
+<xsl:template match="sect5/info"></xsl:template>
+<xsl:template match="sect5/title"></xsl:template>
+<xsl:template match="sect5/titleabbrev"></xsl:template>
+<xsl:template match="sect5/subtitle"></xsl:template>
+
+<xsl:template match="simplesect/info"></xsl:template>
+<xsl:template match="simplesect/title"></xsl:template>
+<xsl:template match="simplesect/titleabbrev"></xsl:template>
+<xsl:template match="simplesect/subtitle"></xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="section.heading">
+  <xsl:param name="level" select="1"/>
+  <xsl:param name="marker" select="1"/>
+  <xsl:param name="title"/>
+  <xsl:param name="marker.title"/>
+
+  <fo:block xsl:use-attribute-sets="section.title.properties">
+    <xsl:if test="$marker != 0">
+      <fo:marker marker-class-name="section.head.marker">
+        <xsl:copy-of select="$marker.title"/>
+      </fo:marker>
+    </xsl:if>
+
+    <xsl:choose>
+      <xsl:when test="$level=1">
+        <fo:block xsl:use-attribute-sets="section.title.level1.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=2">
+        <fo:block xsl:use-attribute-sets="section.title.level2.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=3">
+        <fo:block xsl:use-attribute-sets="section.title.level3.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=4">
+        <fo:block xsl:use-attribute-sets="section.title.level4.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:when test="$level=5">
+        <fo:block xsl:use-attribute-sets="section.title.level5.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:otherwise>
+        <fo:block xsl:use-attribute-sets="section.title.level6.properties">
+          <xsl:copy-of select="$title"/>
+        </fo:block>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="bridgehead">
+  <xsl:variable name="container"
+                select="(ancestor::appendix
+                        |ancestor::article
+                        |ancestor::bibliography
+                        |ancestor::chapter
+                        |ancestor::glossary
+                        |ancestor::glossdiv
+                        |ancestor::index
+                        |ancestor::partintro
+                        |ancestor::preface
+                        |ancestor::refsect1
+                        |ancestor::refsect2
+                        |ancestor::refsect3
+                        |ancestor::sect1
+                        |ancestor::sect2
+                        |ancestor::sect3
+                        |ancestor::sect4
+                        |ancestor::sect5
+                        |ancestor::section
+                        |ancestor::setindex
+                        |ancestor::simplesect)[last()]"/>
+
+  <xsl:variable name="clevel">
+    <xsl:choose>
+      <xsl:when test="local-name($container) = 'appendix'
+                      or local-name($container) = 'chapter'
+                      or local-name($container) = 'article'
+                      or local-name($container) = 'bibliography'
+                      or local-name($container) = 'glossary'
+                      or local-name($container) = 'index'
+                      or local-name($container) = 'partintro'
+                      or local-name($container) = 'preface'
+                      or local-name($container) = 'setindex'">2</xsl:when>
+      <xsl:when test="local-name($container) = 'glossdiv'">
+        <xsl:value-of select="count(ancestor::glossdiv)+2"/>
+      </xsl:when>
+      <xsl:when test="local-name($container) = 'sect1'
+                      or local-name($container) = 'sect2'
+                      or local-name($container) = 'sect3'
+                      or local-name($container) = 'sect4'
+                      or local-name($container) = 'sect5'
+                      or local-name($container) = 'refsect1'
+                      or local-name($container) = 'refsect2'
+                      or local-name($container) = 'refsect3'
+                      or local-name($container) = 'section'
+                      or local-name($container) = 'simplesect'">
+        <xsl:variable name="slevel">
+          <xsl:call-template name="section.level">
+            <xsl:with-param name="node" select="$container"/>
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:value-of select="$slevel + 1"/>
+      </xsl:when>
+      <xsl:otherwise>2</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="level">
+    <xsl:choose>
+      <xsl:when test="@renderas = 'sect1'">1</xsl:when>
+      <xsl:when test="@renderas = 'sect2'">2</xsl:when>
+      <xsl:when test="@renderas = 'sect3'">3</xsl:when>
+      <xsl:when test="@renderas = 'sect4'">4</xsl:when>
+      <xsl:when test="@renderas = 'sect5'">5</xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$clevel"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="marker">
+    <xsl:choose>
+      <xsl:when test="$level &lt;= $marker.section.level">1</xsl:when>
+      <xsl:otherwise>0</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="marker.title">
+    <xsl:apply-templates/>
+  </xsl:variable>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:call-template name="section.heading">
+      <xsl:with-param name="level" select="$level"/>
+      <xsl:with-param name="title">
+        <xsl:apply-templates/>
+      </xsl:with-param>
+      <xsl:with-param name="marker" select="$marker"/>
+      <xsl:with-param name="marker.title" select="$marker.title"/>
+    </xsl:call-template>
+  </fo:block>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 273 - 0
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$
+     ********************************************************************
+     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>
+

+ 967 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/synop.xsl

@@ -0,0 +1,967 @@
+<?xml version='1.0'?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY RE "&#10;">
+<!ENTITY nbsp "&#160;">
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<!-- synopsis is in verbatim -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="cmdsynopsis">
+  <fo:block xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="cmdsynopsis/command">
+  <xsl:call-template name="inline.monoseq"/>
+  <xsl:text> </xsl:text>
+</xsl:template>
+
+<xsl:template match="cmdsynopsis/command[1]" priority="2">
+  <xsl:call-template name="inline.monoseq"/>
+  <xsl:text> </xsl:text>
+</xsl:template>
+
+<xsl:template match="group|arg" name="group-or-arg">
+  <xsl:variable name="choice" select="@choice"/>
+  <xsl:variable name="rep" select="@rep"/>
+  <xsl:variable name="sepchar">
+    <xsl:choose>
+      <xsl:when test="ancestor-or-self::*/@sepchar">
+        <xsl:value-of select="ancestor-or-self::*/@sepchar"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text> </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:if test="preceding-sibling::*">
+    <xsl:value-of select="$sepchar"/>
+  </xsl:if>
+  <xsl:choose>
+    <xsl:when test="$choice='plain'">
+      <xsl:value-of select="$arg.choice.plain.open.str"/>
+    </xsl:when>
+    <xsl:when test="$choice='req'">
+      <xsl:value-of select="$arg.choice.req.open.str"/>
+    </xsl:when>
+    <xsl:when test="$choice='opt'">
+      <xsl:value-of select="$arg.choice.opt.open.str"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$arg.choice.def.open.str"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:apply-templates/>
+  <xsl:choose>
+    <xsl:when test="$rep='repeat'">
+      <xsl:value-of select="$arg.rep.repeat.str"/>
+    </xsl:when>
+    <xsl:when test="$rep='norepeat'">
+      <xsl:value-of select="$arg.rep.norepeat.str"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$arg.rep.def.str"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:choose>
+    <xsl:when test="$choice='plain'">
+      <xsl:value-of select="$arg.choice.plain.close.str"/>
+    </xsl:when>
+    <xsl:when test="$choice='req'">
+      <xsl:value-of select="$arg.choice.req.close.str"/>
+    </xsl:when>
+    <xsl:when test="$choice='opt'">
+      <xsl:value-of select="$arg.choice.opt.close.str"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$arg.choice.def.close.str"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="group/arg">
+  <xsl:variable name="choice" select="@choice"/>
+  <xsl:variable name="rep" select="@rep"/>
+  <xsl:if test="preceding-sibling::*">
+    <xsl:value-of select="$arg.or.sep"/>
+  </xsl:if>
+  <xsl:call-template name="group-or-arg"/>
+</xsl:template>
+
+<xsl:template match="sbr">
+  <fo:block/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="synopfragmentref">
+  <xsl:variable name="target" select="key('id',@linkend)"/>
+  <xsl:variable name="snum">
+    <xsl:apply-templates select="$target" mode="synopfragment.number"/>
+  </xsl:variable>
+  <fo:inline font-style="italic">
+    <fo:basic-link internal-destination="{@linkend}"
+                   xsl:use-attribute-sets="xref.properties">
+      <xsl:text>(</xsl:text>
+      <xsl:value-of select="$snum"/>
+      <xsl:text>)</xsl:text>
+    </fo:basic-link>
+    <xsl:text>&#160;</xsl:text>
+    <xsl:apply-templates/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="synopfragment" mode="synopfragment.number">
+  <xsl:number format="1"/>
+</xsl:template>
+
+<xsl:template match="synopfragment">
+  <xsl:variable name="snum">
+    <xsl:apply-templates select="." mode="synopfragment.number"/>
+  </xsl:variable>
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <fo:block id="{$id}">
+    <xsl:text>(</xsl:text>
+    <xsl:value-of select="$snum"/>
+    <xsl:text>)</xsl:text>
+    <xsl:text> </xsl:text>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="funcsynopsis">
+  <xsl:call-template name="informal.object"/>
+</xsl:template>
+
+<xsl:template match="funcsynopsisinfo">
+  <fo:block space-after.minimum="0.8em"
+            space-after.optimum="1em"
+            space-after.maximum="1.2em">
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="funcprototype">
+  <fo:block font-family="{$monospace.font.family}"
+          space-before.minimum="0.8em"
+          space-before.optimum="1em"
+          space-before.maximum="1.2em">
+    <xsl:apply-templates/>
+    <xsl:if test="$funcsynopsis.style='kr'">
+      <fo:block
+          space-before.minimum="0.8em"
+          space-before.optimum="1em"
+          space-before.maximum="1.2em">
+      <xsl:apply-templates select="./paramdef" mode="kr-funcsynopsis-mode"/>
+      </fo:block>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="funcdef">
+  <fo:inline font-family="{$monospace.font.family}">
+    <xsl:apply-templates/>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template match="funcdef/function">
+  <xsl:choose>
+    <xsl:when test="$funcsynopsis.decoration != 0">
+      <fo:inline font-weight="bold">
+        <xsl:apply-templates/>
+      </fo:inline>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="void">
+  <xsl:choose>
+    <xsl:when test="$funcsynopsis.style='ansi'">
+      <xsl:text>(void);</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>();</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="varargs">
+  <xsl:text>(...);</xsl:text>
+</xsl:template>
+
+<xsl:template match="paramdef">
+  <xsl:variable name="paramnum">
+    <xsl:number count="paramdef" format="1"/>
+  </xsl:variable>
+  <xsl:if test="$paramnum=1">(</xsl:if>
+  <xsl:choose>
+    <xsl:when test="$funcsynopsis.style='ansi'">
+      <xsl:apply-templates/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="./parameter"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:choose>
+    <xsl:when test="following-sibling::paramdef">
+      <xsl:text>, </xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>);</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="paramdef/parameter">
+  <xsl:choose>
+    <xsl:when test="$funcsynopsis.decoration != 0">
+      <xsl:call-template name="inline.italicseq"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:if test="following-sibling::parameter">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="paramdef" mode="kr-funcsynopsis-mode">
+  <fo:block>
+    <xsl:apply-templates/>
+    <xsl:text>;</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="funcparams">
+  <xsl:text>(</xsl:text>
+  <xsl:apply-templates/>
+  <xsl:text>)</xsl:text>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:variable name="default-classsynopsis-language">java</xsl:variable>
+
+<xsl:template match="classsynopsis
+                     |fieldsynopsis
+                     |methodsynopsis
+                     |constructorsynopsis
+                     |destructorsynopsis">
+  <xsl:param name="language">
+    <xsl:choose>
+      <xsl:when test="@language">
+	<xsl:value-of select="@language"/>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:value-of select="$default-classsynopsis-language"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+
+  <!--
+  <xsl:message>process <xsl:value-of select="local-name(.)"/> in <xsl:value-of select="$language"/></xsl:message>
+  -->
+
+  <xsl:choose>
+    <xsl:when test="$language='java' or $language='Java'">
+      <xsl:apply-templates select="." mode="java"/>
+    </xsl:when>
+    <xsl:when test="$language='perl' or $language='Perl'">
+      <xsl:apply-templates select="." mode="perl"/>
+    </xsl:when>
+    <xsl:when test="$language='idl' or $language='IDL'">
+      <xsl:apply-templates select="." mode="idl"/>
+    </xsl:when>
+    <xsl:when test="$language='cpp' or $language='c++' or $language='C++'">
+      <xsl:apply-templates select="." mode="cpp"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+	<xsl:text>Unrecognized language on </xsl:text>
+        <xsl:value-of select="local-name(.)"/>
+        <xsl:text>: </xsl:text>
+	<xsl:value-of select="$language"/>
+      </xsl:message>
+      <xsl:apply-templates select=".">
+	<xsl:with-param name="language"
+	  select="$default-classsynopsis-language"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="synop-break">
+  <xsl:if test="parent::classsynopsis
+                or (following-sibling::fieldsynopsis
+                    |following-sibling::methodsynopsis
+                    |following-sibling::constructorsynopsis
+                    |following-sibling::destructorsynopsis)">
+    <fo:inline>&RE;</fo:inline>
+  </xsl:if>
+</xsl:template>
+
+<!-- ===== Java ======================================================== -->
+
+<xsl:template match="classsynopsis" mode="java">
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:apply-templates select="ooclass[1]" mode="java"/>
+    <xsl:if test="ooclass[preceding-sibling::*]">
+      <xsl:text> extends</xsl:text>
+      <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="java"/>
+      <xsl:if test="oointerface|ooexception">
+        <xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="oointerface">
+      <xsl:text>implements</xsl:text>
+      <xsl:apply-templates select="oointerface" mode="java"/>
+      <xsl:if test="ooexception">
+	<xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="ooexception">
+      <xsl:text>throws</xsl:text>
+      <xsl:apply-templates select="ooexception" mode="java"/>
+    </xsl:if>
+    <xsl:text>&nbsp;{&RE;</xsl:text>
+    <xsl:apply-templates select="constructorsynopsis
+                                 |destructorsynopsis
+                                 |fieldsynopsis
+                                 |methodsynopsis
+                                 |classsynopsisinfo" mode="java"/>
+    <xsl:text>}</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="classsynopsisinfo" mode="java">
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template match="ooclass|oointerface|ooexception" mode="java">
+  <xsl:choose>
+    <xsl:when test="preceding-sibling::*">
+      <xsl:text>, </xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text> </xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template match="modifier|package" mode="java">
+  <xsl:apply-templates mode="java"/>
+  <xsl:if test="following-sibling::*">
+    <xsl:text>&nbsp;</xsl:text>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="classname" mode="java">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template match="interfacename" mode="java">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template match="exceptionname" mode="java">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template match="fieldsynopsis" mode="java">
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>&nbsp;&nbsp;</xsl:text>
+    <xsl:apply-templates mode="java"/>
+    <xsl:text>;</xsl:text>
+    <xsl:call-template name="synop-break"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="type" mode="java">
+  <xsl:apply-templates mode="java"/>
+  <xsl:text>&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="varname" mode="java">
+  <xsl:apply-templates mode="java"/>
+  <xsl:text>&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="initializer" mode="java">
+  <xsl:text>=&nbsp;</xsl:text>
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template match="void" mode="java">
+  <xsl:text>void&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="methodname" mode="java">
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template match="methodparam" mode="java">
+  <xsl:param name="indent">0</xsl:param>
+  <xsl:if test="preceding-sibling::methodparam">
+    <xsl:text>,&RE;</xsl:text>
+    <xsl:if test="$indent &gt; 0">
+      <xsl:call-template name="copy-string">
+	<xsl:with-param name="string">&nbsp;</xsl:with-param>
+	<xsl:with-param name="count" select="$indent + 1"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:if>
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template match="parameter" mode="java">
+  <xsl:apply-templates mode="java"/>
+</xsl:template>
+
+<xsl:template mode="java"
+  match="constructorsynopsis|destructorsynopsis|methodsynopsis">
+  <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
+  <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
+  <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
+  <xsl:variable name="decl">
+    <xsl:text>  </xsl:text>
+    <xsl:apply-templates select="$start-modifiers" mode="java"/>
+
+    <!-- type -->
+    <xsl:if test="local-name($notmod[1]) != 'methodname'">
+      <xsl:apply-templates select="$notmod[1]" mode="java"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="methodname" mode="java"/>
+  </xsl:variable>
+
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:copy-of select="$decl"/>
+    <xsl:text>(</xsl:text>
+    <xsl:apply-templates select="methodparam" mode="java">
+      <xsl:with-param name="indent" select="string-length($decl)"/>
+    </xsl:apply-templates>
+    <xsl:text>)</xsl:text>
+    <xsl:if test="exceptionname">
+      <xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;throws&nbsp;</xsl:text>
+      <xsl:apply-templates select="exceptionname" mode="java"/>
+    </xsl:if>
+    <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="$end-modifiers" mode="java"/>
+    </xsl:if>
+    <xsl:text>;</xsl:text>
+  </fo:block>
+  <xsl:call-template name="synop-break"/>
+</xsl:template>
+
+<!-- ===== C++ ========================================================= -->
+
+<xsl:template match="classsynopsis" mode="cpp">
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:apply-templates select="ooclass[1]" mode="cpp"/>
+    <xsl:if test="ooclass[preceding-sibling::*]">
+      <xsl:text>: </xsl:text>
+      <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="cpp"/>
+      <xsl:if test="oointerface|ooexception">
+	<xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="oointerface">
+      <xsl:text> implements</xsl:text>
+      <xsl:apply-templates select="oointerface" mode="cpp"/>
+      <xsl:if test="ooexception">
+	<xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="ooexception">
+      <xsl:text> throws</xsl:text>
+      <xsl:apply-templates select="ooexception" mode="cpp"/>
+    </xsl:if>
+    <xsl:text>&nbsp;{&RE;</xsl:text>
+    <xsl:apply-templates select="constructorsynopsis
+                                 |destructorsynopsis
+                                 |fieldsynopsis
+                                 |methodsynopsis
+                                 |classsynopsisinfo" mode="cpp"/>
+    <xsl:text>}</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="classsynopsisinfo" mode="cpp">
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template match="ooclass|oointerface|ooexception" mode="cpp">
+  <xsl:if test="preceding-sibling::*">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template match="modifier|package" mode="cpp">
+  <xsl:apply-templates mode="cpp"/>
+    <xsl:if test="following-sibling::*">
+      <xsl:text>&nbsp;</xsl:text>
+    </xsl:if>
+</xsl:template>
+
+<xsl:template match="classname" mode="cpp">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template match="interfacename" mode="cpp">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template match="exceptionname" mode="cpp">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template match="fieldsynopsis" mode="cpp">
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>&nbsp;&nbsp;</xsl:text>
+    <xsl:apply-templates mode="cpp"/>
+    <xsl:text>;</xsl:text>
+  </fo:block>
+  <xsl:call-template name="synop-break"/>
+</xsl:template>
+
+<xsl:template match="type" mode="cpp">
+  <xsl:apply-templates mode="cpp"/>
+  <xsl:text>&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="varname" mode="cpp">
+  <xsl:apply-templates mode="cpp"/>
+  <xsl:text>&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="initializer" mode="cpp">
+  <xsl:text>=&nbsp;</xsl:text>
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template match="void" mode="cpp">
+  <xsl:text>void&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="methodname" mode="cpp">
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template match="methodparam" mode="cpp">
+  <xsl:if test="preceding-sibling::methodparam">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template match="parameter" mode="cpp">
+  <xsl:apply-templates mode="cpp"/>
+</xsl:template>
+
+<xsl:template mode="cpp"
+  match="constructorsynopsis|destructorsynopsis|methodsynopsis">
+  <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
+  <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
+  <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
+
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>  </xsl:text>
+    <xsl:apply-templates select="$start-modifiers" mode="cpp"/>
+
+    <!-- type -->
+    <xsl:if test="local-name($notmod[1]) != 'methodname'">
+      <xsl:apply-templates select="$notmod[1]" mode="cpp"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="methodname" mode="cpp"/>
+    <xsl:text>(</xsl:text>
+    <xsl:apply-templates select="methodparam" mode="cpp"/>
+    <xsl:text>)</xsl:text>
+    <xsl:if test="exceptionname">
+      <xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;throws&nbsp;</xsl:text>
+      <xsl:apply-templates select="exceptionname" mode="cpp"/>
+    </xsl:if>
+    <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="$end-modifiers" mode="cpp"/>
+    </xsl:if>
+    <xsl:text>;</xsl:text>
+  </fo:block>
+  <xsl:call-template name="synop-break"/>
+</xsl:template>
+
+<!-- ===== IDL ========================================================= -->
+
+<xsl:template match="classsynopsis" mode="idl">
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>interface </xsl:text>
+    <xsl:apply-templates select="ooclass[1]" mode="idl"/>
+    <xsl:if test="ooclass[preceding-sibling::*]">
+      <xsl:text>: </xsl:text>
+      <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="idl"/>
+      <xsl:if test="oointerface|ooexception">
+	<xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="oointerface">
+      <xsl:text> implements</xsl:text>
+      <xsl:apply-templates select="oointerface" mode="idl"/>
+      <xsl:if test="ooexception">
+	<xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="ooexception">
+      <xsl:text> throws</xsl:text>
+      <xsl:apply-templates select="ooexception" mode="idl"/>
+    </xsl:if>
+    <xsl:text>&nbsp;{&RE;</xsl:text>
+    <xsl:apply-templates select="constructorsynopsis
+                                 |destructorsynopsis
+                                 |fieldsynopsis
+                                 |methodsynopsis
+                                 |classsynopsisinfo" mode="idl"/>
+    <xsl:text>}</xsl:text>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="classsynopsisinfo" mode="idl">
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template match="ooclass|oointerface|ooexception" mode="idl">
+  <xsl:if test="preceding-sibling::*">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template match="modifier|package" mode="idl">
+  <xsl:apply-templates mode="idl"/>
+    <xsl:if test="following-sibling::*">
+      <xsl:text>&nbsp;</xsl:text>
+    </xsl:if>
+</xsl:template>
+
+<xsl:template match="classname" mode="idl">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template match="interfacename" mode="idl">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template match="exceptionname" mode="idl">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template match="fieldsynopsis" mode="idl">
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>&nbsp;&nbsp;</xsl:text>
+    <xsl:apply-templates mode="idl"/>
+    <xsl:text>;</xsl:text>
+  </fo:block>
+  <xsl:call-template name="synop-break"/>
+</xsl:template>
+
+<xsl:template match="type" mode="idl">
+  <xsl:apply-templates mode="idl"/>
+  <xsl:text>&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="varname" mode="idl">
+  <xsl:apply-templates mode="idl"/>
+  <xsl:text>&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="initializer" mode="idl">
+  <xsl:text>=&nbsp;</xsl:text>
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template match="void" mode="idl">
+  <xsl:text>void&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="methodname" mode="idl">
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template match="methodparam" mode="idl">
+  <xsl:if test="preceding-sibling::methodparam">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template match="parameter" mode="idl">
+  <xsl:apply-templates mode="idl"/>
+</xsl:template>
+
+<xsl:template mode="idl"
+  match="constructorsynopsis|destructorsynopsis|methodsynopsis">
+  <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
+  <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
+  <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
+
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>  </xsl:text>
+    <xsl:apply-templates select="$start-modifiers" mode="idl"/>
+
+    <!-- type -->
+    <xsl:if test="local-name($notmod[1]) != 'methodname'">
+      <xsl:apply-templates select="$notmod[1]" mode="idl"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="methodname" mode="idl"/>
+    <xsl:text>(</xsl:text>
+    <xsl:apply-templates select="methodparam" mode="idl"/>
+    <xsl:text>)</xsl:text>
+    <xsl:if test="exceptionname">
+      <xsl:text>&RE;&nbsp;&nbsp;&nbsp;&nbsp;raises(</xsl:text>
+      <xsl:apply-templates select="exceptionname" mode="idl"/>
+      <xsl:text>)</xsl:text>
+    </xsl:if>
+    <xsl:if test="modifier[preceding-sibling::*[local-name(.) != 'modifier']]">
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="$end-modifiers" mode="idl"/>
+    </xsl:if>
+    <xsl:text>;</xsl:text>
+  </fo:block>
+  <xsl:call-template name="synop-break"/>
+</xsl:template>
+
+<!-- ===== Perl ======================================================== -->
+
+<xsl:template match="classsynopsis" mode="perl">
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>package </xsl:text>
+    <xsl:apply-templates select="ooclass[1]" mode="perl"/>
+    <xsl:text>;&RE;</xsl:text>
+
+    <xsl:if test="ooclass[preceding-sibling::*]">
+      <xsl:text>@ISA = (</xsl:text>
+      <xsl:apply-templates select="ooclass[preceding-sibling::*]" mode="perl"/>
+      <xsl:text>);&RE;</xsl:text>
+    </xsl:if>
+
+    <xsl:apply-templates select="constructorsynopsis
+                                 |destructorsynopsis
+                                 |fieldsynopsis
+                                 |methodsynopsis
+                                 |classsynopsisinfo" mode="perl"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="classsynopsisinfo" mode="perl">
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template match="ooclass|oointerface|ooexception" mode="perl">
+  <xsl:if test="preceding-sibling::*">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template match="modifier|package" mode="perl">
+  <xsl:apply-templates mode="perl"/>
+    <xsl:if test="following-sibling::*">
+      <xsl:text>&nbsp;</xsl:text>
+    </xsl:if>
+</xsl:template>
+
+<xsl:template match="classname" mode="perl">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'classname'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template match="interfacename" mode="perl">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'interfacename'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template match="exceptionname" mode="perl">
+  <xsl:if test="local-name(preceding-sibling::*[1]) = 'exceptionname'">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template match="fieldsynopsis" mode="perl">
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>&nbsp;&nbsp;</xsl:text>
+    <xsl:apply-templates mode="perl"/>
+    <xsl:text>;</xsl:text>
+  </fo:block>
+  <xsl:call-template name="synop-break"/>
+</xsl:template>
+
+<xsl:template match="type" mode="perl">
+  <xsl:apply-templates mode="perl"/>
+  <xsl:text>&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="varname" mode="perl">
+  <xsl:apply-templates mode="perl"/>
+  <xsl:text>&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="initializer" mode="perl">
+  <xsl:text>=&nbsp;</xsl:text>
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template match="void" mode="perl">
+  <xsl:text>void&nbsp;</xsl:text>
+</xsl:template>
+
+<xsl:template match="methodname" mode="perl">
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template match="methodparam" mode="perl">
+  <xsl:if test="preceding-sibling::methodparam">
+    <xsl:text>, </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template match="parameter" mode="perl">
+  <xsl:apply-templates mode="perl"/>
+</xsl:template>
+
+<xsl:template mode="perl"
+  match="constructorsynopsis|destructorsynopsis|methodsynopsis">
+  <xsl:variable name="start-modifiers" select="modifier[following-sibling::*[local-name(.) != 'modifier']]"/>
+  <xsl:variable name="notmod" select="*[local-name(.) != 'modifier']"/>
+  <xsl:variable name="end-modifiers" select="modifier[preceding-sibling::*[local-name(.) != 'modifier']]"/>
+
+  <fo:block wrap-option='no-wrap'
+            white-space-collapse='false'
+            linefeed-treatment="preserve"
+            xsl:use-attribute-sets="monospace.verbatim.properties">
+    <xsl:text>sub </xsl:text>
+
+    <xsl:apply-templates select="methodname" mode="perl"/>
+    <xsl:text> { ... };</xsl:text>
+    <xsl:call-template name="synop-break"/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!-- * DocBook 5 allows linking elements (link, olink, and xref) -->
+<!-- * within the OO *synopsis elements (classsynopsis, fieldsynopsis, -->
+<!-- * methodsynopsis, constructorsynopsis, destructorsynopsis) and -->
+<!-- * their children. So we need to have mode="java|cpp|idl|perl" -->
+<!-- * per-mode matches for those linking elements in order for them -->
+<!-- * to be processed as expected. -->
+
+<xsl:template match="link|olink|xref" mode="java">
+  <xsl:apply-templates select="."/>
+</xsl:template>
+
+<xsl:template match="link|olink|xref" mode="cpp">
+  <xsl:apply-templates select="."/>
+</xsl:template>
+
+<xsl:template match="link|olink|xref" mode="idl">
+  <xsl:apply-templates select="."/>
+</xsl:template>
+
+<xsl:template match="link|olink|xref" mode="perl">
+  <xsl:apply-templates select="."/>
+</xsl:template>
+
+</xsl:stylesheet>

+ 1549 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/table.xsl

@@ -0,0 +1,1549 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                xmlns:rx="http://www.renderx.com/XSL/Extensions"
+                xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table"
+                xmlns:xtbl="com.nwalsh.xalan.Table"
+                xmlns:lxslt="http://xml.apache.org/xslt"
+                xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table"
+                exclude-result-prefixes="doc stbl xtbl lxslt ptbl"
+                version='1.0'>
+
+<xsl:include href="../common/table.xsl"/>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<doc:reference xmlns="">
+<referenceinfo>
+<releaseinfo role="meta">
+$Id$
+</releaseinfo>
+<author><surname>Walsh</surname>
+<firstname>Norman</firstname></author>
+<copyright><year>1999</year><year>2000</year>
+<holder>Norman Walsh</holder>
+</copyright>
+</referenceinfo>
+<title>Formatting Object Table Reference</title>
+
+<partintro id="partintro">
+<title>Introduction</title>
+
+<para>This is technical reference documentation for the FO
+table-processing templates in the DocBook XSL Stylesheets.</para>
+
+<para>This is not intended to be <quote>user</quote> documentation.
+It is provided for developers writing customization layers for the
+stylesheets, and for anyone who's interested in <quote>how it
+works</quote>.</para>
+
+</partintro>
+</doc:reference>
+
+<!-- ==================================================================== -->
+
+<lxslt:component prefix="xtbl"
+                 functions="adjustColumnWidths"/>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="make.table.content">
+  <xsl:choose>
+    <xsl:when test="tgroup|mediaobject|graphic">
+      <xsl:call-template name="calsTable"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="htmlTable"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="calsTable">
+
+  <xsl:variable name="keep.together">
+    <xsl:call-template name="pi.dbfo_keep-together"/>
+  </xsl:variable>
+
+  <xsl:for-each select="tgroup">
+
+    <fo:table xsl:use-attribute-sets="table.table.properties">
+      <xsl:if test="$keep.together != ''">
+        <xsl:attribute name="keep-together.within-column">
+          <xsl:value-of select="$keep.together"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:call-template name="table.frame"/>
+      <xsl:if test="following-sibling::tgroup">
+        <xsl:attribute name="border-bottom-width">0pt</xsl:attribute>
+        <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+        <xsl:attribute name="padding-bottom">0pt</xsl:attribute>
+        <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
+        <xsl:attribute name="space-after">0pt</xsl:attribute>
+        <xsl:attribute name="space-after.minimum">0pt</xsl:attribute>
+        <xsl:attribute name="space-after.optimum">0pt</xsl:attribute>
+        <xsl:attribute name="space-after.maximum">0pt</xsl:attribute>
+      </xsl:if>
+      <xsl:if test="preceding-sibling::tgroup">
+        <xsl:attribute name="border-top-width">0pt</xsl:attribute>
+        <xsl:attribute name="border-top-style">none</xsl:attribute>
+        <xsl:attribute name="padding-top">0pt</xsl:attribute>
+        <xsl:attribute name="margin-top">0pt</xsl:attribute>
+        <xsl:attribute name="space-before">0pt</xsl:attribute>
+        <xsl:attribute name="space-before.minimum">0pt</xsl:attribute>
+        <xsl:attribute name="space-before.optimum">0pt</xsl:attribute>
+        <xsl:attribute name="space-before.maximum">0pt</xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates select="."/>
+    </fo:table>
+  </xsl:for-each>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!-- Placeholder template enables wrapping a fo:table in
+     another table for purposes of layout or applying
+     extensions such as XEP table-omit-initial-header to
+     create "continued" titles on page breaks. -->
+<xsl:template name="table.layout">
+  <xsl:param name="table.content" select="NOTANODE"/>
+
+  <xsl:copy-of select="$table.content"/>
+</xsl:template>
+
+<xsl:template name="table.block">
+  <xsl:param name="table.layout" select="NOTANODE"/>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <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:choose>
+    <xsl:when test="self::table">
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="table.properties">
+        <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:copy-of select="$table.layout"/>
+        <xsl:call-template name="table.footnote.block"/>
+        <xsl:if test="$placement != 'before'">
+          <xsl:call-template name="formal.object.heading">
+            <xsl:with-param name="placement" select="$placement"/>
+          </xsl:call-template>
+        </xsl:if>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="informaltable.properties">
+        <xsl:copy-of select="$table.layout"/>
+        <xsl:call-template name="table.footnote.block"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+
+
+</xsl:template>
+
+<!-- Output a table's footnotes in a block -->
+<xsl:template name="table.footnote.block">
+  <xsl:if test=".//footnote">
+    <fo:block keep-with-previous.within-column="always">
+      <xsl:apply-templates select=".//footnote" mode="table.footnote.mode"/>
+    </fo:block>
+  </xsl:if>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="table.container">
+  <xsl:param name="table.block"/>
+  <xsl:choose>
+    <xsl:when test="@orient='land' and 
+                    $fop.extensions = 0 and 
+                    $passivetex.extensions = 0" >
+      <fo:block-container reference-orientation="90"
+            padding="6pt"
+            xsl:use-attribute-sets="list.block.spacing">
+        <xsl:attribute name="width">
+          <xsl:call-template name="table.width"/>
+        </xsl:attribute>
+        <fo:block start-indent="0pt" end-indent="0pt">
+          <xsl:copy-of select="$table.block"/>
+        </fo:block>
+      </fo:block-container>
+    </xsl:when>
+    <xsl:when test="@pgwide = 1">
+      <fo:block xsl:use-attribute-sets="pgwide.properties">
+        <xsl:copy-of select="$table.block"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$table.block"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="empty.table.cell">
+  <xsl:param name="colnum" select="0"/>
+
+  <xsl:variable name="rowsep">
+    <xsl:choose>
+      <!-- If this is the last row, rowsep never applies. -->
+      <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
+                          or ancestor-or-self::thead/following-sibling::tbody
+                          or ancestor-or-self::tbody/preceding-sibling::tfoot)">
+        <xsl:value-of select="0"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="inherited.table.attribute">
+          <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
+          <xsl:with-param name="row" select="ancestor-or-self::row[1]"/>
+          <xsl:with-param name="colnum" select="$colnum"/>
+          <xsl:with-param name="attribute" select="'rowsep'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="colsep">
+    <xsl:choose>
+      <!-- If this is the last column, colsep never applies. -->
+      <xsl:when test="number($colnum) &gt;= ancestor::tgroup/@cols">0</xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="inherited.table.attribute">
+          <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
+          <xsl:with-param name="row" select="ancestor-or-self::row[1]"/>
+          <xsl:with-param name="colnum" select="$colnum"/>
+          <xsl:with-param name="attribute" select="'colsep'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:table-cell text-align="center"
+                 display-align="center"
+                 xsl:use-attribute-sets="table.cell.padding">
+    <xsl:if test="$xep.extensions != 0">
+      <!-- Suggested by RenderX to workaround a bug in their implementation -->
+      <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
+    </xsl:if>
+    <xsl:if test="$rowsep &gt; 0">
+      <xsl:call-template name="border">
+        <xsl:with-param name="side" select="'bottom'"/>
+      </xsl:call-template>
+    </xsl:if>
+
+    <xsl:if test="$colsep &gt; 0 and number($colnum) &lt; ancestor::tgroup/@cols">
+      <xsl:call-template name="border">
+        <xsl:with-param name="side" select="'right'"/>
+      </xsl:call-template>
+    </xsl:if>
+
+    <!-- fo:table-cell should not be empty -->
+    <fo:block/>
+  </fo:table-cell>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<xsl:template name="table.frame">
+  <xsl:variable name="frame">
+    <xsl:choose>
+      <xsl:when test="../@frame">
+        <xsl:value-of select="../@frame"/>
+      </xsl:when>
+      <xsl:when test="$default.table.frame != ''">
+        <xsl:value-of select="$default.table.frame"/>
+      </xsl:when>
+      <xsl:otherwise>all</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$frame='all'">
+      <xsl:attribute name="border-left-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-right-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-top-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-left-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-right-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-top-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-left-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-right-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-top-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+    </xsl:when>
+    <xsl:when test="$frame='bottom'">
+      <xsl:attribute name="border-left-style">none</xsl:attribute>
+      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-top-style">none</xsl:attribute>
+      <xsl:attribute name="border-bottom-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+    </xsl:when>
+    <xsl:when test="$frame='sides'">
+      <xsl:attribute name="border-left-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-right-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-top-style">none</xsl:attribute>
+      <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+      <xsl:attribute name="border-left-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-right-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-left-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-right-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+    </xsl:when>
+    <xsl:when test="$frame='top'">
+      <xsl:attribute name="border-left-style">none</xsl:attribute>
+      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-top-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+      <xsl:attribute name="border-top-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-top-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+    </xsl:when>
+    <xsl:when test="$frame='topbot'">
+      <xsl:attribute name="border-left-style">none</xsl:attribute>
+      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-top-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-style">
+        <xsl:value-of select="$table.frame.border.style"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-top-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-width">
+        <xsl:value-of select="$table.frame.border.thickness"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-top-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+      <xsl:attribute name="border-bottom-color">
+        <xsl:value-of select="$table.frame.border.color"/>
+      </xsl:attribute>
+    </xsl:when>
+    <xsl:when test="$frame='none'">
+      <xsl:attribute name="border-left-style">none</xsl:attribute>
+      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-top-style">none</xsl:attribute>
+      <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>Impossible frame on table: </xsl:text>
+        <xsl:value-of select="$frame"/>
+      </xsl:message>
+      <xsl:attribute name="border-left-style">none</xsl:attribute>
+      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-top-style">none</xsl:attribute>
+      <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="border">
+  <xsl:param name="side" select="'left'"/>
+
+  <xsl:attribute name="border-{$side}-width">
+    <xsl:value-of select="$table.cell.border.thickness"/>
+  </xsl:attribute>
+  <xsl:attribute name="border-{$side}-style">
+    <xsl:value-of select="$table.cell.border.style"/>
+  </xsl:attribute>
+  <xsl:attribute name="border-{$side}-color">
+    <xsl:value-of select="$table.cell.border.color"/>
+  </xsl:attribute>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="tgroup" name="tgroup">
+  <xsl:if test="not(@cols) or @cols = '' or string(number(@cols)) = 'NaN'">
+    <xsl:message terminate="yes">
+      <xsl:text>Error: CALS tables must specify the number of columns.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:variable name="table.width">
+    <xsl:call-template name="table.width"/>
+  </xsl:variable>
+
+  <xsl:variable name="colspecs">
+    <xsl:choose>
+      <xsl:when test="$use.extensions != 0
+                      and $tablecolumns.extension != 0">
+        <xsl:call-template name="generate.colgroup.raw">
+          <xsl:with-param name="cols" select="@cols"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="generate.colgroup">
+          <xsl:with-param name="cols" select="@cols"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="prop-columns"
+                select=".//colspec[contains(@colwidth, '*')]"/>
+  <xsl:if test="count($prop-columns) != 0 or
+                $fop.extensions != 0 or
+                $fop1.extensions != 0 or
+                $passivetex.extensions != 0">
+    <xsl:attribute name="table-layout">fixed</xsl:attribute>
+  </xsl:if>
+
+  <xsl:if test="count(preceding-sibling::tgroup) = 0">
+    <!-- If this is the first tgroup, output the width attribute for the -->
+    <!-- surrounding fo:table. (If this isn't the first tgroup, trying   -->
+    <!-- to output the attribute will cause an error.)                   -->
+    <xsl:attribute name="width">
+      <xsl:value-of select="$table.width"/>
+    </xsl:attribute>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="$use.extensions != 0
+                    and $tablecolumns.extension != 0">
+      <xsl:choose>
+        <xsl:when test="function-available('stbl:adjustColumnWidths')">
+          <xsl:copy-of select="stbl:adjustColumnWidths($colspecs)"/>
+        </xsl:when>
+        <xsl:when test="function-available('xtbl:adjustColumnWidths')">
+          <xsl:copy-of select="xtbl:adjustColumnWidths($colspecs)"/>
+        </xsl:when>
+        <xsl:when test="function-available('ptbl:adjustColumnWidths')">
+          <xsl:copy-of select="ptbl:adjustColumnWidths($colspecs)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message terminate="yes">
+            <xsl:text>No adjustColumnWidths function available.</xsl:text>
+          </xsl:message>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$colspecs"/>
+    </xsl:otherwise>
+  </xsl:choose>
+
+  <xsl:apply-templates select="thead"/>
+  <xsl:apply-templates select="tfoot"/>
+  <xsl:apply-templates select="tbody"/>
+</xsl:template>
+
+<xsl:template match="colspec"></xsl:template>
+
+<xsl:template name="table.width">
+
+  <xsl:variable name="numcols">
+    <xsl:call-template name="widest-html-row">
+      <xsl:with-param name="rows" select=".//tr"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="explicit.table.width">
+    <xsl:choose>
+      <xsl:when test="self::entrytbl">
+        <xsl:call-template name="pi.dbfo_table-width"/>
+      </xsl:when>
+      <xsl:when test="self::table or self::informaltable">
+        <xsl:call-template name="pi.dbfo_table-width"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- * no dbfo@table-width PI as a child of this table, so check -->
+        <!-- * the parent of this table to see if the table has any -->
+        <!-- * sibling dbfo@table-width PIs (FIXME: 2007-07 MikeSmith: we -->
+        <!-- * should really instead be checking here just to see if the -->
+        <!-- * first preceding sibling of this table is a -->
+        <!-- * dbfo@table-width PI) -->
+        <xsl:call-template name="pi.dbfo_table-width">
+          <xsl:with-param name="node" select=".."/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="column.sum">
+    <xsl:choose>
+      <!-- CALS table -->
+      <xsl:when test="@cols">
+        <xsl:if test="count(colspec) = @cols">
+          <xsl:for-each select="colspec">
+            <xsl:if test="position() != 1">
+              <xsl:text> + </xsl:text>
+            </xsl:if>
+            <xsl:choose>
+              <xsl:when test="not(@colwidth)">NOWIDTH</xsl:when>
+              <xsl:when test="contains(@colwidth, '*')">NOWIDTH</xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="@colwidth"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- HTML table -->
+        <xsl:if test="count(col|colgroup/col) = $numcols">
+          <xsl:for-each select="col|colgroup/col">
+            <xsl:if test="position() != 1">
+              <xsl:text> + </xsl:text>
+            </xsl:if>
+            <xsl:choose>
+              <xsl:when test="not(@width)">NOWIDTH</xsl:when>
+              <xsl:when test="contains(@width, '%')">NOWIDTH</xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="@width"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </xsl:if>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="column.sum.width">
+    <xsl:if test="not(contains($column.sum, 'NOWIDTH'))">
+      <xsl:value-of select="$column.sum"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:variable name="prop-columns"
+                select=".//colspec[contains(@colwidth, '*')]"/>
+
+  <xsl:variable name="table.width">
+    <xsl:choose>
+      <xsl:when test="$explicit.table.width != ''">
+        <xsl:value-of select="$explicit.table.width"/>
+      </xsl:when>
+      <xsl:when test="$column.sum.width != ''">
+        <xsl:value-of select="$column.sum.width"/>
+      </xsl:when>
+      <xsl:when test="$default.table.width = ''">
+        <xsl:choose>
+          <!-- These processors don't support table-layout="auto" -->
+          <xsl:when test="$fop.extensions != 0 or
+                          $fop1.extensions != 0 or
+                          $passivetex.extensions != 0">
+            <xsl:text>100%</xsl:text>
+          </xsl:when>
+          <!-- Proportional columns imply 100% width -->
+          <xsl:when test="count($prop-columns) != 0">
+            <xsl:text>100%</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>auto</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$default.table.width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:value-of select="$table.width"/>
+
+</xsl:template>
+
+<xsl:template match="spanspec"></xsl:template>
+
+<xsl:template match="thead">
+  <xsl:variable name="tgroup" select="parent::*"/>
+
+  <fo:table-header start-indent="0pt" end-indent="0pt">
+    <xsl:apply-templates select="row[1]">
+      <xsl:with-param name="spans">
+        <xsl:call-template name="blank.spans">
+          <xsl:with-param name="cols" select="../@cols"/>
+        </xsl:call-template>
+      </xsl:with-param>
+    </xsl:apply-templates>
+  </fo:table-header>
+</xsl:template>
+
+<xsl:template match="tfoot">
+  <xsl:variable name="tgroup" select="parent::*"/>
+
+  <fo:table-footer start-indent="0pt" end-indent="0pt">
+    <xsl:apply-templates select="row[1]">
+      <xsl:with-param name="spans">
+        <xsl:call-template name="blank.spans">
+          <xsl:with-param name="cols" select="../@cols"/>
+        </xsl:call-template>
+      </xsl:with-param>
+    </xsl:apply-templates>
+
+  </fo:table-footer>
+</xsl:template>
+
+<xsl:template match="tbody">
+  <xsl:variable name="tgroup" select="parent::*"/>
+
+  <fo:table-body start-indent="0pt" end-indent="0pt">
+    <xsl:apply-templates select="row[1]">
+      <xsl:with-param name="spans">
+        <xsl:call-template name="blank.spans">
+          <xsl:with-param name="cols" select="../@cols"/>
+        </xsl:call-template>
+      </xsl:with-param>
+    </xsl:apply-templates>
+  </fo:table-body>
+</xsl:template>
+
+<xsl:template match="row">
+  <xsl:param name="spans"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($spans, '0')">
+      <xsl:call-template name="normal-row">
+        <xsl:with-param name="spans" select="$spans"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <!--
+      <xsl:message>
+        <xsl:text>Ignoring row: </xsl:text>
+        <xsl:value-of select="$spans"/>
+        <xsl:text> = </xsl:text>
+        <xsl:call-template name="consume-row">
+          <xsl:with-param name="spans" select="$spans"/>
+        </xsl:call-template>
+      </xsl:message>
+      -->
+
+      <xsl:if test="normalize-space(.//text()) != ''">
+        <xsl:message>Warning: overlapped row contains content!</xsl:message>
+      </xsl:if>
+
+      <fo:table-row>
+        <xsl:comment> This row intentionally left blank </xsl:comment>
+        <fo:table-cell><fo:block/></fo:table-cell>
+      </fo:table-row>
+
+      <xsl:apply-templates select="following-sibling::row[1]">
+        <xsl:with-param name="spans">
+          <xsl:call-template name="consume-row">
+            <xsl:with-param name="spans" select="$spans"/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="normal-row">
+  <xsl:param name="spans"/>
+
+  <fo:table-row>
+    <xsl:call-template name="table.row.properties"/>
+    <xsl:call-template name="anchor"/>
+
+    <xsl:apply-templates select="(entry|entrytbl)[1]">
+      <xsl:with-param name="spans" select="$spans"/>
+    </xsl:apply-templates>
+  </fo:table-row>
+
+  <xsl:if test="following-sibling::row">
+    <xsl:variable name="nextspans">
+      <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
+        <xsl:with-param name="spans" select="$spans"/>
+      </xsl:apply-templates>
+    </xsl:variable>
+
+    <xsl:apply-templates select="following-sibling::row[1]">
+      <xsl:with-param name="spans" select="$nextspans"/>
+    </xsl:apply-templates>
+  </xsl:if>
+</xsl:template>
+
+<!-- customize this template to add row properties -->
+<xsl:template name="table.row.properties">
+  <xsl:variable name="bgcolor">
+    <xsl:call-template name="pi.dbfo_bgcolor"/>
+  </xsl:variable>
+  <xsl:if test="$bgcolor != ''">
+    <xsl:attribute name="background-color">
+      <xsl:value-of select="$bgcolor"/>
+    </xsl:attribute>
+  </xsl:if>
+
+  <!-- Keep header row with next row -->
+  <xsl:if test="ancestor::thead">
+    <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+  </xsl:if>
+
+</xsl:template>
+
+<xsl:template match="entry|entrytbl" name="entry">
+  <xsl:param name="col" select="1"/>
+  <xsl:param name="spans"/>
+
+  <xsl:variable name="row" select="parent::row"/>
+  <xsl:variable name="group" select="$row/parent::*[1]"/>
+  <xsl:variable name="frame" select="ancestor::tgroup/parent::*/@frame"/>
+
+  <xsl:variable name="empty.cell" select="count(node()) = 0"/>
+
+  <xsl:variable name="named.colnum">
+    <xsl:call-template name="entry.colnum"/>
+  </xsl:variable>
+
+  <xsl:variable name="entry.colnum">
+    <xsl:choose>
+      <xsl:when test="$named.colnum &gt; 0">
+        <xsl:value-of select="$named.colnum"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$col"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="entry.colspan">
+    <xsl:choose>
+      <xsl:when test="@spanname or @namest">
+        <xsl:call-template name="calculate.colspan"/>
+      </xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="following.spans">
+    <xsl:call-template name="calculate.following.spans">
+      <xsl:with-param name="colspan" select="$entry.colspan"/>
+      <xsl:with-param name="spans" select="$spans"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="rowsep">
+    <xsl:choose>
+      <!-- If this is the last row, rowsep never applies. -->
+      <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
+                          or ancestor-or-self::thead/following-sibling::tbody
+                          or ancestor-or-self::tbody/preceding-sibling::tfoot)">
+        <xsl:value-of select="0"/>
+      </xsl:when>
+      <!-- Check for morerows too -->
+      <xsl:when test="(@morerows and count(ancestor-or-self::row[1]/
+                       following-sibling::row) = @morerows )
+                      and not (ancestor-or-self::thead/following-sibling::tbody
+                       or ancestor-or-self::tbody/preceding-sibling::tfoot)">
+        <xsl:value-of select="0"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="inherited.table.attribute">
+          <xsl:with-param name="entry" select="."/>
+          <xsl:with-param name="colnum" select="$entry.colnum"/>
+          <xsl:with-param name="attribute" select="'rowsep'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+<!--
+  <xsl:message><xsl:value-of select="."/>: <xsl:value-of select="$rowsep"/></xsl:message>
+-->
+
+  <xsl:variable name="colsep">
+    <xsl:choose>
+      <!-- If this is the last column, colsep never applies. -->
+      <xsl:when test="$following.spans = ''">0</xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="inherited.table.attribute">
+          <xsl:with-param name="entry" select="."/>
+          <xsl:with-param name="colnum" select="$entry.colnum"/>
+          <xsl:with-param name="attribute" select="'colsep'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="valign">
+    <xsl:call-template name="inherited.table.attribute">
+      <xsl:with-param name="entry" select="."/>
+      <xsl:with-param name="colnum" select="$entry.colnum"/>
+      <xsl:with-param name="attribute" select="'valign'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="align">
+    <xsl:call-template name="inherited.table.attribute">
+      <xsl:with-param name="entry" select="."/>
+      <xsl:with-param name="colnum" select="$entry.colnum"/>
+      <xsl:with-param name="attribute" select="'align'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="char">
+    <xsl:call-template name="inherited.table.attribute">
+      <xsl:with-param name="entry" select="."/>
+      <xsl:with-param name="colnum" select="$entry.colnum"/>
+      <xsl:with-param name="attribute" select="'char'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="charoff">
+    <xsl:call-template name="inherited.table.attribute">
+      <xsl:with-param name="entry" select="."/>
+      <xsl:with-param name="colnum" select="$entry.colnum"/>
+      <xsl:with-param name="attribute" select="'charoff'"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
+      <xsl:call-template name="entry">
+        <xsl:with-param name="col" select="$col+1"/>
+        <xsl:with-param name="spans" select="substring-after($spans,':')"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:when test="number($entry.colnum) &gt; $col">
+      <xsl:call-template name="empty.table.cell">
+        <xsl:with-param name="colnum" select="$col"/>
+      </xsl:call-template>
+      <xsl:call-template name="entry">
+        <xsl:with-param name="col" select="$col+1"/>
+        <xsl:with-param name="spans" select="substring-after($spans,':')"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:variable name="cell.content">
+        <fo:block>
+          <xsl:call-template name="table.cell.block.properties"/>
+
+          <!-- are we missing any indexterms? -->
+          <xsl:if test="not(preceding-sibling::entry)
+                        and not(parent::row/preceding-sibling::row)">
+            <!-- this is the first entry of the first row -->
+            <xsl:if test="ancestor::thead or
+                          (ancestor::tbody
+                           and not(ancestor::tbody/preceding-sibling::thead
+                                   or ancestor::tbody/preceding-sibling::tbody))">
+              <!-- of the thead or the first tbody -->
+              <xsl:apply-templates select="ancestor::tgroup/preceding-sibling::indexterm"/>
+            </xsl:if>
+          </xsl:if>
+
+          <!--
+          <xsl:text>(</xsl:text>
+          <xsl:value-of select="$rowsep"/>
+          <xsl:text>,</xsl:text>
+          <xsl:value-of select="$colsep"/>
+          <xsl:text>)</xsl:text>
+          -->
+          <xsl:choose>
+            <xsl:when test="$empty.cell">
+              <xsl:text>&#160;</xsl:text>
+            </xsl:when>
+            <xsl:when test="self::entrytbl">
+              <xsl:variable name="prop-columns"
+                            select=".//colspec[contains(@colwidth, '*')]"/>
+              <fo:table xsl:use-attribute-sets="table.table.properties">
+                <xsl:if test="count($prop-columns) != 0">
+                  <xsl:attribute name="table-layout">fixed</xsl:attribute>
+                </xsl:if>
+                <xsl:call-template name="tgroup"/>
+              </fo:table>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </fo:block>
+      </xsl:variable>
+
+      <xsl:variable name="cell-orientation">
+        <xsl:call-template name="pi.dbfo_orientation">
+          <xsl:with-param name="node" select="ancestor-or-self::entry"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="row-orientation">
+        <xsl:call-template name="pi.dbfo_orientation">
+          <xsl:with-param name="node" select="ancestor-or-self::row"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="cell-width">
+        <xsl:call-template name="pi.dbfo_rotated-width">
+          <xsl:with-param name="node" select="ancestor-or-self::entry"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="row-width">
+        <xsl:call-template name="pi.dbfo_rotated-width">
+          <xsl:with-param name="node" select="ancestor-or-self::row"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="orientation">
+        <xsl:choose>
+          <xsl:when test="$cell-orientation != ''">
+            <xsl:value-of select="$cell-orientation"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$row-orientation"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="rotated-width">
+        <xsl:choose>
+          <xsl:when test="$cell-width != ''">
+            <xsl:value-of select="$cell-width"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$row-width"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="bgcolor">
+        <xsl:call-template name="pi.dbfo_bgcolor">
+          <xsl:with-param name="node" select="ancestor-or-self::entry"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <fo:table-cell xsl:use-attribute-sets="table.cell.padding">
+        <xsl:call-template name="table.cell.properties">
+          <xsl:with-param name="bgcolor.pi" select="$bgcolor"/>
+          <xsl:with-param name="rowsep.inherit" select="$rowsep"/>
+          <xsl:with-param name="colsep.inherit" select="$colsep"/>
+          <xsl:with-param name="col" select="$col"/>
+          <xsl:with-param name="valign.inherit" select="$valign"/>
+          <xsl:with-param name="align.inherit" select="$align"/>
+          <xsl:with-param name="char.inherit" select="$char"/>
+        </xsl:call-template>
+
+        <xsl:call-template name="anchor"/>
+
+        <xsl:if test="@morerows">
+          <xsl:attribute name="number-rows-spanned">
+            <xsl:value-of select="@morerows+1"/>
+          </xsl:attribute>
+        </xsl:if>
+
+        <xsl:if test="$entry.colspan &gt; 1">
+          <xsl:attribute name="number-columns-spanned">
+            <xsl:value-of select="$entry.colspan"/>
+          </xsl:attribute>
+        </xsl:if>
+
+<!--
+        <xsl:if test="@charoff">
+          <xsl:attribute name="charoff">
+            <xsl:value-of select="@charoff"/>
+          </xsl:attribute>
+        </xsl:if>
+-->
+
+        <xsl:choose>
+          <xsl:when test="$fop.extensions = 0 and $passivetex.extensions = 0
+                          and $orientation != ''">
+            <fo:block-container reference-orientation="{$orientation}">
+              <xsl:if test="$rotated-width != ''">
+                <xsl:attribute name="width">
+                  <xsl:value-of select="$rotated-width"/>
+                </xsl:attribute>
+              </xsl:if>
+              <xsl:copy-of select="$cell.content"/>
+            </fo:block-container>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="$cell.content"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:table-cell>
+
+      <xsl:choose>
+        <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
+          <xsl:apply-templates select="(following-sibling::entry
+                                       |following-sibling::entrytbl)[1]">
+            <xsl:with-param name="col" select="$col+$entry.colspan"/>
+            <xsl:with-param name="spans" select="$following.spans"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="finaltd">
+            <xsl:with-param name="spans" select="$following.spans"/>
+            <xsl:with-param name="col" select="$col+$entry.colspan"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- Expand this template to add properties to any fo:table-cell -->
+<xsl:template name="table.cell.properties">
+  <xsl:param name="bgcolor.pi" select="''"/>
+  <xsl:param name="rowsep.inherit" select="1"/>
+  <xsl:param name="colsep.inherit" select="1"/>
+  <xsl:param name="col" select="1"/>
+  <xsl:param name="valign.inherit" select="''"/>
+  <xsl:param name="align.inherit" select="''"/>
+  <xsl:param name="char.inherit" select="''"/>
+
+  <xsl:choose>
+    <xsl:when test="ancestor::tgroup">
+      <xsl:if test="$bgcolor.pi != ''">
+        <xsl:attribute name="background-color">
+          <xsl:value-of select="$bgcolor.pi"/>
+        </xsl:attribute>
+      </xsl:if>
+
+      <xsl:if test="$rowsep.inherit &gt; 0">
+        <xsl:call-template name="border">
+          <xsl:with-param name="side" select="'bottom'"/>
+        </xsl:call-template>
+      </xsl:if>
+
+      <xsl:if test="$colsep.inherit &gt; 0 and 
+                      $col &lt; ancestor::tgroup/@cols">
+        <xsl:call-template name="border">
+          <xsl:with-param name="side" select="'right'"/>
+        </xsl:call-template>
+      </xsl:if>
+
+      <xsl:if test="$valign.inherit != ''">
+        <xsl:attribute name="display-align">
+          <xsl:choose>
+            <xsl:when test="$valign.inherit='top'">before</xsl:when>
+            <xsl:when test="$valign.inherit='middle'">center</xsl:when>
+            <xsl:when test="$valign.inherit='bottom'">after</xsl:when>
+            <xsl:otherwise>
+              <xsl:message>
+                <xsl:text>Unexpected valign value: </xsl:text>
+                <xsl:value-of select="$valign.inherit"/>
+                <xsl:text>, center used.</xsl:text>
+              </xsl:message>
+              <xsl:text>center</xsl:text>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:attribute>
+      </xsl:if>
+
+      <xsl:choose>
+        <xsl:when test="$align.inherit = 'char' and $char.inherit != ''">
+          <xsl:attribute name="text-align">
+            <xsl:value-of select="$char.inherit"/>
+          </xsl:attribute>
+        </xsl:when>
+        <xsl:when test="$align.inherit != ''">
+          <xsl:attribute name="text-align">
+            <xsl:value-of select="$align.inherit"/>
+          </xsl:attribute>
+        </xsl:when>
+      </xsl:choose>
+
+    </xsl:when>
+    <xsl:otherwise>
+      <!-- HTML table -->
+      <xsl:variable name="border" 
+                    select="(ancestor::table |
+                             ancestor::informaltable)[last()]/@border"/>
+      <xsl:if test="$border != '' and $border != 0">
+        <xsl:attribute name="border">
+          <xsl:value-of select="$table.cell.border.thickness"/>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="$table.cell.border.style"/>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="$table.cell.border.color"/>
+        </xsl:attribute>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
+<!-- Expand this template to add properties to any cell's block -->
+<xsl:template name="table.cell.block.properties">
+  <!-- highlight this entry? -->
+  <xsl:if test="ancestor::thead or ancestor::tfoot">
+    <xsl:attribute name="font-weight">bold</xsl:attribute>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="entry|entrytbl" name="sentry" mode="span">
+  <xsl:param name="col" select="1"/>
+  <xsl:param name="spans"/>
+
+  <xsl:variable name="entry.colnum">
+    <xsl:call-template name="entry.colnum"/>
+  </xsl:variable>
+
+  <xsl:variable name="entry.colspan">
+    <xsl:choose>
+      <xsl:when test="@spanname or @namest">
+        <xsl:call-template name="calculate.colspan"/>
+      </xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="following.spans">
+    <xsl:call-template name="calculate.following.spans">
+      <xsl:with-param name="colspan" select="$entry.colspan"/>
+      <xsl:with-param name="spans" select="$spans"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
+      <xsl:value-of select="substring-before($spans,':')-1"/>
+      <xsl:text>:</xsl:text>
+      <xsl:call-template name="sentry">
+        <xsl:with-param name="col" select="$col+1"/>
+        <xsl:with-param name="spans" select="substring-after($spans,':')"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:when test="number($entry.colnum) &gt; $col">
+      <xsl:text>0:</xsl:text>
+      <xsl:call-template name="sentry">
+        <xsl:with-param name="col" select="$col+$entry.colspan"/>
+        <xsl:with-param name="spans" select="$following.spans"/>
+      </xsl:call-template>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:call-template name="copy-string">
+        <xsl:with-param name="count" select="$entry.colspan"/>
+        <xsl:with-param name="string">
+          <xsl:choose>
+            <xsl:when test="@morerows">
+              <xsl:value-of select="@morerows"/>
+            </xsl:when>
+            <xsl:otherwise>0</xsl:otherwise>
+          </xsl:choose>
+          <xsl:text>:</xsl:text>
+        </xsl:with-param>
+      </xsl:call-template>
+
+      <xsl:choose>
+        <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
+          <xsl:apply-templates select="(following-sibling::entry
+                                       |following-sibling::entrytbl)[1]"
+                               mode="span">
+            <xsl:with-param name="col" select="$col+$entry.colspan"/>
+            <xsl:with-param name="spans" select="$following.spans"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="sfinaltd">
+            <xsl:with-param name="spans" select="$following.spans"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="generate.colgroup.raw">
+  <xsl:param name="cols" select="1"/>
+  <xsl:param name="count" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="$count>$cols"></xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="generate.col.raw">
+        <xsl:with-param name="countcol" select="$count"/>
+      </xsl:call-template>
+      <xsl:call-template name="generate.colgroup.raw">
+        <xsl:with-param name="cols" select="$cols"/>
+        <xsl:with-param name="count" select="$count+1"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="generate.colgroup">
+  <xsl:param name="cols" select="1"/>
+  <xsl:param name="count" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="$count>$cols"></xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="generate.col">
+        <xsl:with-param name="countcol" select="$count"/>
+      </xsl:call-template>
+      <xsl:call-template name="generate.colgroup">
+        <xsl:with-param name="cols" select="$cols"/>
+        <xsl:with-param name="count" select="$count+1"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="generate.col.raw">
+  <!-- generate the table-column for column countcol -->
+  <xsl:param name="countcol">1</xsl:param>
+  <xsl:param name="colspecs" select="./colspec"/>
+  <xsl:param name="count">1</xsl:param>
+  <xsl:param name="colnum">1</xsl:param>
+
+  <xsl:choose>
+    <xsl:when test="$count>count($colspecs)">
+      <fo:table-column column-number="{$countcol}"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
+
+      <xsl:variable name="colspec.colnum">
+        <xsl:choose>
+          <xsl:when test="$colspec/@colnum">
+            <xsl:value-of select="$colspec/@colnum"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$colnum"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="colspec.colwidth">
+        <xsl:choose>
+          <xsl:when test="$colspec/@colwidth">
+            <xsl:value-of select="$colspec/@colwidth"/>
+          </xsl:when>
+          <xsl:otherwise>1*</xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$colspec.colnum=$countcol">
+          <fo:table-column column-number="{$countcol}">
+            <xsl:attribute name="column-width">
+              <xsl:value-of select="$colspec.colwidth"/>
+            </xsl:attribute>
+          </fo:table-column>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="generate.col.raw">
+            <xsl:with-param name="countcol" select="$countcol"/>
+            <xsl:with-param name="colspecs" select="$colspecs"/>
+            <xsl:with-param name="count" select="$count+1"/>
+            <xsl:with-param name="colnum">
+              <xsl:choose>
+                <xsl:when test="$colspec/@colnum">
+                  <xsl:value-of select="$colspec/@colnum + 1"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="$colnum + 1"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:with-param>
+           </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="generate.col">
+  <!-- generate the table-column for column countcol -->
+  <xsl:param name="countcol">1</xsl:param>
+  <xsl:param name="colspecs" select="./colspec"/>
+  <xsl:param name="count">1</xsl:param>
+  <xsl:param name="colnum">1</xsl:param>
+
+  <xsl:choose>
+    <xsl:when test="$count>count($colspecs)">
+      <fo:table-column column-number="{$countcol}">
+        <xsl:variable name="colwidth">
+          <xsl:call-template name="calc.column.width"/>
+        </xsl:variable>
+        <xsl:if test="$colwidth != 'proportional-column-width(1)'">
+          <xsl:attribute name="column-width">
+            <xsl:value-of select="$colwidth"/>
+          </xsl:attribute>
+        </xsl:if>
+      </fo:table-column>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
+
+      <xsl:variable name="colspec.colnum">
+        <xsl:choose>
+          <xsl:when test="$colspec/@colnum">
+            <xsl:value-of select="$colspec/@colnum"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$colnum"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="colspec.colwidth">
+        <xsl:choose>
+          <xsl:when test="$colspec/@colwidth">
+            <xsl:value-of select="$colspec/@colwidth"/>
+          </xsl:when>
+          <xsl:otherwise>1*</xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$colspec.colnum=$countcol">
+          <fo:table-column column-number="{$countcol}">
+            <xsl:variable name="colwidth">
+              <xsl:call-template name="calc.column.width">
+                <xsl:with-param name="colwidth">
+                  <xsl:value-of select="$colspec.colwidth"/>
+                </xsl:with-param>
+              </xsl:call-template>
+            </xsl:variable>
+            <xsl:if test="$colwidth != 'proportional-column-width(1)'">
+              <xsl:attribute name="column-width">
+                <xsl:value-of select="$colwidth"/>
+              </xsl:attribute>
+            </xsl:if>
+          </fo:table-column>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="generate.col">
+            <xsl:with-param name="countcol" select="$countcol"/>
+            <xsl:with-param name="colspecs" select="$colspecs"/>
+            <xsl:with-param name="count" select="$count+1"/>
+            <xsl:with-param name="colnum">
+              <xsl:choose>
+                <xsl:when test="$colspec/@colnum">
+                  <xsl:value-of select="$colspec/@colnum + 1"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="$colnum + 1"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:with-param>
+           </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<doc:template name="calc.column.width" xmlns="">
+<refpurpose>Calculate an XSL FO table column width specification from a
+CALS table column width specification.</refpurpose>
+
+<refdescription>
+<para>CALS expresses table column widths in the following basic
+forms:</para>
+
+<itemizedlist>
+<listitem>
+<para><emphasis>99.99units</emphasis>, a fixed length specifier.</para>
+</listitem>
+<listitem>
+<para><emphasis>99.99</emphasis>, a fixed length specifier without any units.</para>
+</listitem>
+<listitem>
+<para><emphasis>99.99*</emphasis>, a relative length specifier.</para>
+</listitem>
+<listitem>
+<para><emphasis>99.99*+99.99units</emphasis>, a combination of both.</para>
+</listitem>
+</itemizedlist>
+
+<para>The CALS units are points (pt), picas (pi), centimeters (cm),
+millimeters (mm), and inches (in). These are the same units as XSL,
+except that XSL abbreviates picas "pc" instead of "pi". If a length
+specifier has no units, the CALS default unit (pt) is assumed.</para>
+
+<para>Relative length specifiers are represented in XSL with the
+proportional-column-width() function.</para>
+
+<para>Here are some examples:</para>
+
+<itemizedlist>
+<listitem>
+<para>"36pt" becomes "36pt"</para>
+</listitem>
+<listitem>
+<para>"3pi" becomes "3pc"</para>
+</listitem>
+<listitem>
+<para>"36" becomes "36pt"</para>
+</listitem>
+<listitem>
+<para>"3*" becomes "proportional-column-width(3)"</para>
+</listitem>
+<listitem>
+<para>"3*+2pi" becomes "proportional-column-width(3)+2pc"</para>
+</listitem>
+<listitem>
+<para>"1*+2" becomes "proportional-column-width(1)+2pt"</para>
+</listitem>
+</itemizedlist>
+</refdescription>
+
+<refparameter>
+<variablelist>
+<varlistentry><term>colwidth</term>
+<listitem>
+<para>The CALS column width specification.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refparameter>
+
+<refreturn>
+<para>The XSL column width specification.</para>
+</refreturn>
+</doc:template>
+
+<xsl:template name="calc.column.width">
+  <xsl:param name="colwidth">1*</xsl:param>
+
+  <!-- Ok, the colwidth could have any one of the following forms: -->
+  <!--        1*       = proportional width -->
+  <!--         *       = same as 1* -->
+  <!--     1unit       = 1.0 units wide -->
+  <!--         1       = 1pt wide -->
+  <!--  1*+1unit       = proportional width + some fixed width -->
+  <!--      1*+1       = proportional width + some fixed width -->
+
+  <!-- If it has a proportional width, translate it to XSL -->
+  <xsl:if test="contains($colwidth, '*')">
+    <xsl:text>proportional-column-width(</xsl:text>
+    <xsl:choose>
+      <xsl:when test="substring-before($colwidth, '*') != ''"> 
+        <xsl:value-of select="substring-before($colwidth, '*')"/>
+      </xsl:when>
+      <xsl:otherwise>
+         <xsl:text>1.00</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:text>)</xsl:text>
+  </xsl:if>
+
+  <!-- Now grab the non-proportional part of the specification -->
+  <xsl:variable name="width-units">
+    <xsl:choose>
+      <xsl:when test="contains($colwidth, '*')">
+        <xsl:value-of
+             select="normalize-space(substring-after($colwidth, '*'))"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="normalize-space($colwidth)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <!-- Ok, now the width-units could have any one of the following forms: -->
+  <!--                 = <empty string> -->
+  <!--     1unit       = 1.0 units wide -->
+  <!--         1       = 1pt wide -->
+  <!-- with an optional leading sign -->
+
+  <!-- Grab the width part by blanking out the units part and discarding -->
+  <!-- whitespace. It's not pretty, but it works. -->
+  <xsl:variable name="width"
+       select="normalize-space(translate($width-units,
+                                         '+-0123456789.abcdefghijklmnopqrstuvwxyz',
+                                         '+-0123456789.'))"/>
+
+  <!-- Grab the units part by blanking out the width part and discarding -->
+  <!-- whitespace. It's not pretty, but it works. -->
+  <xsl:variable name="units"
+       select="normalize-space(translate($width-units,
+                                         'abcdefghijklmnopqrstuvwxyz+-0123456789.',
+                                         'abcdefghijklmnopqrstuvwxyz'))"/>
+
+  <!-- Output the width -->
+  <xsl:value-of select="$width"/>
+
+  <!-- Output the units, translated appropriately -->
+  <xsl:choose>
+    <xsl:when test="$units = 'pi'">pc</xsl:when>
+    <xsl:when test="$units = '' and $width != ''">pt</xsl:when>
+    <xsl:otherwise><xsl:value-of select="$units"/></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 81 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/task.xsl

@@ -0,0 +1,81 @@
+<?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$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="task">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:variable name="param.placement"
+                select="substring-after(normalize-space($formal.title.placement),
+                                        concat(local-name(.), ' '))"/>
+
+  <xsl:variable name="placement">
+    <xsl:choose>
+      <xsl:when test="contains($param.placement, ' ')">
+        <xsl:value-of select="substring-before($param.placement, ' ')"/>
+      </xsl:when>
+      <xsl:when test="$param.placement = ''">before</xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$param.placement"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="preamble"
+                select="*[not(self::title
+                              or self::titleabbrev)]"/>
+
+  <fo:block id="{$id}"
+            xsl:use-attribute-sets="formal.object.properties">
+    <xsl:call-template name="anchor"/>
+
+    <xsl:if test="title and $placement = 'before'">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+
+    <xsl:apply-templates select="$preamble"/>
+
+    <xsl:if test="title and $placement != 'before'">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="task/title">
+  <!-- nop -->
+</xsl:template>
+
+<xsl:template match="tasksummary">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+<xsl:template match="tasksummary/title"/>
+
+<xsl:template match="taskprerequisites">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+<xsl:template match="taskprerequisites/title"/>
+
+<xsl:template match="taskrelated">
+  <xsl:call-template name="semiformal.object"/>
+</xsl:template>
+
+<xsl:template match="taskrelated/title"/>
+
+</xsl:stylesheet>

+ 1311 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/titlepage.templates.xml

@@ -0,0 +1,1311 @@
+<!DOCTYPE t:templates [
+<!ENTITY hsize0 "10pt">
+<!ENTITY hsize1 "12pt">
+<!ENTITY hsize2 "14.4pt">
+<!ENTITY hsize3 "17.28pt">
+<!ENTITY hsize4 "20.736pt">
+<!ENTITY hsize5 "24.8832pt">
+<!ENTITY hsize0space "7.5pt"> <!-- 0.75 * hsize0 -->
+<!ENTITY hsize1space "9pt"> <!-- 0.75 * hsize1 -->
+<!ENTITY hsize2space "10.8pt"> <!-- 0.75 * hsize2 -->
+<!ENTITY hsize3space "12.96pt"> <!-- 0.75 * hsize3 -->
+<!ENTITY hsize4space "15.552pt"> <!-- 0.75 * hsize4 -->
+<!ENTITY hsize5space "18.6624pt"> <!-- 0.75 * hsize5 -->
+]>
+<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
+	     xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param"
+             xmlns:fo="http://www.w3.org/1999/XSL/Format"
+             xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the DocBook XSL Stylesheet distribution.
+     See ../README or http://docbook.sf.net/ for copyright
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="article" t:wrapper="fo:block"
+             font-family="{$title.fontset}">
+
+  <t:titlepage-content t:side="recto"
+	     start-indent="0pt"
+             text-align="center">
+
+    <title t:named-template="component.title"
+	   param:node="ancestor-or-self::article[1]"
+	   keep-with-next.within-column="always"
+	   font-size="&hsize5;"
+	   font-weight="bold"/>
+
+    <subtitle/>
+
+    <corpauthor space-before="0.5em"
+                font-size="&hsize2;"/>
+    <authorgroup space-before="0.5em"
+                 font-size="&hsize2;"/>
+    <author space-before="0.5em"
+            font-size="&hsize2;"/>
+
+    <othercredit space-before="0.5em"/>
+    <releaseinfo space-before="0.5em"/>
+    <copyright space-before="0.5em"/>
+    <legalnotice text-align="start"
+                 margin-left="0.5in"
+                 margin-right="0.5in"
+                 font-family="{$body.fontset}"/>
+    <pubdate space-before="0.5em"/>
+    <revision space-before="0.5em"/>
+    <revhistory space-before="0.5em"/>
+    <abstract space-before="0.5em"
+	      text-align="start"
+	      margin-left="0.5in"
+              margin-right="0.5in"
+              font-family="{$body.fontset}"/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="set" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+      <title
+	     t:named-template="division.title"
+	     param:node="ancestor-or-self::set[1]"
+	     text-align="center"
+	     font-size="&hsize5;"
+	     space-before="&hsize5space;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"
+	      text-align="center"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="book" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:named-template="division.title"
+	     param:node="ancestor-or-self::book[1]"
+	     text-align="center"
+	     font-size="&hsize5;"
+	     space-before="&hsize5space;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+      <subtitle
+		text-align="center"
+		font-size="&hsize4;"
+		space-before="&hsize4space;"
+		font-family="{$title.fontset}"/>
+      <corpauthor font-size="&hsize3;"
+		  keep-with-next.within-column="always"
+		  space-before="2in"/>
+      <authorgroup space-before="2in"/>
+      <author font-size="&hsize3;"
+	      space-before="&hsize2space;"
+	      keep-with-next.within-column="always"/>
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+      <title
+	     t:named-template="book.verso.title"
+	     font-size="&hsize2;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+      <corpauthor/>
+      <authorgroup t:named-template="verso.authorgroup"/>
+      <author/>
+      <othercredit/>
+      <releaseinfo space-before="0.5em"/>
+      <pubdate space-before="1em"/>
+      <copyright/>
+      <abstract/>
+      <legalnotice font-size="8pt"/>
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+      <fo:block break-after="page"/>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+      <fo:block break-after="page"/>
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="part" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+      <title
+	     t:named-template="division.title"
+	     param:node="ancestor-or-self::part[1]"
+	     text-align="center"
+	     font-size="&hsize5;"
+	     space-before="&hsize5space;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    <subtitle
+	      text-align="center"
+	      font-size="&hsize4;"
+	      space-before="&hsize4space;"
+	      font-weight='bold'
+	      font-style='italic'
+	      font-family="{$title.fontset}"/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="partintro" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   text-align="center"
+	   font-size="&hsize5;"
+	   font-weight="bold"
+	   space-before="1em"
+	   font-family="{$title.fontset}"/>
+    <subtitle
+	      text-align="center"
+	      font-size="&hsize2;"
+	      font-weight="bold"
+	      font-style="italic"
+	      font-family="{$title.fontset}"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="reference" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+      <title
+	     t:named-template="division.title"
+	     param:node="ancestor-or-self::reference[1]"
+	     text-align="center"
+	     font-size="&hsize5;"
+	     space-before="&hsize5space;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"
+	      text-align="center"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsynopsisdiv" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   font-family="{$title.fontset}"/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsection" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   font-family="{$title.fontset}"/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect1" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   font-family="{$title.fontset}"/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect2" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   font-family="{$title.fontset}"/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect3" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   font-family="{$title.fontset}"/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="dedication" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="component.title"
+	     param:node="ancestor-or-self::dedication[1]"
+	     margin-left="{$title.margin.left}"
+	     font-size="&hsize5;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="preface" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="component.title"
+	     param:node="ancestor-or-self::preface[1]"
+	     margin-left="{$title.margin.left}"
+	     font-size="&hsize5;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+      <corpauthor/>
+      <authorgroup/>
+      <author/>
+      <othercredit/>
+      <releaseinfo/>
+      <copyright/>
+      <legalnotice/>
+      <pubdate/>
+      <revision/>
+      <revhistory/>
+      <abstract/>
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="chapter" t:wrapper="fo:block"
+               font-family="{$title.fontset}">
+    <t:titlepage-content t:side="recto" margin-left="{$title.margin.left}">
+      <title t:named-template="component.title"
+	     param:node="ancestor-or-self::chapter[1]"
+	     font-size="&hsize5;"
+	     font-weight="bold"/>
+
+      <subtitle space-before="0.5em"
+		font-style="italic"
+		font-size="&hsize2;"
+		font-weight="bold"/>
+
+      <corpauthor  space-before="0.5em"
+	           space-after="0.5em"
+                   font-size="&hsize2;"/>
+
+      <authorgroup space-before="0.5em"
+	           space-after="0.5em"
+                   font-size="&hsize2;"/>
+
+      <author      space-before="0.5em"
+	           space-after="0.5em"
+                   font-size="&hsize2;"/>
+
+      <othercredit/>
+      <releaseinfo/>
+      <copyright/>
+      <legalnotice/>
+      <pubdate/>
+      <revision/>
+      <revhistory/>
+      <abstract/>
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="appendix" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:named-template="component.title"
+	     param:node="ancestor-or-self::appendix[1]"
+	     margin-left="{$title.margin.left}"
+	     font-size="&hsize5;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+      <corpauthor/>
+      <authorgroup/>
+      <author/>
+      <othercredit/>
+      <releaseinfo/>
+      <copyright/>
+      <legalnotice/>
+      <pubdate/>
+      <revision/>
+      <revhistory/>
+      <abstract/>
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="section" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   margin-left="{$title.margin.left}"
+	   font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect1" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   margin-left="{$title.margin.left}"
+	   font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect2" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   margin-left="{$title.margin.left}"
+	   font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect3" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   margin-left="{$title.margin.left}"
+	   font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect4" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   margin-left="{$title.margin.left}"
+	   font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect5" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   margin-left="{$title.margin.left}"
+	   font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="simplesect" t:wrapper="fo:block">
+  <t:titlepage-content t:side="recto">
+    <title
+	   margin-left="{$title.margin.left}"
+	   font-family="{$title.fontset}"/>
+    <subtitle
+	      font-family="{$title.fontset}"/>
+    <corpauthor/>
+    <authorgroup/>
+    <author/>
+    <othercredit/>
+    <releaseinfo/>
+    <copyright/>
+    <legalnotice/>
+    <pubdate/>
+    <revision/>
+    <revhistory/>
+    <abstract/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="bibliography" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="component.title"
+	     param:node="ancestor-or-self::bibliography[1]"
+	     margin-left="{$title.margin.left}"
+	     font-size="&hsize5;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="bibliodiv" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title t:named-template="component.title"
+	     param:node="ancestor-or-self::bibliodiv[1]"
+	     margin-left="{$title.margin.left}"
+	     font-size="&hsize4;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="glossary" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="component.title"
+	     param:node="ancestor-or-self::glossary[1]"
+	     margin-left="{$title.margin.left}"
+	     font-size="&hsize5;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="glossdiv" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title t:named-template="component.title"
+	     param:node="ancestor-or-self::glossdiv[1]"
+	     margin-left="{$title.margin.left}"
+	     font-size="&hsize4;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="index" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="component.title"
+	     param:node="ancestor-or-self::index[1]"
+             param:pagewide="1"
+	     margin-left="0pt"
+	     font-size="&hsize5;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <!-- The indexdiv.title template is used so that manual and -->
+  <!-- automatically generated indexdiv titles get the same -->
+  <!-- formatting. -->
+
+  <t:titlepage t:element="indexdiv" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title t:force="1"
+	     t:named-template="indexdiv.title"
+	     param:title="title"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="setindex" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="component.title"
+	     param:node="ancestor-or-self::setindex[1]"
+             param:pagewide="1"
+	     margin-left="0pt"
+	     font-size="&hsize5;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="colophon" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="component.title"
+	     param:node="ancestor-or-self::colophon[1]"
+	     margin-left="{$title.margin.left}"
+	     font-size="&hsize5;"
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="sidebar" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title 
+	     font-family="{$title.fontset}"
+	     font-weight="bold"/>
+      <subtitle
+		font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+<t:titlepage t:element="qandaset" t:wrapper="fo:block"
+             font-family="{$title.fontset}">
+
+  <t:titlepage-content t:side="recto"
+	     start-indent="0pt"
+             text-align="center">
+
+    <title t:named-template="component.title"
+	   param:node="ancestor-or-self::qandaset[1]"
+	   keep-with-next.within-column="always"
+	   font-size="&hsize5;"
+	   font-weight="bold"/>
+
+    <subtitle/>
+
+    <corpauthor space-before="0.5em"
+                font-size="&hsize2;"/>
+    <authorgroup space-before="0.5em"
+                 font-size="&hsize2;"/>
+    <author space-before="0.5em"
+            font-size="&hsize2;"/>
+
+    <othercredit space-before="0.5em"/>
+    <releaseinfo space-before="0.5em"/>
+    <copyright space-before="0.5em"/>
+    <legalnotice text-align="start"
+                 margin-left="0.5in"
+                 margin-right="0.5in"
+                 font-family="{$body.fontset}"/>
+    <pubdate space-before="0.5em"/>
+    <revision space-before="0.5em"/>
+    <revhistory space-before="0.5em"/>
+    <abstract space-before="0.5em"
+	      text-align="start"
+	      margin-left="0.5in"
+              margin-right="0.5in"
+              font-family="{$body.fontset}"/>
+  </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="table.of.contents" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="gentext"
+	     param:key="'TableofContents'"
+             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="&hsize3;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="list.of.tables" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="gentext"
+	     param:key="'ListofTables'"
+             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="&hsize3;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="list.of.figures" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="gentext"
+	     param:key="'ListofFigures'"
+             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="&hsize3;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="list.of.examples" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="gentext"
+	     param:key="'ListofExamples'"
+             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="&hsize3;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="list.of.equations" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="gentext"
+	     param:key="'ListofEquations'"
+             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="&hsize3;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="list.of.procedures" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="gentext"
+	     param:key="'ListofProcedures'"
+             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="&hsize3;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+  <t:titlepage t:element="list.of.unknowns" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <title
+	     t:force="1"
+	     t:named-template="gentext"
+	     param:key="'ListofUnknown'"
+             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="&hsize3;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+    </t:titlepage-content>
+
+    <t:titlepage-content t:side="verso">
+    </t:titlepage-content>
+
+    <t:titlepage-separator>
+    </t:titlepage-separator>
+
+    <t:titlepage-before t:side="recto">
+    </t:titlepage-before>
+
+    <t:titlepage-before t:side="verso">
+    </t:titlepage-before>
+  </t:titlepage>
+
+<!-- ==================================================================== -->
+
+</t:templates>

+ 5094 - 0
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>
+

+ 738 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/titlepage.xsl

@@ -0,0 +1,738 @@
+<?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$
+     ********************************************************************
+
+     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:attribute-set name="book.titlepage.recto.style">
+  <xsl:attribute name="font-family">
+    <xsl:value-of select="$title.fontset"/>
+  </xsl:attribute>
+  <xsl:attribute name="font-weight">bold</xsl:attribute>
+  <xsl:attribute name="font-size">12pt</xsl:attribute>
+  <xsl:attribute name="text-align">center</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="book.titlepage.verso.style">
+  <xsl:attribute name="font-size">10pt</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="article.titlepage.recto.style"/>
+<xsl:attribute-set name="article.titlepage.verso.style"/>
+
+<xsl:attribute-set name="set.titlepage.recto.style"/>
+<xsl:attribute-set name="set.titlepage.verso.style"/>
+
+<xsl:attribute-set name="part.titlepage.recto.style">
+  <xsl:attribute name="text-align">center</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="part.titlepage.verso.style"/>
+
+<xsl:attribute-set name="partintro.titlepage.recto.style"/>
+<xsl:attribute-set name="partintro.titlepage.verso.style"/>
+
+<xsl:attribute-set name="reference.titlepage.recto.style"/>
+<xsl:attribute-set name="reference.titlepage.verso.style"/>
+
+<xsl:attribute-set name="dedication.titlepage.recto.style"/>
+<xsl:attribute-set name="dedication.titlepage.verso.style"/>
+
+<xsl:attribute-set name="preface.titlepage.recto.style"/>
+<xsl:attribute-set name="preface.titlepage.verso.style"/>
+
+<xsl:attribute-set name="chapter.titlepage.recto.style"/>
+<xsl:attribute-set name="chapter.titlepage.verso.style"/>
+
+<xsl:attribute-set name="appendix.titlepage.recto.style"/>
+<xsl:attribute-set name="appendix.titlepage.verso.style"/>
+
+<xsl:attribute-set name="bibliography.titlepage.recto.style"/>
+<xsl:attribute-set name="bibliography.titlepage.verso.style"/>
+
+<xsl:attribute-set name="bibliodiv.titlepage.recto.style"/>
+<xsl:attribute-set name="bibliodiv.titlepage.verso.style"/>
+
+<xsl:attribute-set name="glossary.titlepage.recto.style"/>
+<xsl:attribute-set name="glossary.titlepage.verso.style"/>
+
+<xsl:attribute-set name="glossdiv.titlepage.recto.style"/>
+<xsl:attribute-set name="glossdiv.titlepage.verso.style"/>
+
+<xsl:attribute-set name="index.titlepage.recto.style"/>
+<xsl:attribute-set name="index.titlepage.verso.style"/>
+
+<xsl:attribute-set name="setindex.titlepage.recto.style"/>
+<xsl:attribute-set name="setindex.titlepage.verso.style"/>
+
+<xsl:attribute-set name="indexdiv.titlepage.recto.style"/>
+<xsl:attribute-set name="indexdiv.titlepage.verso.style"/>
+
+<xsl:attribute-set name="colophon.titlepage.recto.style"/>
+<xsl:attribute-set name="colophon.titlepage.verso.style"/>
+
+<xsl:attribute-set name="sidebar.titlepage.recto.style"/>
+<xsl:attribute-set name="sidebar.titlepage.verso.style"/>
+
+<xsl:attribute-set name="qandaset.titlepage.recto.style"/>
+<xsl:attribute-set name="qandaset.titlepage.verso.style"/>
+
+<xsl:attribute-set name="section.titlepage.recto.style">
+  <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="section.titlepage.verso.style">
+  <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
+  <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:attribute-set name="sect1.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="sect1.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="sect2.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="sect2.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="sect3.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="sect3.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="sect4.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="sect4.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="sect5.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="sect5.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="simplesect.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="simplesect.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="refnamediv.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="refnamediv.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="refsynopsisdiv.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="refsynopsisdiv.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="refsection.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="refsection.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="refsect1.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="refsect1.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="refsect2.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="refsect2.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="refsect3.titlepage.recto.style"
+                   use-attribute-sets="section.titlepage.recto.style"/>
+<xsl:attribute-set name="refsect3.titlepage.verso.style"
+                   use-attribute-sets="section.titlepage.verso.style"/>
+
+<xsl:attribute-set name="table.of.contents.titlepage.recto.style"/>
+<xsl:attribute-set name="table.of.contents.titlepage.verso.style"/>
+
+<xsl:attribute-set name="list.of.tables.titlepage.recto.style"/>
+<xsl:attribute-set name="list.of.tables.contents.titlepage.verso.style"/>
+
+<xsl:attribute-set name="list.of.figures.titlepage.recto.style"/>
+<xsl:attribute-set name="list.of.figures.contents.titlepage.verso.style"/>
+
+<xsl:attribute-set name="list.of.equations.titlepage.recto.style"/>
+<xsl:attribute-set name="list.of.equations.contents.titlepage.verso.style"/>
+
+<xsl:attribute-set name="list.of.examples.titlepage.recto.style"/>
+<xsl:attribute-set name="list.of.examples.contents.titlepage.verso.style"/>
+
+<xsl:attribute-set name="list.of.procedures.titlepage.recto.style"/>
+<xsl:attribute-set name="list.of.procedures.contents.titlepage.verso.style"/>
+
+<xsl:attribute-set name="list.of.unknowns.titlepage.recto.style"/>
+<xsl:attribute-set name="list.of.unknowns.contents.titlepage.verso.style"/>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="titlepage.mode">
+  <!-- if an element isn't found in this mode, try the default mode -->
+  <xsl:apply-templates select="."/>
+</xsl:template>
+
+<xsl:template match="abbrev" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="abstract" mode="titlepage.mode">
+  <fo:block>
+    <xsl:call-template name="formal.object.heading">
+      <xsl:with-param name="title">
+        <xsl:apply-templates select="." mode="title.markup"/>
+      </xsl:with-param>
+    </xsl:call-template>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="abstract/title" mode="titlepage.mode"/>
+
+<xsl:template match="abstract/title" mode="titlepage.abstract.title.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="address" mode="titlepage.mode">
+  <!-- use the normal address handling code -->
+  <xsl:apply-templates select="."/>
+</xsl:template>
+
+<xsl:template match="affiliation" mode="titlepage.mode">
+  <fo:block>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="artpagenums" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="author" mode="titlepage.mode">
+  <fo:block>
+    <xsl:call-template name="anchor"/>
+    <xsl:call-template name="person.name"/>
+    <xsl:if test="affiliation/orgname">
+      <xsl:text>, </xsl:text>
+      <xsl:apply-templates select="affiliation/orgname" mode="titlepage.mode"/>
+    </xsl:if>
+    <xsl:if test="email|affiliation/address/email">
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="(email|affiliation/address/email)[1]"/>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="authorblurb" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="titlepage.mode">
+  <fo:wrapper>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:wrapper>
+</xsl:template>
+
+<xsl:template match="authorinitials" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="bibliomisc" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="bibliomset" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="collab" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="confgroup" mode="titlepage.mode">
+  <fo:block>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="confdates" mode="titlepage.mode">
+  <fo:block>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="conftitle" mode="titlepage.mode">
+  <fo:block>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="confnum" mode="titlepage.mode">
+  <!-- suppress -->
+</xsl:template>
+
+<xsl:template match="contractnum" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="contractsponsor" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="contrib" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="copyright" mode="titlepage.mode">
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'Copyright'"/>
+  </xsl:call-template>
+  <xsl:call-template name="gentext.space"/>
+  <xsl:call-template name="dingbat">
+    <xsl:with-param name="dingbat">copyright</xsl:with-param>
+  </xsl:call-template>
+  <xsl:call-template name="gentext.space"/>
+  <xsl:call-template name="copyright.years">
+    <xsl:with-param name="years" select="year"/>
+    <xsl:with-param name="print.ranges" select="$make.year.ranges"/>
+    <xsl:with-param name="single.year.ranges"
+                    select="$make.single.year.ranges"/>
+  </xsl:call-template>
+  <xsl:call-template name="gentext.space"/>
+  <xsl:apply-templates select="holder" mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="year" mode="titlepage.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="holder" mode="titlepage.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="corpcredit" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="corpname" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="date" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="edition" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+  <xsl:call-template name="gentext.space"/>
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'Edition'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="editor" mode="titlepage.mode">
+  <!-- The first editor is dealt with in the following template,
+       which in turn displays all editors of the same mode. -->
+</xsl:template>
+
+<xsl:template match="editor[1]" priority="2" mode="titlepage.mode">
+  <xsl:call-template name="gentext.edited.by"/>
+  <xsl:call-template name="gentext.space"/>
+  <xsl:call-template name="person.name.list">
+    <xsl:with-param name="person.list" select="../editor"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="firstname" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="graphic" mode="titlepage.mode">
+  <!-- use the normal graphic handling code -->
+  <xsl:apply-templates select="."/>
+</xsl:template>
+
+<xsl:template match="honorific" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="isbn" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="issn" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="biblioid" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="itermset" mode="titlepage.mode">
+  <!-- discard -->
+</xsl:template>
+
+<xsl:template match="invpartnumber" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="issuenum" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="jobtitle" mode="titlepage.mode">
+  <fo:block>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="keywordset" mode="titlepage.mode">
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="titlepage.mode">
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <fo:block id="{$id}">
+    <xsl:if test="title"> <!-- FIXME: add param for using default title? -->
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="legalnotice/title" mode="titlepage.mode">
+</xsl:template>
+
+<xsl:template match="lineage" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="modespec" mode="titlepage.mode">
+  <!-- discard -->
+</xsl:template>
+
+<xsl:template match="orgdiv" mode="titlepage.mode">
+  <xsl:if test="preceding-sibling::*[1][self::orgname]">
+    <xsl:text> </xsl:text>
+  </xsl:if>
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="orgname" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="titlepage.mode">
+  <xsl:variable name="contrib" select="string(contrib)"/>
+  <xsl:choose>
+    <xsl:when test="contrib">
+      <xsl:if test="not(preceding-sibling::othercredit[string(contrib)=$contrib])">
+        <fo:block>
+          <xsl:apply-templates mode="titlepage.mode" select="contrib"/>
+          <xsl:text>: </xsl:text>
+          <xsl:call-template name="person.name"/>
+          <xsl:apply-templates mode="titlepage.mode" select="affiliation"/>
+          <xsl:apply-templates select="following-sibling::othercredit[string(contrib)=$contrib]" mode="titlepage.othercredits"/>
+        </fo:block>
+      </xsl:if>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block><xsl:call-template name="person.name"/></fo:block>
+      <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="titlepage.othercredits">
+  <xsl:text>, </xsl:text>
+  <xsl:call-template name="person.name"/>
+</xsl:template>
+
+<xsl:template match="othername" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="pagenums" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="printhistory" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="productname" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="productnumber" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="publisher" mode="titlepage.mode">
+  <fo:block>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="publishername" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="pubsnumber" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="titlepage.mode">
+
+  <xsl:variable name="explicit.table.width">
+    <xsl:call-template name="pi.dbfo_table-width"/>
+  </xsl:variable>
+
+  <xsl:variable name="table.width">
+    <xsl:choose>
+      <xsl:when test="$explicit.table.width != ''">
+        <xsl:value-of select="$explicit.table.width"/>
+      </xsl:when>
+      <xsl:when test="$default.table.width = ''">
+        <xsl:text>100%</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$default.table.width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:table table-layout="fixed" width="{$table.width}" xsl:use-attribute-sets="revhistory.table.properties">
+    <fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
+    <fo:table-column column-number="2" column-width="proportional-column-width(1)"/>
+    <fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
+    <fo:table-body start-indent="0pt" end-indent="0pt">
+      <fo:table-row>
+        <fo:table-cell number-columns-spanned="3" xsl:use-attribute-sets="revhistory.table.cell.properties">
+          <fo:block xsl:use-attribute-sets="revhistory.title.properties">
+            <xsl:call-template name="gentext">
+              <xsl:with-param name="key" select="'RevHistory'"/>
+            </xsl:call-template>
+          </fo:block>
+        </fo:table-cell>
+      </fo:table-row>
+      <xsl:apply-templates mode="titlepage.mode"/>
+    </fo:table-body>
+  </fo:table>
+</xsl:template>
+
+<xsl:template match="revhistory/revision" mode="titlepage.mode">
+  <xsl:variable name="revnumber" select="revnumber"/>
+  <xsl:variable name="revdate"   select="date"/>
+  <xsl:variable name="revauthor" select="authorinitials|author"/>
+  <xsl:variable name="revremark" select="revremark|revdescription"/>
+  <fo:table-row>
+    <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+      <fo:block>
+        <xsl:if test="$revnumber">
+          <xsl:call-template name="gentext">
+            <xsl:with-param name="key" select="'Revision'"/>
+          </xsl:call-template>
+          <xsl:call-template name="gentext.space"/>
+          <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/>
+        </xsl:if>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+      <fo:block>
+        <xsl:apply-templates select="$revdate[1]" mode="titlepage.mode"/>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+      <fo:block>
+        <xsl:for-each select="$revauthor">
+          <xsl:apply-templates select="." mode="titlepage.mode"/>
+          <xsl:if test="position() != last()">
+            <xsl:text>, </xsl:text>
+          </xsl:if>
+        </xsl:for-each>
+      </fo:block>
+    </fo:table-cell>
+  </fo:table-row>
+  <xsl:if test="$revremark">
+    <fo:table-row>
+      <fo:table-cell number-columns-spanned="3" xsl:use-attribute-sets="revhistory.table.cell.properties">
+        <fo:block>
+          <xsl:apply-templates select="$revremark[1]" mode="titlepage.mode"/>
+        </fo:block>
+      </fo:table-cell>
+    </fo:table-row>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="revision/revnumber" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="revision/date" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="revision/authorinitials" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="revision/author" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="revision/revremark" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="revision/revdescription" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="seriesvolnums" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="shortaffil" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="subjectset" mode="titlepage.mode">
+  <!-- discard -->
+</xsl:template>
+
+<xsl:template match="subtitle" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="surname" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="titleabbrev" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="volumenum" mode="titlepage.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- Book templates -->
+
+<!-- Note: these templates cannot use *.titlepage.recto.mode or
+     *.titlepage.verso.mode. If they do then subsequent use of a custom
+     titlepage.templates.xml file will not work correctly. -->
+
+<!-- book recto -->
+
+<xsl:template match="bookinfo/authorgroup|info/authorgroup"
+              mode="titlepage.mode" priority="2">
+  <fo:block>
+    <xsl:call-template name="anchor"/>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<!-- book verso -->
+
+<xsl:template name="book.verso.title">
+  <fo:block>
+    <xsl:apply-templates mode="titlepage.mode"/>
+
+    <xsl:if test="following-sibling::subtitle
+                  |following-sibling::info/subtitle
+                  |following-sibling::bookinfo/subtitle">
+      <xsl:text>: </xsl:text>
+
+      <xsl:apply-templates select="(following-sibling::subtitle
+                                   |following-sibling::info/subtitle
+                                   |following-sibling::bookinfo/subtitle)[1]"
+                           mode="book.verso.subtitle.mode"/>
+    </xsl:if>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="book.verso.subtitle.mode">
+  <xsl:apply-templates mode="titlepage.mode"/>
+  <xsl:if test="following-sibling::subtitle">
+    <xsl:text>: </xsl:text>
+    <xsl:apply-templates select="following-sibling::subtitle[1]"
+                         mode="book.verso.subtitle.mode"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="verso.authorgroup">
+  <fo:block>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'by'"/>
+    </xsl:call-template>
+    <xsl:text> </xsl:text>
+    <xsl:call-template name="person.name.list">
+      <xsl:with-param name="person.list" select="author|corpauthor|editor"/>
+    </xsl:call-template>
+  </fo:block>
+  <xsl:apply-templates select="othercredit" mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="bookinfo/author|info/author"
+              mode="titlepage.mode" priority="2">
+  <fo:block>
+    <xsl:call-template name="person.name"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="bookinfo/corpauthor|info/corpauthor"
+              mode="titlepage.mode" priority="2">
+  <fo:block>
+    <xsl:apply-templates/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="bookinfo/pubdate|info/pubdate"
+              mode="titlepage.mode" priority="2">
+  <fo:block>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'published'"/>
+    </xsl:call-template>
+    <xsl:text> </xsl:text>
+    <xsl:apply-templates mode="titlepage.mode"/>
+  </fo:block>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 280 - 0
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$
+     ********************************************************************
+
+     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>

+ 416 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/verbatim.xsl

@@ -0,0 +1,416 @@
+<?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:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim"
+                xmlns:xverb="com.nwalsh.xalan.Verbatim"
+                xmlns:lxslt="http://xml.apache.org/xslt"
+                xmlns:exsl="http://exslt.org/common"
+                exclude-result-prefixes="sverb xverb lxslt exsl"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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="../highlighting/common.xsl"/>
+<xsl:include href="highlight.xsl"/>
+
+<lxslt:component prefix="xverb"
+                 functions="numberLines"/>
+
+<xsl:template match="programlisting|screen|synopsis">
+  <xsl:param name="suppress-numbers" select="'0'"/>
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="content">
+    <xsl:choose>
+      <xsl:when test="$suppress-numbers = '0'
+                      and @linenumbering = 'numbered'
+                      and $use.extensions != '0'
+                      and $linenumbering.extension != '0'">
+        <xsl:call-template name="number.rtf.lines">
+          <xsl:with-param name="rtf">
+	    <xsl:call-template name="apply-highlighting"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:call-template name="apply-highlighting"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$shade.verbatim != 0">
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="monospace.verbatim.properties shade.verbatim.style">
+        <xsl:choose>
+          <xsl:when test="$hyphenate.verbatim != 0 and function-available('exsl:node-set')">
+            <xsl:apply-templates select="exsl:node-set($content)" mode="hyphenate.verbatim"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="$content"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}"
+                xsl:use-attribute-sets="monospace.verbatim.properties">
+        <xsl:choose>
+          <xsl:when test="$hyphenate.verbatim != 0 and function-available('exsl:node-set')">
+            <xsl:apply-templates select="exsl:node-set($content)" mode="hyphenate.verbatim"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="$content"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="literallayout">
+  <xsl:param name="suppress-numbers" select="'0'"/>
+
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+  <xsl:variable name="content">
+    <xsl:choose>
+      <xsl:when test="$suppress-numbers = '0'
+                      and @linenumbering = 'numbered'
+                      and $use.extensions != '0'
+                      and $linenumbering.extension != '0'">
+        <xsl:call-template name="number.rtf.lines">
+          <xsl:with-param name="rtf">
+            <xsl:apply-templates/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@class='monospaced'">
+      <xsl:choose>
+        <xsl:when test="$shade.verbatim != 0">
+          <fo:block id="{$id}"
+                    xsl:use-attribute-sets="monospace.verbatim.properties shade.verbatim.style">
+
+            <xsl:copy-of select="$content"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block id="{$id}"
+                    xsl:use-attribute-sets="monospace.verbatim.properties">
+            <xsl:copy-of select="$content"/>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$shade.verbatim != 0">
+          <fo:block id="{$id}"
+                    xsl:use-attribute-sets="verbatim.properties shade.verbatim.style">
+            <xsl:copy-of select="$content"/>
+          </fo:block>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:block id="{$id}"
+                    xsl:use-attribute-sets="verbatim.properties">
+            <xsl:copy-of select="$content"/>
+          </fo:block>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="address">
+  <xsl:param name="suppress-numbers" select="'0'"/>
+
+  <xsl:variable name="content">
+    <xsl:choose>
+      <xsl:when test="$suppress-numbers = '0'
+                      and @linenumbering = 'numbered'
+                      and $use.extensions != '0'
+                      and $linenumbering.extension != '0'">
+        <xsl:call-template name="number.rtf.lines">
+          <xsl:with-param name="rtf">
+            <xsl:apply-templates/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:block xsl:use-attribute-sets="verbatim.properties">
+    <xsl:copy-of select="$content"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template name="number.rtf.lines">
+  <xsl:param name="rtf" select="''"/>
+  <xsl:param name="pi.context" select="."/>
+
+  <!-- Save the global values -->
+  <xsl:variable name="global.linenumbering.everyNth"
+                select="$linenumbering.everyNth"/>
+
+  <xsl:variable name="global.linenumbering.separator"
+                select="$linenumbering.separator"/>
+
+  <xsl:variable name="global.linenumbering.width"
+                select="$linenumbering.width"/>
+
+  <!-- Extract the <?dbfo linenumbering.*?> PI values -->
+  <xsl:variable name="pi.linenumbering.everyNth">
+    <xsl:call-template name="pi.dbfo_linenumbering.everyNth">
+      <xsl:with-param name="node" select="$pi.context"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="pi.linenumbering.separator">
+    <xsl:call-template name="pi.dbfo_linenumbering.separator">
+      <xsl:with-param name="node" select="$pi.context"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="pi.linenumbering.width">
+    <xsl:call-template name="pi.dbfo_linenumbering.width">
+      <xsl:with-param name="node" select="$pi.context"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <!-- Construct the 'in-context' values -->
+  <xsl:variable name="linenumbering.everyNth">
+    <xsl:choose>
+      <xsl:when test="$pi.linenumbering.everyNth != ''">
+        <xsl:value-of select="$pi.linenumbering.everyNth"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$global.linenumbering.everyNth"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="linenumbering.separator">
+    <xsl:choose>
+      <xsl:when test="$pi.linenumbering.separator != ''">
+        <xsl:value-of select="$pi.linenumbering.separator"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$global.linenumbering.separator"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="linenumbering.width">
+    <xsl:choose>
+      <xsl:when test="$pi.linenumbering.width != ''">
+        <xsl:value-of select="$pi.linenumbering.width"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$global.linenumbering.width"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="linenumbering.startinglinenumber">
+    <xsl:choose>
+      <xsl:when test="$pi.context/@startinglinenumber">
+        <xsl:value-of select="$pi.context/@startinglinenumber"/>
+      </xsl:when>
+      <xsl:when test="$pi.context/@continuation='continues'">
+        <xsl:variable name="lastLine">
+          <xsl:choose>
+            <xsl:when test="$pi.context/self::programlisting">
+              <xsl:call-template name="lastLineNumber">
+                <xsl:with-param name="listings"
+                     select="preceding::programlisting[@linenumbering='numbered']"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$pi.context/self::screen">
+              <xsl:call-template name="lastLineNumber">
+                <xsl:with-param name="listings"
+                     select="preceding::screen[@linenumbering='numbered']"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$pi.context/self::literallayout">
+              <xsl:call-template name="lastLineNumber">
+                <xsl:with-param name="listings"
+                     select="preceding::literallayout[@linenumbering='numbered']"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$pi.context/self::address">
+              <xsl:call-template name="lastLineNumber">
+                <xsl:with-param name="listings"
+                     select="preceding::address[@linenumbering='numbered']"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$pi.context/self::synopsis">
+              <xsl:call-template name="lastLineNumber">
+                <xsl:with-param name="listings"
+                     select="preceding::synopsis[@linenumbering='numbered']"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:message>
+                <xsl:text>Unexpected verbatim environment: </xsl:text>
+                <xsl:value-of select="local-name(.)"/>
+              </xsl:message>
+              <xsl:value-of select="0"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <xsl:value-of select="$lastLine + 1"/>
+      </xsl:when>
+      <xsl:otherwise>1</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="function-available('sverb:numberLines')">
+      <xsl:copy-of select="sverb:numberLines($rtf)"/>
+    </xsl:when>
+    <xsl:when test="function-available('xverb:numberLines')">
+      <xsl:copy-of select="xverb:numberLines($rtf)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message terminate="yes">
+        <xsl:text>No numberLines function available.</xsl:text>
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ======================================================================== -->
+
+<xsl:template name="lastLineNumber">
+  <xsl:param name="listings"/>
+  <xsl:param name="number" select="0"/>
+
+  <xsl:variable name="lines">
+    <xsl:call-template name="countLines">
+      <xsl:with-param name="listing" select="string($listings[1])"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="not($listings)">
+      <xsl:value-of select="$number"/>
+    </xsl:when>
+    <xsl:when test="$listings[1]/@startinglinenumber">
+      <xsl:value-of select="$number + $listings[1]/@startinglinenumber + $lines - 1"/>
+    </xsl:when>
+    <xsl:when test="$listings[1]/@continuation='continues'">
+      <xsl:call-template name="lastLineNumber">
+        <xsl:with-param name="listings" select="listings[position() &gt; 1]"/>
+        <xsl:with-param name="number" select="$number + $lines"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$lines"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="countLines">
+  <xsl:param name="listing"/>
+  <xsl:param name="count" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($listing, '&#10;')">
+      <xsl:call-template name="countLines">
+        <xsl:with-param name="listing" select="substring-after($listing, '&#10;')"/>
+        <xsl:with-param name="count" select="$count + 1"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$count"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ======================================================================== -->
+
+<xsl:template match="node()|@*" mode="hyphenate.verbatim">
+  <xsl:copy>
+    <xsl:apply-templates select="node()|@*" mode="hyphenate.verbatim"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="text()" mode="hyphenate.verbatim" priority="2">
+  <xsl:call-template name="hyphenate.verbatim.block">
+    <xsl:with-param name="content" select="."/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="hyphenate.verbatim.block">
+  <xsl:param name="content" select="''"/>
+  <xsl:param name="count" select="1"/>
+
+  <!-- recurse on lines first to keep recursion depth reasonable -->
+  <xsl:choose>
+    <xsl:when test="contains($content, '&#xA;')">
+      <xsl:variable name="line" select="substring-before($content, '&#xA;')"/>
+      <xsl:variable name="rest" select="substring-after($content, '&#xA;')"/>
+      <xsl:call-template name="hyphenate.verbatim">
+        <xsl:with-param name="content" select="concat($line, '&#xA;')"/>
+      </xsl:call-template>
+      <xsl:call-template name="hyphenate.verbatim.block">
+        <xsl:with-param name="content" select="$rest"/>
+        <xsl:with-param name="count" select="$count + 1"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="hyphenate.verbatim">
+        <xsl:with-param name="content" select="$content"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+  
+</xsl:template>
+
+<xsl:template name="hyphenate.verbatim">
+  <xsl:param name="content"/>
+  <xsl:variable name="head" select="substring($content, 1, 1)"/>
+  <xsl:variable name="tail" select="substring($content, 2)"/>
+  <xsl:choose>
+    <!-- Place soft-hyphen after space or non-breakable space. -->
+    <xsl:when test="$head = ' ' or $head = '&#160;'">
+      <xsl:text>&#160;</xsl:text>
+      <xsl:text>&#x00AD;</xsl:text>
+    </xsl:when>
+    <xsl:when test="$hyphenate.verbatim.characters != '' and
+                    translate($head, $hyphenate.verbatim.characters, '') = '' and not($tail = '')">
+      <xsl:value-of select="$head"/>
+      <xsl:text>&#x00AD;</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$head"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:if test="$tail">
+    <xsl:call-template name="hyphenate.verbatim">
+      <xsl:with-param name="content" select="$tail"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+
+</xsl:stylesheet>

+ 180 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/xep.xsl

@@ -0,0 +1,180 @@
+<?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:rx="http://www.renderx.com/XSL/Extensions"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+     (c) Stephane Bline Peregrine Systems 2001
+     Implementation of xep extensions:
+       * Pdf bookmarks (based on the XEP 2.5 implementation)
+       * Document information (XEP 2.5 meta information extensions)
+     ******************************************************************** -->
+
+<!-- FIXME: Norm, I changed things so that the top-level element (book or set)
+     does not appear in the TOC. Is this the right thing? -->
+
+<xsl:template name="xep-document-information">
+  <rx:meta-info>
+    <xsl:variable name="authors" 
+                  select="(//author|//editor|//corpauthor|//authorgroup)[1]"/>
+    <xsl:if test="$authors">
+      <xsl:variable name="author">
+        <xsl:choose>
+          <xsl:when test="$authors[self::authorgroup]">
+            <xsl:call-template name="person.name.list">
+              <xsl:with-param name="person.list" 
+                        select="$authors/*[self::author|self::corpauthor|
+                               self::othercredit|self::editor]"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:when test="$authors[self::corpauthor]">
+            <xsl:value-of select="$authors"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="person.name">
+              <xsl:with-param name="node" select="$authors"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <xsl:element name="rx:meta-field">
+        <xsl:attribute name="name">author</xsl:attribute>
+        <xsl:attribute name="value">
+          <xsl:value-of select="normalize-space($author)"/>
+        </xsl:attribute>
+      </xsl:element>
+    </xsl:if>
+
+    <xsl:variable name="title">
+      <xsl:apply-templates select="/*[1]" mode="label.markup"/>
+      <xsl:apply-templates select="/*[1]" mode="title.markup"/>
+    </xsl:variable>
+
+    <xsl:element name="rx:meta-field">
+      <xsl:attribute name="name">creator</xsl:attribute>
+      <xsl:attribute name="value">
+        <xsl:text>DocBook </xsl:text>
+        <xsl:value-of select="$DistroTitle"/>
+        <xsl:text> V</xsl:text>
+        <xsl:value-of select="$VERSION"/>
+      </xsl:attribute>
+    </xsl:element>
+
+    <xsl:element name="rx:meta-field">
+      <xsl:attribute name="name">title</xsl:attribute>
+      <xsl:attribute name="value">
+        <xsl:value-of select="normalize-space($title)"/>
+      </xsl:attribute>
+    </xsl:element>
+
+    <xsl:if test="//keyword">
+      <xsl:element name="rx:meta-field">
+        <xsl:attribute name="name">keywords</xsl:attribute>
+        <xsl:attribute name="value">
+          <xsl:for-each select="//keyword">
+            <xsl:value-of select="normalize-space(.)"/>
+            <xsl:if test="position() != last()">
+              <xsl:text>, </xsl:text>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:attribute>
+      </xsl:element>
+    </xsl:if>
+
+    <xsl:if test="//subjectterm">
+      <xsl:element name="rx:meta-field">
+        <xsl:attribute name="name">subject</xsl:attribute>
+        <xsl:attribute name="value">
+          <xsl:for-each select="//subjectterm">
+            <xsl:value-of select="normalize-space(.)"/>
+            <xsl:if test="position() != last()">
+              <xsl:text>, </xsl:text>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:attribute>
+      </xsl:element>
+    </xsl:if>
+  </rx:meta-info>
+</xsl:template>
+
+<!-- ********************************************************************
+     Pdf bookmarks
+     ******************************************************************** -->
+
+<xsl:template match="*" mode="xep.outline">
+  <xsl:apply-templates select="*" mode="xep.outline"/>
+</xsl:template>
+
+<xsl:template match="set|book|part|reference|preface|chapter|appendix|article
+                     |glossary|bibliography|index|setindex
+                     |refentry|refsynopsisdiv
+                     |refsect1|refsect2|refsect3|refsection
+                     |sect1|sect2|sect3|sect4|sect5|section"
+              mode="xep.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::*">
+      <rx:bookmark internal-destination="{$id}">
+        <rx:bookmark-label>
+          <xsl:value-of select="normalize-space($bookmark-label)"/>
+        </rx:bookmark-label>
+        <xsl:apply-templates select="*" mode="xep.outline"/>
+      </rx:bookmark>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$bookmark-label != ''">
+        <rx:bookmark internal-destination="{$id}">
+          <rx:bookmark-label>
+            <xsl:value-of select="normalize-space($bookmark-label)"/>
+          </rx:bookmark-label>
+        </rx:bookmark>
+      </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')
+                    and set|book|part|reference|section|sect1|refentry
+                        |article|bibliography|glossary|chapter
+                        |appendix">
+        <rx:bookmark internal-destination="toc...{$id}">
+          <rx:bookmark-label>
+            <xsl:call-template name="gentext">
+              <xsl:with-param name="key" select="'TableofContents'"/>
+            </xsl:call-template>
+          </rx:bookmark-label>
+        </rx:bookmark>
+      </xsl:if>
+      <xsl:apply-templates select="*" mode="xep.outline"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="xep-pis">
+  <xsl:if test="$crop.marks != 0">
+    <xsl:processing-instruction name="xep-pdf-crop-mark-width"><xsl:value-of select="$crop.mark.width"/></xsl:processing-instruction>
+    <xsl:processing-instruction name="xep-pdf-crop-offset"><xsl:value-of select="$crop.mark.offset"/></xsl:processing-instruction>
+    <xsl:processing-instruction name="xep-pdf-bleed"><xsl:value-of select="$crop.mark.bleed"/></xsl:processing-instruction>
+  </xsl:if>
+
+  <xsl:call-template name="user-xep-pis"/>
+</xsl:template>
+
+<!-- Placeholder for user defined PIs -->
+<xsl:template name="user-xep-pis"/>
+
+</xsl:stylesheet>

+ 1429 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/xref.xsl

@@ -0,0 +1,1429 @@
+<?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:exsl="http://exslt.org/common"
+                xmlns:xlink='http://www.w3.org/1999/xlink'
+                exclude-result-prefixes="exsl"
+                version='1.0'>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     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.
+
+     ******************************************************************** -->
+
+<!-- Use internal variable for olink xlink role for consistency -->
+<xsl:variable 
+      name="xolink.role">http://docbook.org/xlink/role/olink</xsl:variable>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="anchor">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <fo:inline id="{$id}"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="xref" name="xref">
+  <xsl:param name="xhref" select="@xlink:href"/>
+  <!-- is the @xlink:href a local idref link? -->
+  <xsl:param name="xlink.idref">
+    <xsl:if test="starts-with($xhref,'#')
+                  and (not(contains($xhref,'&#40;'))
+                  or starts-with($xhref, '#xpointer&#40;id&#40;'))">
+      <xsl:call-template name="xpointer.idref">
+        <xsl:with-param name="xpointer" select="$xhref"/>
+      </xsl:call-template>
+   </xsl:if>
+  </xsl:param>
+  <xsl:param name="xlink.targets" select="key('id',$xlink.idref)"/>
+  <xsl:param name="linkend.targets" select="key('id',@linkend)"/>
+  <xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/>
+  <xsl:param name="refelem" select="local-name($target)"/>
+
+  <xsl:variable name="xrefstyle">
+    <xsl:choose>
+      <xsl:when test="@role and not(@xrefstyle) 
+                      and $use.role.as.xrefstyle != 0">
+        <xsl:value-of select="@role"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@xrefstyle"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="content">
+    <fo:inline xsl:use-attribute-sets="xref.properties">
+      <xsl:choose>
+        <xsl:when test="@endterm">
+          <xsl:variable name="etargets" select="key('id',@endterm)"/>
+          <xsl:variable name="etarget" select="$etargets[1]"/>
+          <xsl:choose>
+            <xsl:when test="count($etarget) = 0">
+              <xsl:message>
+                <xsl:value-of select="count($etargets)"/>
+                <xsl:text>Endterm points to nonexistent ID: </xsl:text>
+                <xsl:value-of select="@endterm"/>
+              </xsl:message>
+              <xsl:text>???</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="$etarget" mode="endterm"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+  
+        <xsl:when test="$target/@xreflabel">
+          <xsl:call-template name="xref.xreflabel">
+            <xsl:with-param name="target" select="$target"/>
+          </xsl:call-template>
+        </xsl:when>
+  
+        <xsl:when test="$target">
+          <xsl:if test="not(parent::citation)">
+            <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
+          </xsl:if>
+  
+          <xsl:apply-templates select="$target" mode="xref-to">
+            <xsl:with-param name="referrer" select="."/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+          </xsl:apply-templates>
+  
+          <xsl:if test="not(parent::citation)">
+            <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+          </xsl:if>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>ERROR: xref linking to </xsl:text>
+            <xsl:value-of select="@linkend|@xlink:href"/>
+            <xsl:text> has no generated link text.</xsl:text>
+          </xsl:message>
+          <xsl:text>???</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:inline>
+  </xsl:variable>
+
+  <!-- Convert it into an active link -->
+  <xsl:call-template name="simple.xlink">
+    <xsl:with-param name="content" select="$content"/>
+  </xsl:call-template>
+
+  <!-- Add standard page reference? -->
+  <xsl:choose>
+    <xsl:when test="not($target)">
+      <!-- page numbers only for local targets -->
+    </xsl:when>
+    <xsl:when test="starts-with(normalize-space($xrefstyle), 'select:') 
+                  and contains($xrefstyle, 'nopage')">
+      <!-- negative xrefstyle in instance turns it off -->
+    </xsl:when>
+    <!-- positive xrefstyle already handles it -->
+    <xsl:when test="not(starts-with(normalize-space($xrefstyle), 'select:') 
+                  and (contains($xrefstyle, 'page')
+                       or contains($xrefstyle, 'Page')))
+                  and ( $insert.xref.page.number = 'yes' 
+                     or $insert.xref.page.number = '1')
+                  or local-name($target) = 'para'">
+      <xsl:apply-templates select="$target" mode="page.citation">
+        <xsl:with-param name="id" select="$target/@id|$target/@xml:id"/>
+      </xsl:apply-templates>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!-- Handled largely like an xref -->
+<!-- To be done: add support for begin, end, and units attributes -->
+<xsl:template match="biblioref" name="biblioref">
+  <xsl:variable name="targets" select="key('id',@linkend)"/>
+  <xsl:variable name="target" select="$targets[1]"/>
+  <xsl:variable name="refelem" select="local-name($target)"/>
+
+  <xsl:call-template name="check.id.unique">
+    <xsl:with-param name="linkend" select="@linkend"/>
+  </xsl:call-template>
+
+  <xsl:choose>
+    <xsl:when test="$refelem=''">
+      <xsl:message>
+        <xsl:text>XRef to nonexistent id: </xsl:text>
+        <xsl:value-of select="@linkend"/>
+      </xsl:message>
+      <xsl:text>???</xsl:text>
+    </xsl:when>
+
+    <xsl:when test="@endterm">
+      <fo:basic-link internal-destination="{@linkend}"
+                     xsl:use-attribute-sets="xref.properties">
+        <xsl:variable name="etargets" select="key('id',@endterm)"/>
+        <xsl:variable name="etarget" select="$etargets[1]"/>
+        <xsl:choose>
+          <xsl:when test="count($etarget) = 0">
+            <xsl:message>
+              <xsl:value-of select="count($etargets)"/>
+              <xsl:text>Endterm points to nonexistent ID: </xsl:text>
+              <xsl:value-of select="@endterm"/>
+            </xsl:message>
+            <xsl:text>???</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="$etarget" mode="endterm"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:basic-link>
+    </xsl:when>
+
+    <xsl:when test="$target/@xreflabel">
+      <fo:basic-link internal-destination="{@linkend}"
+                     xsl:use-attribute-sets="xref.properties">
+        <xsl:call-template name="xref.xreflabel">
+          <xsl:with-param name="target" select="$target"/>
+        </xsl:call-template>
+      </fo:basic-link>
+    </xsl:when>
+
+    <xsl:otherwise>
+      <xsl:if test="not(parent::citation)">
+        <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
+      </xsl:if>
+
+      <fo:basic-link internal-destination="{@linkend}"
+                     xsl:use-attribute-sets="xref.properties">
+        <xsl:apply-templates select="$target" mode="xref-to">
+          <xsl:with-param name="referrer" select="."/>
+          <xsl:with-param name="xrefstyle">
+            <xsl:choose>
+              <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
+                <xsl:value-of select="@role"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="@xrefstyle"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+        </xsl:apply-templates>
+      </fo:basic-link>
+
+      <xsl:if test="not(parent::citation)">
+        <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="endterm">
+  <!-- Process the children of the endterm element -->
+  <xsl:variable name="endterm">
+    <xsl:apply-templates select="child::node()"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="function-available('exsl:node-set')">
+      <xsl:apply-templates select="exsl:node-set($endterm)" mode="remove-ids"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$endterm"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*" mode="remove-ids">
+  <xsl:copy>
+    <xsl:for-each select="@*">
+      <xsl:choose>
+        <xsl:when test="name(.) != 'id'">
+          <xsl:copy/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>removing <xsl:value-of select="name(.)"/></xsl:message>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:apply-templates mode="remove-ids"/>
+  </xsl:copy>
+</xsl:template>
+
+<!--- ==================================================================== -->
+
+<xsl:template match="*" mode="xref-to-prefix"/>
+<xsl:template match="*" mode="xref-to-suffix"/>
+
+<xsl:template match="*" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+
+  <xsl:if test="$verbose != 0">
+    <xsl:message>
+      <xsl:text>Don't know what gentext to create for xref to: "</xsl:text>
+      <xsl:value-of select="name(.)"/>
+      <xsl:text>"</xsl:text>
+    </xsl:message>
+    <xsl:text>???</xsl:text>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="title" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <!-- if you xref to a title, xref to the parent... -->
+  <xsl:choose>
+    <!-- FIXME: how reliable is this? -->
+    <xsl:when test="contains(local-name(parent::*), 'info')">
+      <xsl:apply-templates select="parent::*[2]" mode="xref-to">
+        <xsl:with-param name="referrer" select="$referrer"/>
+        <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+        <xsl:with-param name="verbose" select="$verbose"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="parent::*" mode="xref-to">
+        <xsl:with-param name="referrer" select="$referrer"/>
+        <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+        <xsl:with-param name="verbose" select="$verbose"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="abstract|article|authorblurb|bibliodiv|bibliomset
+                     |biblioset|blockquote|calloutlist|caution|colophon
+                     |constraintdef|formalpara|glossdiv|important|indexdiv
+                     |itemizedlist|legalnotice|lot|msg|msgexplan|msgmain
+                     |msgrel|msgset|msgsub|note|orderedlist|partintro
+                     |productionset|qandadiv|refsynopsisdiv|segmentedlist
+                     |set|setindex|sidebar|tip|toc|variablelist|warning"
+              mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <!-- catch-all for things with (possibly optional) titles -->
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="author|editor|othercredit|personname" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:call-template name="person.name"/>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:call-template name="person.name.list"/>
+</xsl:template>
+
+<xsl:template match="figure|example|table|equation" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="procedure" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="task" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="cmdsynopsis" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="(.//command)[1]" mode="xref"/>
+</xsl:template>
+
+<xsl:template match="funcsynopsis" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="(.//function)[1]" mode="xref"/>
+</xsl:template>
+
+<xsl:template match="dedication|preface|chapter|appendix" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="bibliography" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="biblioentry|bibliomixed" mode="xref-to-prefix">
+  <xsl:text>[</xsl:text>
+</xsl:template>
+
+<xsl:template match="biblioentry|bibliomixed" mode="xref-to-suffix">
+  <xsl:text>]</xsl:text>
+</xsl:template>
+
+<xsl:template match="biblioentry|bibliomixed" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <!-- handles both biblioentry and bibliomixed -->
+  <xsl:choose>
+    <xsl:when test="string(.) = ''">
+      <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
+      <xsl:variable name="id" select="(@id|@xml:id)[1]"/>
+      <xsl:variable name="entry" select="$bib/bibliography/
+                                         *[@id=$id or @xml:id=$id][1]"/>
+      <xsl:choose>
+        <xsl:when test="$entry">
+          <xsl:choose>
+            <xsl:when test="$bibliography.numbered != 0">
+              <xsl:number from="bibliography" count="biblioentry|bibliomixed"
+                          level="any" format="1"/>
+            </xsl:when>
+            <xsl:when test="local-name($entry/*[1]) = 'abbrev'">
+              <xsl:apply-templates select="$entry/*[1]"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="(@id|@xml:id)[1]"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>No bibliography entry: </xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text> found in </xsl:text>
+            <xsl:value-of select="$bibliography.collection"/>
+          </xsl:message>
+          <xsl:value-of select="(@id|@xml:id)[1]"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$bibliography.numbered != 0">
+          <xsl:number from="bibliography" count="biblioentry|bibliomixed"
+                      level="any" format="1"/>
+        </xsl:when>
+        <xsl:when test="local-name(*[1]) = 'abbrev'">
+          <xsl:apply-templates select="*[1]"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="(@id|@xml:id)[1]"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="glossary" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="glossentry" mode="xref-to">
+  <xsl:choose>
+    <xsl:when test="$glossentry.show.acronym = 'primary'">
+      <xsl:choose>
+        <xsl:when test="acronym|abbrev">
+          <xsl:apply-templates select="(acronym|abbrev)[1]"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="glossterm[1]" mode="xref-to"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="glossterm[1]" mode="xref-to"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="glossterm" mode="xref-to">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="index" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="listitem" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="section|simplesect
+                     |sect1|sect2|sect3|sect4|sect5
+                     |refsect1|refsect2|refsect3|refsection" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+  <!-- What about "in Chapter X"? -->
+</xsl:template>
+
+<xsl:template match="bridgehead" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+  <!-- What about "in Chapter X"? -->
+</xsl:template>
+
+<xsl:template match="qandaset" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="qandadiv" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="qandaentry" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="question[1]" mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="question|answer" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="part|reference" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="refentry" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:choose>
+    <xsl:when test="refmeta/refentrytitle">
+      <xsl:apply-templates select="refmeta/refentrytitle"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="refnamediv/refname[1]"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:apply-templates select="refmeta/manvolnum"/>
+</xsl:template>
+
+<xsl:template match="refnamediv" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="refname[1]" mode="xref-to">
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="refname" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates mode="xref-to">
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="step" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:call-template name="gentext">
+    <xsl:with-param name="key" select="'Step'"/>
+  </xsl:call-template>
+  <xsl:text> </xsl:text>
+  <xsl:apply-templates select="." mode="number"/>
+</xsl:template>
+
+<xsl:template match="varlistentry" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="term[1]" mode="xref-to">
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="varlistentry/term" mode="xref-to">
+  <xsl:param name="verbose" select="1"/>
+  <!-- to avoid the comma that will be generated if there are several terms -->
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="co" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="callout-bug"/>
+</xsl:template>
+
+<xsl:template match="book" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose" select="1"/>
+
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="para" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="verbose"/>
+
+  <xsl:variable name="context" select="(ancestor::simplesect
+                                       |ancestor::section
+                                       |ancestor::sect1
+                                       |ancestor::sect2
+                                       |ancestor::sect3
+                                       |ancestor::sect4
+                                       |ancestor::sect5
+                                       |ancestor::refsection
+                                       |ancestor::refsect1
+                                       |ancestor::refsect2
+                                       |ancestor::refsect3
+                                       |ancestor::chapter
+                                       |ancestor::appendix
+                                       |ancestor::preface
+                                       |ancestor::partintro
+                                       |ancestor::dedication
+                                       |ancestor::colophon
+                                       |ancestor::bibliography
+                                       |ancestor::index
+                                       |ancestor::glossary
+                                       |ancestor::glossentry
+                                       |ancestor::listitem
+                                       |ancestor::varlistentry)[last()]"/>
+
+  <xsl:apply-templates select="$context" mode="xref-to">
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="link" name="link">
+  <xsl:param name="linkend" select="@linkend"/>
+  <xsl:param name="targets" select="key('id',$linkend)"/>
+  <xsl:param name="target" select="$targets[1]"/>
+
+  <xsl:variable name="xrefstyle">
+    <xsl:choose>
+      <xsl:when test="@role and not(@xrefstyle) 
+                      and $use.role.as.xrefstyle != 0">
+        <xsl:value-of select="@role"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@xrefstyle"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:variable name="content">
+    <fo:inline xsl:use-attribute-sets="xref.properties">
+      <xsl:choose>
+        <xsl:when test="count(child::node()) &gt; 0">
+          <!-- If it has content, use it -->
+          <xsl:apply-templates/>
+        </xsl:when>
+        <!-- look for an endterm -->
+        <xsl:when test="@endterm">
+          <xsl:variable name="etargets" select="key('id',@endterm)"/>
+          <xsl:variable name="etarget" select="$etargets[1]"/>
+          <xsl:choose>
+            <xsl:when test="count($etarget) = 0">
+              <xsl:message>
+                <xsl:value-of select="count($etargets)"/>
+                <xsl:text>Endterm points to nonexistent ID: </xsl:text>
+                <xsl:value-of select="@endterm"/>
+              </xsl:message>
+              <xsl:text>???</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:apply-templates select="$etarget" mode="endterm"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <!-- Use the xlink:href if no other text -->
+        <xsl:when test="@xlink:href">
+          <xsl:value-of select="@xlink:href"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>Link element has no content and no Endterm. </xsl:text>
+            <xsl:text>Nothing to show in the link to </xsl:text>
+            <xsl:value-of select="$target"/>
+          </xsl:message>
+          <xsl:text>???</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:inline>
+  </xsl:variable>
+
+  <xsl:call-template name="simple.xlink">
+    <xsl:with-param name="node" select="."/>
+    <xsl:with-param name="linkend" select="$linkend"/>
+    <xsl:with-param name="content" select="$content"/>
+  </xsl:call-template>
+
+  <!-- Add standard page reference? -->
+  <xsl:choose>
+    <!-- page numbering on link only enabled for @linkend -->
+    <!-- There is no link element in DB5 with xlink:href -->
+    <xsl:when test="not($linkend)">
+    </xsl:when>
+    <!-- negative xrefstyle in instance turns it off -->
+    <xsl:when test="starts-with(normalize-space($xrefstyle), 'select:') 
+                  and contains($xrefstyle, 'nopage')">
+    </xsl:when>
+    <xsl:when test="(starts-with(normalize-space($xrefstyle), 'select:') 
+                  and $insert.link.page.number = 'maybe'  
+                  and (contains($xrefstyle, 'page')
+                       or contains($xrefstyle, 'Page')))
+                  or ( $insert.link.page.number = 'yes' 
+                     or $insert.link.page.number = '1')
+                  or local-name($target) = 'para'">
+      <xsl:apply-templates select="$target" mode="page.citation">
+        <xsl:with-param name="id" select="$linkend"/>
+      </xsl:apply-templates>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="ulink" name="ulink">
+  <xsl:param name="url" select="@url"/>
+
+  <xsl:variable name ="ulink.url">
+    <xsl:call-template name="fo-external-image">
+      <xsl:with-param name="filename" select="$url"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <fo:basic-link xsl:use-attribute-sets="xref.properties"
+                 external-destination="{$ulink.url}">
+    <xsl:choose>
+      <xsl:when test="count(child::node())=0">
+        <xsl:call-template name="hyphenate-url">
+          <xsl:with-param name="url" select="$url"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:basic-link>
+
+  <xsl:if test="count(child::node()) != 0
+                and string(.) != $url
+                and $ulink.show != 0">
+    <!-- yes, show the URI -->
+    <xsl:choose>
+      <xsl:when test="$ulink.footnotes != 0 and not(ancestor::footnote)">
+        <fo:footnote>
+          <xsl:call-template name="ulink.footnote.number"/>
+          <fo:footnote-body xsl:use-attribute-sets="footnote.properties">
+            <fo:block>
+              <xsl:call-template name="ulink.footnote.number"/>
+              <xsl:text> </xsl:text>
+              <fo:basic-link external-destination="{$ulink.url}">
+                <xsl:value-of select="$url"/>
+              </fo:basic-link>
+            </fo:block>
+          </fo:footnote-body>
+        </fo:footnote>
+      </xsl:when>
+      <xsl:otherwise>
+        <fo:inline hyphenate="false">
+          <xsl:text> [</xsl:text>
+          <fo:basic-link external-destination="{$ulink.url}">
+            <xsl:call-template name="hyphenate-url">
+              <xsl:with-param name="url" select="$url"/>
+            </xsl:call-template>
+          </fo:basic-link>
+          <xsl:text>]</xsl:text>
+        </fo:inline>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:if>
+
+</xsl:template>
+
+<xsl:template name="ulink.footnote.number">
+  <fo:inline xsl:use-attribute-sets="footnote.mark.properties">
+    <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:variable name="fnum">
+      <!-- FIXME: list in @from is probably not complete -->
+      <xsl:number level="any" 
+                  from="chapter|appendix|preface|article|refentry|bibliography[not(parent::article)]" 
+                  count="footnote[not(@label)][not(ancestor::tgroup)]|ulink[node()][@url != .][not(ancestor::footnote)]" 
+                  format="1"/>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="string-length($footnote.number.symbols) &gt;= $fnum">
+        <xsl:value-of select="substring($footnote.number.symbols, $fnum, 1)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:number value="$fnum" format="{$footnote.number.format}"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:inline>
+</xsl:template>
+
+<xsl:template name="hyphenate-url">
+  <xsl:param name="url" select="''"/>
+  <xsl:choose>
+    <xsl:when test="$ulink.hyphenate = ''">
+      <xsl:value-of select="$url"/>
+    </xsl:when>
+    <xsl:when test="string-length($url) &gt; 1">
+      <xsl:variable name="char" select="substring($url, 1, 1)"/>
+      <xsl:value-of select="$char"/>
+      <xsl:if test="contains($ulink.hyphenate.chars, $char)">
+        <!-- Do not hyphen in-between // -->
+        <xsl:if test="not($char = '/' and substring($url,2,1) = '/')">
+          <xsl:copy-of select="$ulink.hyphenate"/>
+        </xsl:if>
+      </xsl:if>
+      <!-- recurse to the next character -->
+      <xsl:call-template name="hyphenate-url">
+        <xsl:with-param name="url" select="substring($url, 2)"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$url"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="olink" name="olink">
+  <!-- olink content may be passed in from xlink olink -->
+  <xsl:param name="content" select="NOTANELEMENT"/>
+
+  <xsl:call-template name="anchor"/>
+
+  <xsl:variable name="localinfo" select="@localinfo"/>
+
+  <xsl:choose>
+    <!-- olinks resolved by stylesheet and target database -->
+    <xsl:when test="@targetdoc or @targetptr or
+                    (@xlink:role=$xolink.role and
+                     contains(@xlink:href, '#') )" >
+
+      <xsl:variable name="targetdoc.att">
+        <xsl:choose>
+          <xsl:when test="@targetdoc != ''">
+            <xsl:value-of select="@targetdoc"/>
+          </xsl:when>
+          <xsl:when test="@xlink:role=$xolink.role and
+                       contains(@xlink:href, '#')" >
+            <xsl:value-of select="substring-before(@xlink:href, '#')"/>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="targetptr.att">
+        <xsl:choose>
+          <xsl:when test="@targetptr != ''">
+            <xsl:value-of select="@targetptr"/>
+          </xsl:when>
+          <xsl:when test="@xlink:role=$xolink.role and
+                       contains(@xlink:href, '#')" >
+            <xsl:value-of select="substring-after(@xlink:href, '#')"/>
+          </xsl:when>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="olink.lang">
+        <xsl:call-template name="l10n.language">
+          <xsl:with-param name="xref-context" select="true()"/>
+        </xsl:call-template>
+      </xsl:variable>
+    
+      <xsl:variable name="target.database.filename">
+        <xsl:call-template name="select.target.database">
+          <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
+          <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
+          <xsl:with-param name="olink.lang" select="$olink.lang"/>
+        </xsl:call-template>
+      </xsl:variable>
+    
+      <xsl:variable name="target.database" 
+          select="document($target.database.filename, /)"/>
+    
+      <xsl:if test="$olink.debug != 0">
+        <xsl:message>
+          <xsl:text>Olink debug: root element of target.database is '</xsl:text>
+          <xsl:value-of select="local-name($target.database/*[1])"/>
+          <xsl:text>'.</xsl:text>
+        </xsl:message>
+      </xsl:if>
+    
+      <xsl:variable name="olink.key">
+        <xsl:call-template name="select.olink.key">
+          <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
+          <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
+          <xsl:with-param name="olink.lang" select="$olink.lang"/>
+          <xsl:with-param name="target.database" select="$target.database"/>
+        </xsl:call-template>
+      </xsl:variable>
+    
+      <xsl:if test="string-length($olink.key) = 0">
+        <xsl:message>
+          <xsl:text>Error: unresolved olink: </xsl:text>
+          <xsl:text>targetdoc/targetptr = '</xsl:text>
+          <xsl:value-of select="$targetdoc.att"/>
+          <xsl:text>/</xsl:text>
+          <xsl:value-of select="$targetptr.att"/>
+          <xsl:text>'.</xsl:text>
+        </xsl:message>
+      </xsl:if>
+
+      <xsl:variable name="href">
+        <xsl:call-template name="make.olink.href">
+          <xsl:with-param name="olink.key" select="$olink.key"/>
+          <xsl:with-param name="target.database" select="$target.database"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <!-- Olink that points to internal id can be a link -->
+      <xsl:variable name="linkend">
+        <xsl:call-template name="olink.as.linkend">
+          <xsl:with-param name="olink.key" select="$olink.key"/>
+          <xsl:with-param name="olink.lang" select="$olink.lang"/>
+          <xsl:with-param name="target.database" select="$target.database"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="hottext">
+        <xsl:choose>
+          <xsl:when test="$content">
+            <xsl:copy-of select="$content"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="olink.hottext">
+              <xsl:with-param name="olink.key" select="$olink.key"/>
+              <xsl:with-param name="olink.lang" select="$olink.lang"/>
+              <xsl:with-param name="target.database" select="$target.database"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:variable name="olink.docname.citation">
+        <xsl:call-template name="olink.document.citation">
+          <xsl:with-param name="olink.key" select="$olink.key"/>
+          <xsl:with-param name="target.database" select="$target.database"/>
+          <xsl:with-param name="olink.lang" select="$olink.lang"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="olink.page.citation">
+        <xsl:call-template name="olink.page.citation">
+          <xsl:with-param name="olink.key" select="$olink.key"/>
+          <xsl:with-param name="target.database" select="$target.database"/>
+          <xsl:with-param name="olink.lang" select="$olink.lang"/>
+          <xsl:with-param name="linkend" select="$linkend"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$linkend != ''">
+          <fo:basic-link internal-destination="{$linkend}"
+                       xsl:use-attribute-sets="xref.properties">
+            <xsl:copy-of select="$hottext"/>
+            <xsl:copy-of select="$olink.page.citation"/>
+          </fo:basic-link>
+        </xsl:when>
+        <xsl:when test="$href != ''">
+          <xsl:choose>
+            <xsl:when test="$xep.extensions != 0">
+              <fo:basic-link external-destination="url({$href})"
+                             xsl:use-attribute-sets="olink.properties">
+                <xsl:copy-of select="$hottext"/>
+              </fo:basic-link>
+              <xsl:copy-of select="$olink.page.citation"/>
+              <xsl:copy-of select="$olink.docname.citation"/>
+            </xsl:when>
+            <xsl:when test="$axf.extensions != 0">
+              <fo:basic-link external-destination="{$href}"
+                             xsl:use-attribute-sets="olink.properties">
+                <xsl:copy-of select="$hottext"/>
+              </fo:basic-link>
+              <xsl:copy-of select="$olink.page.citation"/>
+              <xsl:copy-of select="$olink.docname.citation"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <fo:basic-link external-destination="{$href}"
+                             xsl:use-attribute-sets="olink.properties">
+                <xsl:copy-of select="$hottext"/>
+              </fo:basic-link>
+              <xsl:copy-of select="$olink.page.citation"/>
+              <xsl:copy-of select="$olink.docname.citation"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select="$hottext"/>
+          <xsl:copy-of select="$olink.page.citation"/>
+          <xsl:copy-of select="$olink.docname.citation"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+
+    <!-- olink never implemented in FO for old olink entity syntax -->
+    <xsl:otherwise>
+      <xsl:apply-templates/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*" mode="insert.olink.docname.markup">
+  <xsl:param name="docname" select="''"/>
+  
+  <fo:inline font-style="italic">
+    <xsl:value-of select="$docname"/>
+  </fo:inline>
+
+</xsl:template>
+
+<!-- This prevents error message when processing olinks with xrefstyle -->
+<xsl:template match="olink" mode="object.xref.template"/>
+
+
+<xsl:template name="olink.as.linkend">
+  <xsl:param name="olink.key" select="''"/>
+  <xsl:param name="olink.lang" select="''"/>
+  <xsl:param name="target.database" select="NotANode"/>
+
+  <xsl:variable name="targetdoc">
+    <xsl:value-of select="substring-before($olink.key, '/')"/>
+  </xsl:variable>
+
+  <xsl:variable name="targetptr">
+    <xsl:value-of 
+       select="substring-before(substring-after($olink.key, '/'), '/')"/>
+  </xsl:variable>
+
+  <xsl:variable name="target.lang">
+    <xsl:variable name="candidate">
+      <xsl:for-each select="$target.database" >
+        <xsl:value-of 
+                  select="key('targetptr-key', $olink.key)/@lang" />
+      </xsl:for-each>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$candidate != ''">
+        <xsl:value-of select="$candidate"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$olink.lang"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:if test="$current.docid = $targetdoc and 
+                $olink.lang = $target.lang">
+    <xsl:variable name="targets" select="key('id',$targetptr)"/>
+    <xsl:variable name="target" select="$targets[1]"/>
+    <xsl:if test="$target">
+      <xsl:value-of select="$targetptr"/>
+    </xsl:if>
+  </xsl:if>
+
+</xsl:template>
+
+
+<xsl:template name="olink.outline">
+  <xsl:param name="outline.base.uri"/>
+  <xsl:param name="localinfo"/>
+  <xsl:param name="return" select="href"/>
+
+  <xsl:message terminate="yes">Fatal error: olink.outline template: what is this supposed to do?</xsl:message>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="title.xref">
+  <xsl:param name="target" select="."/>
+  <xsl:choose>
+    <xsl:when test="local-name($target) = 'figure'
+                    or local-name($target) = 'example'
+                    or local-name($target) = 'equation'
+                    or local-name($target) = 'table'
+                    or local-name($target) = 'dedication'
+                    or local-name($target) = 'preface'
+                    or local-name($target) = 'bibliography'
+                    or local-name($target) = 'glossary'
+                    or local-name($target) = 'index'
+                    or local-name($target) = 'setindex'
+                    or local-name($target) = 'colophon'">
+      <xsl:call-template name="gentext.startquote"/>
+      <xsl:apply-templates select="$target" mode="title.markup"/>
+      <xsl:call-template name="gentext.endquote"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:inline font-style="italic">
+        <xsl:apply-templates select="$target" mode="title.markup"/>
+      </fo:inline>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="number.xref">
+  <xsl:param name="target" select="."/>
+  <xsl:apply-templates select="$target" mode="label.markup"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="xref.xreflabel">
+  <!-- called to process an xreflabel...you might use this to make  -->
+  <!-- xreflabels come out in the right font for different targets, -->
+  <!-- for example. -->
+  <xsl:param name="target" select="."/>
+  <xsl:value-of select="$target/@xreflabel"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="title" mode="xref">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="command" mode="xref">
+  <xsl:call-template name="inline.boldseq"/>
+</xsl:template>
+
+<xsl:template match="function" mode="xref">
+  <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
+<xsl:template match="*" mode="page.citation">
+  <xsl:param name="id" select="'???'"/>
+
+  <fo:basic-link internal-destination="{$id}"
+                 xsl:use-attribute-sets="xref.properties">
+    <fo:inline keep-together.within-line="always">
+      <xsl:call-template name="substitute-markup">
+        <xsl:with-param name="template">
+          <xsl:call-template name="gentext.template">
+            <xsl:with-param name="name" select="'page.citation'"/>
+            <xsl:with-param name="context" select="'xref'"/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+    </fo:inline>
+  </fo:basic-link>
+</xsl:template>
+
+<xsl:template match="*" mode="pagenumber.markup">
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+  <fo:page-number-citation ref-id="{$id}"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="insert.title.markup">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="title"/>
+
+  <xsl:choose>
+    <!-- FIXME: what about the case where titleabbrev is inside the info? -->
+    <xsl:when test="$purpose = 'xref' and titleabbrev">
+      <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$title"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="chapter|appendix" mode="insert.title.markup">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="title"/>
+
+  <xsl:choose>
+    <xsl:when test="$purpose = 'xref'">
+      <fo:inline font-style="italic">
+        <xsl:copy-of select="$title"/>
+      </fo:inline>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$title"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*" mode="insert.subtitle.markup">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="subtitle"/>
+
+  <xsl:copy-of select="$subtitle"/>
+</xsl:template>
+
+<xsl:template match="*" mode="insert.label.markup">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="label"/>
+
+  <xsl:copy-of select="$label"/>
+</xsl:template>
+
+<xsl:template match="*" mode="insert.pagenumber.markup">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="pagenumber"/>
+
+  <xsl:copy-of select="$pagenumber"/>
+</xsl:template>
+
+<xsl:template match="*" mode="insert.direction.markup">
+  <xsl:param name="purpose"/>
+  <xsl:param name="xrefstyle"/>
+  <xsl:param name="direction"/>
+
+  <xsl:copy-of select="$direction"/>
+</xsl:template>
+
+<xsl:template match="olink" mode="pagenumber.markup">
+  <!-- Local olinks can use page-citation -->
+  <xsl:variable name="targetdoc.att" select="@targetdoc"/>
+  <xsl:variable name="targetptr.att" select="@targetptr"/>
+
+  <xsl:variable name="olink.lang">
+    <xsl:call-template name="l10n.language">
+      <xsl:with-param name="xref-context" select="true()"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="target.database.filename">
+    <xsl:call-template name="select.target.database">
+      <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
+      <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
+      <xsl:with-param name="olink.lang" select="$olink.lang"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="target.database" 
+      select="document($target.database.filename, /)"/>
+
+  <xsl:if test="$olink.debug != 0">
+    <xsl:message>
+      <xsl:text>Olink debug: root element of target.database is '</xsl:text>
+      <xsl:value-of select="local-name($target.database/*[1])"/>
+      <xsl:text>'.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:variable name="olink.key">
+    <xsl:call-template name="select.olink.key">
+      <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
+      <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
+      <xsl:with-param name="olink.lang" select="$olink.lang"/>
+      <xsl:with-param name="target.database" select="$target.database"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <!-- Olink that points to internal id can be a link -->
+  <xsl:variable name="linkend">
+    <xsl:call-template name="olink.as.linkend">
+      <xsl:with-param name="olink.key" select="$olink.key"/>
+      <xsl:with-param name="olink.lang" select="$olink.lang"/>
+      <xsl:with-param name="target.database" select="$target.database"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$linkend != ''">
+      <fo:page-number-citation ref-id="{$linkend}"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>Olink error: no page number linkend for local olink '</xsl:text>
+        <xsl:value-of select="$olink.key"/>
+        <xsl:text>'</xsl:text>
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>

+ 16 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/highlighting/common.xsl

@@ -0,0 +1,16 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version='1.0'>
+
+<!-- ********************************************************************
+
+     Fake file to keep happy ../{fo,xhtml}/verbatim.xsl
+
+     ******************************************************************** -->
+
+  <xsl:template name="apply-highlighting">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+</xsl:stylesheet>
+

+ 439 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/html/chunker.xsl

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

+ 542 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/lib/lib.xsl

@@ -0,0 +1,542 @@
+<?xml version="1.0"?>
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     This module implements DTD-independent functions
+
+     ******************************************************************** -->
+
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" xmlns:dyn="http://exslt.org/dynamic" xmlns:src="http://nwalsh.com/xmlns/litprog/fragment" exclude-result-prefixes="src" version="1.0">
+
+<xsl:template name="dot.count">
+  <!-- Returns the number of "." characters in a string -->
+  <xsl:param name="string"/>
+  <xsl:param name="count" select="0"/>
+  <xsl:choose>
+    <xsl:when test="contains($string, '.')">
+      <xsl:call-template name="dot.count">
+        <xsl:with-param name="string" select="substring-after($string, '.')"/>
+        <xsl:with-param name="count" select="$count+1"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$count"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="copy-string">
+  <!-- returns 'count' copies of 'string' -->
+  <xsl:param name="string"/>
+  <xsl:param name="count" select="0"/>
+  <xsl:param name="result"/>
+
+  <xsl:choose>
+    <xsl:when test="$count&gt;0">
+      <xsl:call-template name="copy-string">
+        <xsl:with-param name="string" select="$string"/>
+        <xsl:with-param name="count" select="$count - 1"/>
+        <xsl:with-param name="result">
+          <xsl:value-of select="$result"/>
+          <xsl:value-of select="$string"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$result"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="string.subst">
+  <xsl:param name="string"/>
+  <xsl:param name="target"/>
+  <xsl:param name="replacement"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($string, $target)">
+      <xsl:variable name="rest">
+        <xsl:call-template name="string.subst">
+          <xsl:with-param name="string" select="substring-after($string, $target)"/>
+          <xsl:with-param name="target" select="$target"/>
+          <xsl:with-param name="replacement" select="$replacement"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:value-of select="concat(substring-before($string, $target),                                    $replacement,                                    $rest)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$string"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="xpointer.idref">
+  <xsl:param name="xpointer">http://...</xsl:param>
+  <xsl:choose>
+    <xsl:when test="starts-with($xpointer, '#xpointer(id(')">
+      <xsl:variable name="rest" select="substring-after($xpointer, '#xpointer(id(')"/>
+      <xsl:variable name="quote" select="substring($rest, 1, 1)"/>
+      <xsl:value-of select="substring-before(substring-after($xpointer, $quote), $quote)"/>
+    </xsl:when>
+    <xsl:when test="starts-with($xpointer, '#')">
+      <xsl:value-of select="substring-after($xpointer, '#')"/>
+    </xsl:when>
+    <!-- otherwise it's a pointer to some other document -->
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="length-magnitude">
+  <xsl:param name="length" select="'0pt'"/>
+
+  <xsl:choose>
+    <xsl:when test="string-length($length) = 0"/>
+    <xsl:when test="substring($length,1,1) = '0'                     or substring($length,1,1) = '1'                     or substring($length,1,1) = '2'                     or substring($length,1,1) = '3'                     or substring($length,1,1) = '4'                     or substring($length,1,1) = '5'                     or substring($length,1,1) = '6'                     or substring($length,1,1) = '7'                     or substring($length,1,1) = '8'                     or substring($length,1,1) = '9'                     or substring($length,1,1) = '.'">
+      <xsl:value-of select="substring($length,1,1)"/>
+      <xsl:call-template name="length-magnitude">
+        <xsl:with-param name="length" select="substring($length,2)"/>
+      </xsl:call-template>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="length-units">
+  <xsl:param name="length" select="'0pt'"/>
+  <xsl:param name="default.units" select="'px'"/>
+  <xsl:variable name="magnitude">
+    <xsl:call-template name="length-magnitude">
+      <xsl:with-param name="length" select="$length"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="units">
+    <xsl:value-of select="substring($length, string-length($magnitude)+1)"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$units = ''">
+      <xsl:value-of select="$default.units"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$units"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="length-spec">
+  <xsl:param name="length" select="'0pt'"/>
+  <xsl:param name="default.units" select="'px'"/>
+
+  <xsl:variable name="magnitude">
+    <xsl:call-template name="length-magnitude">
+      <xsl:with-param name="length" select="$length"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="units">
+    <xsl:value-of select="substring($length, string-length($magnitude)+1)"/>
+  </xsl:variable>
+
+  <xsl:value-of select="$magnitude"/>
+  <xsl:choose>
+    <xsl:when test="$units='cm'                     or $units='mm'                     or $units='in'                     or $units='pt'                     or $units='pc'                     or $units='px'                     or $units='em'">
+      <xsl:value-of select="$units"/>
+    </xsl:when>
+    <xsl:when test="$units = ''">
+      <xsl:value-of select="$default.units"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>Unrecognized unit of measure: </xsl:text>
+        <xsl:value-of select="$units"/>
+        <xsl:text>.</xsl:text>
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="length-in-points">
+  <xsl:param name="length" select="'0pt'"/>
+  <xsl:param name="em.size" select="10"/>
+  <xsl:param name="pixels.per.inch" select="90"/>
+
+  <xsl:variable name="magnitude">
+    <xsl:call-template name="length-magnitude">
+      <xsl:with-param name="length" select="$length"/>
+    </xsl:call-template>
+  </xsl:variable>
+
+  <xsl:variable name="units">
+    <xsl:value-of select="substring($length, string-length($magnitude)+1)"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$units = 'pt'">
+      <xsl:value-of select="$magnitude"/>
+    </xsl:when>
+    <xsl:when test="$units = 'cm'">
+      <xsl:value-of select="$magnitude div 2.54 * 72.0"/>
+    </xsl:when>
+    <xsl:when test="$units = 'mm'">
+      <xsl:value-of select="$magnitude div 25.4 * 72.0"/>
+    </xsl:when>
+    <xsl:when test="$units = 'in'">
+      <xsl:value-of select="$magnitude * 72.0"/>
+    </xsl:when>
+    <xsl:when test="$units = 'pc'">
+      <xsl:value-of select="$magnitude * 12.0"/>
+    </xsl:when>
+    <xsl:when test="$units = 'px'">
+      <xsl:value-of select="$magnitude div $pixels.per.inch * 72.0"/>
+    </xsl:when>
+    <xsl:when test="$units = 'em'">
+      <xsl:value-of select="$magnitude * $em.size"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>Unrecognized unit of measure: </xsl:text>
+        <xsl:value-of select="$units"/>
+        <xsl:text>.</xsl:text>
+      </xsl:message>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="pi-attribute">
+  <xsl:param name="pis" select="processing-instruction('BOGUS_PI')"/>
+  <xsl:param name="attribute">filename</xsl:param>
+  <xsl:param name="count">1</xsl:param>
+
+  <xsl:choose>
+    <xsl:when test="$count&gt;count($pis)">
+      <!-- not found -->
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="pi">
+        <xsl:value-of select="$pis[$count]"/>
+      </xsl:variable>
+      <xsl:variable name="pivalue">
+        <xsl:value-of select="concat(' ', normalize-space($pi))"/>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="contains($pivalue,concat(' ', $attribute, '='))">
+          <xsl:variable name="rest" select="substring-after($pivalue,concat(' ', $attribute,'='))"/>
+          <xsl:variable name="quote" select="substring($rest,1,1)"/>
+          <xsl:value-of select="substring-before(substring($rest,2),$quote)"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="pi-attribute">
+            <xsl:with-param name="pis" select="$pis"/>
+            <xsl:with-param name="attribute" select="$attribute"/>
+            <xsl:with-param name="count" select="$count + 1"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="lookup.key">
+  <xsl:param name="key" select="''"/>
+  <xsl:param name="table" select="''"/>
+
+  <xsl:if test="contains($table, ' ')">
+    <xsl:choose>
+      <xsl:when test="substring-before($table, ' ') = $key">
+        <xsl:variable name="rest" select="substring-after($table, ' ')"/>
+        <xsl:choose>
+          <xsl:when test="contains($rest, ' ')">
+            <xsl:value-of select="substring-before($rest, ' ')"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$rest"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="lookup.key">
+          <xsl:with-param name="key" select="$key"/>
+          <xsl:with-param name="table" select="substring-after(substring-after($table,' '), ' ')"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:if>
+</xsl:template>
+<xsl:template name="xpath.location">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="path" select="''"/>
+
+  <xsl:variable name="next.path">
+    <xsl:value-of select="local-name($node)"/>
+    <xsl:if test="$path != ''">/</xsl:if>
+    <xsl:value-of select="$path"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$node/parent::*">
+      <xsl:call-template name="xpath.location">
+        <xsl:with-param name="node" select="$node/parent::*"/>
+        <xsl:with-param name="path" select="$next.path"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>/</xsl:text>
+      <xsl:value-of select="$next.path"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="comment-escape-string">
+  <xsl:param name="string" select="''"/>
+
+  <xsl:if test="starts-with($string, '-')">
+    <xsl:text> </xsl:text>
+  </xsl:if>
+
+  <xsl:call-template name="comment-escape-string.recursive">
+    <xsl:with-param name="string" select="$string"/>
+  </xsl:call-template>
+
+  <xsl:if test="substring($string, string-length($string), 1) = '-'">
+    <xsl:text> </xsl:text>
+  </xsl:if>
+</xsl:template>
+<xsl:template name="comment-escape-string.recursive">
+  <xsl:param name="string" select="''"/>
+  <xsl:choose>
+    <xsl:when test="contains($string, '--')">
+      <xsl:value-of select="substring-before($string, '--')"/>
+      <xsl:value-of select="'- -'"/>
+      <xsl:call-template name="comment-escape-string.recursive">
+        <xsl:with-param name="string" select="substring-after($string, '--')"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$string"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+  <xsl:template name="str.tokenize.keep.delimiters">
+    <xsl:param name="string" select="''"/>
+    <xsl:param name="delimiters" select="' '"/>
+    <xsl:choose>
+      <xsl:when test="not($string)"/>
+      <xsl:when test="not($delimiters)">
+	<xsl:call-template name="str.tokenize.keep.delimiters-characters">
+	  <xsl:with-param name="string" select="$string"/>
+	</xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:call-template name="str.tokenize.keep.delimiters-delimiters">
+	  <xsl:with-param name="string" select="$string"/>
+	  <xsl:with-param name="delimiters" select="$delimiters"/>
+	</xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="str.tokenize.keep.delimiters-characters">
+    <xsl:param name="string"/>
+    <xsl:if test="$string">
+      <token><xsl:value-of select="substring($string, 1, 1)"/></token>
+      <xsl:call-template name="str.tokenize.keep.delimiters-characters">
+	<xsl:with-param name="string" select="substring($string, 2)"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template name="str.tokenize.keep.delimiters-delimiters">
+    <xsl:param name="string"/>
+    <xsl:param name="delimiters"/>
+    <xsl:variable name="delimiter" select="substring($delimiters, 1, 1)"/>
+    <xsl:choose>
+      <xsl:when test="not($delimiter)">
+	<token><xsl:value-of select="$string"/></token>
+      </xsl:when>
+      <xsl:when test="contains($string, $delimiter)">
+	<xsl:if test="not(starts-with($string, $delimiter))">
+	  <xsl:call-template name="str.tokenize.keep.delimiters-delimiters">
+	    <xsl:with-param name="string" select="substring-before($string, $delimiter)"/>
+	    <xsl:with-param name="delimiters" select="substring($delimiters, 2)"/>
+	  </xsl:call-template>
+	</xsl:if>
+	<!-- output each delimiter -->
+	<xsl:value-of select="$delimiter"/>
+	<xsl:call-template name="str.tokenize.keep.delimiters-delimiters">
+	  <xsl:with-param name="string" select="substring-after($string, $delimiter)"/>
+	  <xsl:with-param name="delimiters" select="$delimiters"/>
+	</xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:call-template name="str.tokenize.keep.delimiters-delimiters">
+	  <xsl:with-param name="string" select="$string"/>
+	  <xsl:with-param name="delimiters" select="substring($delimiters, 2)"/>
+	</xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+    <xsl:template name="apply-string-subst-map">
+      <xsl:param name="content"/>
+      <xsl:param name="map.contents"/>
+      <xsl:variable name="replaced_text">
+        <xsl:call-template name="string.subst">
+          <xsl:with-param name="string" select="$content"/>
+          <xsl:with-param name="target" select="$map.contents[1]/@oldstring"/>
+          <xsl:with-param name="replacement" select="$map.contents[1]/@newstring"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="$map.contents[2]">
+          <xsl:call-template name="apply-string-subst-map">
+            <xsl:with-param name="content" select="$replaced_text"/>
+            <xsl:with-param name="map.contents" select="$map.contents[position() &gt; 1]"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$replaced_text"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:template>
+
+  
+    <xsl:template name="apply-character-map">
+      <xsl:param name="content"/>
+      <xsl:param name="map.contents"/>
+      <xsl:variable name="replaced_text">
+        <xsl:call-template name="string.subst">
+          <xsl:with-param name="string" select="$content"/>
+          <xsl:with-param name="target" select="$map.contents[1]/@character"/>
+          <xsl:with-param name="replacement" select="$map.contents[1]/@string"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="$map.contents[2]">
+          <xsl:call-template name="apply-character-map">
+            <xsl:with-param name="content" select="$replaced_text"/>
+            <xsl:with-param name="map.contents" select="$map.contents[position() &gt; 1]"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$replaced_text"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:template>
+
+  
+  <xsl:template name="read-character-map">
+    <xsl:param name="use.subset"/>
+    <xsl:param name="subset.profile"/>
+    <xsl:param name="uri"/>
+    <xsl:choose>
+      <xsl:when test="$use.subset != 0">
+        <!-- use a subset of the character map instead of the full map -->
+        <xsl:choose>
+          <!-- xsltproc and Xalan both support dyn:evaluate() -->
+          <xsl:when test="function-available('dyn:evaluate')">
+            <xsl:copy-of select="document($uri)//*[local-name()='output-character']                                  [dyn:evaluate($subset.profile)]"/>
+          </xsl:when>
+          <!-- Saxon has its own evaluate() & doesn't support dyn:evaluate() -->
+          <xsl:when test="function-available('saxon:evaluate')">
+            <xsl:copy-of select="document($uri)//*[local-name()='output-character']                                  [saxon:evaluate($subset.profile)]"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:message terminate="yes">
+Error: To process character-map subsets, you must use an XSLT engine
+that supports the evaluate() XSLT extension function. Your XSLT engine
+does not support it.
+</xsl:message>
+          </xsl:otherwise>
+        </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <!-- value of $use.subset is non-zero, so use the full map -->
+        <xsl:copy-of select="document($uri)//*[local-name()='output-character']"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+<xsl:template name="count.uri.path.depth">
+  <xsl:param name="filename" select="''"/>
+  <xsl:param name="count" select="0"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($filename, '/')">
+      <xsl:call-template name="count.uri.path.depth">
+        <xsl:with-param name="filename" select="substring-after($filename, '/')"/>
+        <xsl:with-param name="count" select="$count + 1"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$count"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+<xsl:template name="trim.common.uri.paths">
+  <xsl:param name="uriA" select="''"/>
+  <xsl:param name="uriB" select="''"/>
+  <xsl:param name="return" select="'A'"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($uriA, '/') and contains($uriB, '/')                     and substring-before($uriA, '/') = substring-before($uriB, '/')">
+      <xsl:call-template name="trim.common.uri.paths">
+        <xsl:with-param name="uriA" select="substring-after($uriA, '/')"/>
+        <xsl:with-param name="uriB" select="substring-after($uriB, '/')"/>
+        <xsl:with-param name="return" select="$return"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$return = 'A'">
+          <xsl:value-of select="$uriA"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$uriB"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+  <xsl:template name="trim.text">
+    <xsl:param name="contents" select="."/>
+    <xsl:variable name="contents-left-trimmed">
+      <xsl:call-template name="trim-left">
+        <xsl:with-param name="contents" select="$contents"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:variable name="contents-trimmed">
+      <xsl:call-template name="trim-right">
+        <xsl:with-param name="contents" select="$contents-left-trimmed"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:value-of select="$contents-trimmed"/>
+  </xsl:template>
+
+  <xsl:template name="trim-left">
+    <xsl:param name="contents"/>
+    <xsl:choose>
+      <xsl:when test="starts-with($contents,'&#10;') or                       starts-with($contents,'&#13;') or                       starts-with($contents,' ') or                       starts-with($contents,'&#9;')">
+        <xsl:call-template name="trim-left">
+          <xsl:with-param name="contents" select="substring($contents, 2)"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$contents"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="trim-right">
+    <xsl:param name="contents"/>
+    <xsl:variable name="last-char">
+      <xsl:value-of select="substring($contents, string-length($contents), 1)"/>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="($last-char = '&#10;') or                       ($last-char = '&#13;') or                       ($last-char = ' ') or                       ($last-char = '&#9;')">
+        <xsl:call-template name="trim-right">
+          <xsl:with-param name="contents" select="substring($contents, 1, string-length($contents) - 1)"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$contents"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>

+ 239 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/profile-mode.xsl

@@ -0,0 +1,239 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:saxon="http://icl.com/saxon"
+                exclude-result-prefixes="saxon"
+                version="1.0">
+
+<!-- Should be base URI for imagedata and so on fixed? -->
+<xsl:param name="profile.baseuri.fixup" select="true()"/>
+
+<!-- Copy all non-element nodes -->
+<xsl:template match="@*|text()|comment()|processing-instruction()" mode="profile">
+  <xsl:copy/>
+</xsl:template>
+
+<!-- Profile elements based on input parameters -->
+<xsl:template match="*" mode="profile">
+
+  <xsl:variable name="arch.content">
+    <xsl:if test="@arch">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.arch"/>
+        <xsl:with-param name="b" select="@arch"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="arch.ok" select="not(@arch) or not($profile.arch) or
+                                       $arch.content != '' or @arch = ''"/>
+
+  <xsl:variable name="audience.content">
+    <xsl:if test="@audience">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.audience"/>
+        <xsl:with-param name="b" select="@audience"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="audience.ok" 
+                        select="not(@audience) or not($profile.audience) or
+                                $audience.content != '' or @audience = ''"/>
+
+  <xsl:variable name="condition.content">
+    <xsl:if test="@condition">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.condition"/>
+        <xsl:with-param name="b" select="@condition"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="condition.ok" select="not(@condition) or not($profile.condition) or
+                                            $condition.content != '' or @condition = ''"/>
+
+  <xsl:variable name="conformance.content">
+    <xsl:if test="@conformance">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.conformance"/>
+        <xsl:with-param name="b" select="@conformance"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="conformance.ok" select="not(@conformance) or not($profile.conformance) or
+                                              $conformance.content != '' or @conformance = ''"/>
+
+  <xsl:variable name="lang.content">
+    <xsl:if test="@lang | @xml:lang">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.lang"/>
+        <xsl:with-param name="b" select="(@lang | @xml:lang)[1]"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="lang.ok" select="not(@lang | @xml:lang) or not($profile.lang) or
+                                       $lang.content != '' or @lang = '' or @xml:lang = ''"/>
+
+  <xsl:variable name="os.content">
+    <xsl:if test="@os">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.os"/>
+        <xsl:with-param name="b" select="@os"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="os.ok" select="not(@os) or not($profile.os) or
+                                     $os.content != '' or @os = ''"/>
+
+  <xsl:variable name="revision.content">
+    <xsl:if test="@revision">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.revision"/>
+        <xsl:with-param name="b" select="@revision"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="revision.ok" select="not(@revision) or not($profile.revision) or
+                                           $revision.content != '' or @revision = ''"/>
+
+  <xsl:variable name="revisionflag.content">
+    <xsl:if test="@revisionflag">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.revisionflag"/>
+        <xsl:with-param name="b" select="@revisionflag"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="revisionflag.ok" select="not(@revisionflag) or not($profile.revisionflag) or
+                                               $revisionflag.content != '' or @revisionflag = ''"/>
+
+  <xsl:variable name="role.content">
+    <xsl:if test="@role">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.role"/>
+        <xsl:with-param name="b" select="@role"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="role.ok" select="not(@role) or not($profile.role) or
+                                       $role.content != '' or @role = ''"/>
+
+  <xsl:variable name="security.content">
+    <xsl:if test="@security">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.security"/>
+        <xsl:with-param name="b" select="@security"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="security.ok" select="not(@security) or not($profile.security) or
+                                           $security.content != '' or @security = ''"/>
+
+  <xsl:variable name="status.content">
+    <xsl:if test="@status">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.status"/>
+        <xsl:with-param name="b" select="@status"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="status.ok" select="not(@status) or not($profile.status) or
+                                           $status.content != '' or @status = ''"/>
+
+  <xsl:variable name="userlevel.content">
+    <xsl:if test="@userlevel">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.userlevel"/>
+        <xsl:with-param name="b" select="@userlevel"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="userlevel.ok" select="not(@userlevel) or not($profile.userlevel) or
+                                            $userlevel.content != '' or @userlevel = ''"/>
+
+  <xsl:variable name="vendor.content">
+    <xsl:if test="@vendor">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.vendor"/>
+        <xsl:with-param name="b" select="@vendor"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="vendor.ok" select="not(@vendor) or not($profile.vendor) or
+                                         $vendor.content != '' or @vendor = ''"/>
+
+  <xsl:variable name="wordsize.content">
+    <xsl:if test="@wordsize">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.wordsize"/>
+        <xsl:with-param name="b" select="@wordsize"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="wordsize.ok" 
+                        select="not(@wordsize) or not($profile.wordsize) or
+                                $wordsize.content != '' or @wordsize = ''"/>
+
+  <xsl:variable name="attribute.content">
+    <xsl:if test="@*[local-name()=$profile.attribute]">
+      <xsl:call-template name="cross.compare">
+        <xsl:with-param name="a" select="$profile.value"/>
+        <xsl:with-param name="b" select="@*[local-name()=$profile.attribute]"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="attribute.ok" 
+                select="not(@*[local-name()=$profile.attribute]) or 
+                        not($profile.value) or $attribute.content != '' or 
+                        @*[local-name()=$profile.attribute] = '' or 
+                        not($profile.attribute)"/>
+
+  <xsl:if test="$arch.ok and 
+                $audience.ok and 
+                $condition.ok and 
+                $conformance.ok and 
+                $lang.ok and 
+                $os.ok and 
+                $revision.ok and 
+                $revisionflag.ok and 
+                $role.ok and 
+                $security.ok and 
+                $status.ok and 
+                $userlevel.ok and 
+                $vendor.ok and 
+                $wordsize.ok and 
+                $attribute.ok">
+    <xsl:copy>
+      <xsl:copy-of select="@*"/>
+
+      <!-- Entity references must be replaced with filereferences for temporary tree -->
+      <xsl:if test="@entityref and $profile.baseuri.fixup">
+        <xsl:attribute name="fileref">
+          <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
+        </xsl:attribute>
+      </xsl:if>
+
+      <!-- xml:base is eventually added to the root element -->
+      <xsl:if test="not(../..) and $profile.baseuri.fixup">
+        <xsl:call-template name="add-xml-base"/>
+      </xsl:if>
+
+      <xsl:apply-templates select="node()" mode="profile"/>
+    </xsl:copy>
+  </xsl:if>
+</xsl:template>
+
+<!-- Returns non-empty string if list in $b contains one ore more values from list $a -->
+<xsl:template name="cross.compare">
+  <xsl:param name="a"/>
+  <xsl:param name="b"/>
+  <xsl:param name="sep" select="$profile.separator"/>
+  <xsl:variable name="head" select="substring-before(concat($a, $sep), $sep)"/>
+  <xsl:variable name="tail" select="substring-after($a, $sep)"/>
+  <xsl:if test="contains(concat($sep, $b, $sep), concat($sep, $head, $sep))">1</xsl:if>
+  <xsl:if test="$tail">
+    <xsl:call-template name="cross.compare">
+      <xsl:with-param name="a" select="$tail"/>
+      <xsl:with-param name="b" select="$b"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 49 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/profile.xsl

@@ -0,0 +1,49 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+<!-- Include common profiling stylesheet -->
+<xsl:import href="profile-mode.xsl"/>
+
+<!-- This file must be included, because profile-mode is using templates from it -->
+<xsl:import href="../common/stripns.xsl"/>
+
+<!-- In the two pass processing there is no need for base URI fixup -->
+<xsl:param name="profile.baseuri.fixup" select="false()"/>
+
+<!-- If you need to validate profiled content against DTD, 
+     create customization that will import this stylesheet and
+     will use xsl:output (see example bellow) to output reference 
+     to the desired DTD version. --> 
+<!-- Generate DocBook instance with correct DOCTYPE -->
+<!--
+<xsl:output method="xml" 
+            doctype-public="-//OASIS//DTD DocBook XML V4.5//EN"
+            doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/>
+-->
+
+<!-- Profiling parameters -->
+<xsl:param name="profile.arch" select="''"/>
+<xsl:param name="profile.audience" select="''"/>
+<xsl:param name="profile.condition" select="''"/>
+<xsl:param name="profile.conformance" select="''"/>
+<xsl:param name="profile.lang" select="''"/>
+<xsl:param name="profile.os" select="''"/>
+<xsl:param name="profile.revision" select="''"/>
+<xsl:param name="profile.revisionflag" select="''"/>
+<xsl:param name="profile.role" select="''"/>
+<xsl:param name="profile.security" select="''"/>
+<xsl:param name="profile.status" select="''"/>
+<xsl:param name="profile.userlevel" select="''"/>
+<xsl:param name="profile.vendor" select="''"/>
+<xsl:param name="profile.wordsize" select="''"/>
+<xsl:param name="profile.attribute" select="''"/>
+<xsl:param name="profile.value" select="''"/>
+<xsl:param name="profile.separator" select="';'"/>
+
+<!-- Call common profiling mode -->
+<xsl:template match="/">
+  <xsl:apply-templates select="." mode="profile"/>
+</xsl:template>
+
+</xsl:stylesheet>
+

+ 27 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/strip-attributes.xsl

@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+<xsl:output method="xml"/>
+
+<xsl:param name="attributes" select="''"/>
+
+<xsl:variable name="strip-attributes"
+              select="concat(' ', normalize-space($attributes), ' ')"/>
+
+<xsl:template match="@*|text()|comment()|processing-instruction()">
+  <xsl:copy/>
+</xsl:template>
+
+<xsl:template match="*">
+  <xsl:copy>
+    <xsl:for-each select="@*">
+      <xsl:if test="not(contains($strip-attributes, concat(' ',name(.),' ')))">
+        <xsl:copy-of select="."/>
+      </xsl:if>
+    </xsl:for-each>
+    <xsl:apply-templates select="node()"/>
+  </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>

+ 159 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/profiling/xsl2profile.xsl

@@ -0,0 +1,159 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:xslo="http://www.w3.org/1999/XSL/TransformAlias"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                exclude-result-prefixes="fo"
+                version="1.0">
+
+<xsl:include href="../lib/lib.xsl"/>
+
+<xsl:output method="xml" encoding="US-ASCII"/>
+
+<xsl:namespace-alias stylesheet-prefix="xslo" result-prefix="xsl"/>
+
+<xsl:preserve-space elements="*"/>
+
+<xsl:template match="/">
+  <xsl:comment>This file was created automatically by xsl2profile</xsl:comment>
+  <xsl:comment>from the DocBook XSL stylesheets.</xsl:comment>
+  <xsl:apply-templates/>
+</xsl:template>
+
+<!-- Make sure we override some templates and parameters appropriately for XHTML -->
+<xsl:template match="xsl:stylesheet">
+  <xsl:copy>
+    <xsl:attribute name="exslt:dummy" xmlns:exslt="http://exslt.org/common">dummy</xsl:attribute>
+    <xsl:attribute name="ng:dummy" xmlns:ng="http://docbook.org/docbook-ng">dummy</xsl:attribute>
+    <xsl:attribute name="db:dummy" xmlns:db="http://docbook.org/ns/docbook">dummy</xsl:attribute>
+    <xsl:if test="not(@extension-element-prefixes)">
+      <xsl:attribute name="extension-element-prefixes">exslt</xsl:attribute>
+    </xsl:if>
+    <xsl:if test="not(@exclude-result-prefixes)">
+      <xsl:attribute name="exclude-result-prefixes">exslt</xsl:attribute>
+    </xsl:if>
+    <xsl:for-each select="@*">
+      <xsl:choose>
+        <xsl:when test="local-name(.) = 'extension-element-prefixes' or
+                        local-name(.) = 'exclude-result-prefixes'">
+          <xsl:attribute name="{local-name(.)}"><xsl:value-of select="concat(., ' exslt')"/></xsl:attribute>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="*">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="comment()|processing-instruction()|text()">
+  <xsl:copy/>
+</xsl:template>
+
+<xsl:template match="xsl:template[@match='/']">
+  <xslo:include href="../profiling/profile-mode.xsl"/>
+  <xslo:variable 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 name="profiled-nodes" select="exslt:node-set($profiled-content)"/>
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="correct"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="xsl:template[@name='hhc-main' or @name='hhp-main'] | xsl:variable[@name='raw.help.title']">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="correct"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="*[starts-with(@select, '/')]" mode="correct">
+  <xsl:copy>
+    <xsl:for-each select="@*">
+      <xsl:choose>
+        <xsl:when test="local-name(.) = 'select' and string(.) =  '/'">
+          <xsl:attribute name="{local-name(.)}">$profiled-nodes</xsl:attribute>
+        </xsl:when>
+        <xsl:when test="local-name(.) = 'select' and starts-with(., '/')">
+          <xsl:attribute name="{local-name(.)}">$profiled-nodes<xsl:value-of select="."/></xsl:attribute>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:apply-templates mode="correct"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match='*[contains(@*, "key(&apos;id&apos;,$rootid)")]' mode="correct" priority="2">
+  <xsl:copy>
+    <xsl:for-each select="@*">
+      <xsl:choose>
+        <xsl:when test='contains(., "key(&apos;id&apos;,$rootid)")'>
+          <xsl:attribute name="{local-name(.)}">
+            <xsl:call-template name="string.subst">
+              <xsl:with-param name="string" select="."/>
+              <xsl:with-param name="target">key('id',$rootid)</xsl:with-param>
+              <xsl:with-param name="replacement">$profiled-nodes//*[@id=$rootid]</xsl:with-param>
+            </xsl:call-template>
+          </xsl:attribute>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:apply-templates mode="correct"/>
+  </xsl:copy>
+</xsl:template>
+
+<!-- FO stylesheet has apply-templates without select, we must detect it by context -->
+<xsl:template match="fo:root//xsl:apply-templates" mode="correct">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:attribute name="select">$profiled-nodes/node()</xsl:attribute>
+    <xsl:apply-templates mode="correct"/>
+  </xsl:copy>
+</xsl:template>
+
+<!-- DB5 namespace stripping is already done  -->
+<xsl:template match="xsl:when[contains(@test, 'self::db')]" mode="correct">
+  <xsl:copy>
+    <xsl:attribute name="test">false()</xsl:attribute>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="*" mode="correct">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="correct"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="comment()|processing-instruction()|text()" mode="correct">
+  <xsl:copy/>
+</xsl:template>
+
+</xsl:stylesheet>

+ 133 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/admon.xsl

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

+ 158 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/annotations.xsl

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

+ 139 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx-kimber.xsl

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

+ 109 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx-kosek.xsl

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

+ 21 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx-ng.xsl

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--This file was created automatically by html2xhtml-->
+<!--from the HTML stylesheets.-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the DocBook XSL Stylesheet distribution.
+     See ../README or http://docbook.sf.net/ for copyright
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- You should have this directly in your customization file. -->
+<!-- This file is there only to retain backward compatibility. -->
+<xsl:import href="autoidx-kosek.xsl"/>
+<xsl:param name="index.method">kosek</xsl:param>
+
+</xsl:stylesheet>

File diff suppressed because it is too large
+ 23 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autoidx.xsl


+ 625 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/autotoc.xsl

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

+ 1300 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/biblio-iso690.xsl

@@ -0,0 +1,1300 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--This file was created automatically by html2xhtml-->
+<!--from the HTML stylesheets.-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
+
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     The original code for processing bibliography in ISO690 style
+     was provided by Jana Dvorakova <jana4u@seznam.cz>
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<!-- if biblioentry.alt.primary.seps is set to nonzero value then use alternative separators for primary responsibility - $alt.person.two.sep, $alt.person.last.sep, $alt.person.more.sep  -->
+<xsl:param name="biblioentry.alt.primary.seps" select="0"/>
+
+<!-- how many authors will be printed if there is more than three authors - set to number 1 (default value), 2 or 3 -->
+<xsl:param name="biblioentry.primary.count" select="1"/>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="iso690.makecitation">
+<!-- Types of resources -->
+  <xsl:choose>
+
+    <!-- SYSTEMS OF ELECTRONIC COMMUNICATION : ENTIRE MESSAGE SYSTEM -->
+    <!-- same as Monographs -->
+    <xsl:when test="./@role='messagesystem'">
+      <xsl:call-template name="iso690.monogr"/>
+    </xsl:when>
+
+    <!-- SYSTEMS OF ELECTRONIC COMMUNICATION : ELECTRONIC MESSAGES -->
+    <!-- same as Contributions to Monographs -->
+    <xsl:when test="./@role='message'">
+      <xsl:call-template name="iso690.paper.mon"/>
+    </xsl:when>
+
+    <!-- SERIALS -->
+    <xsl:when test="./@role='serial' or ./biblioid/@class='issn' or ./issn">
+      <xsl:call-template name="iso690.serial"/>
+    </xsl:when>
+
+    <!-- PARTS OF MONOGRAPHS -->
+    <xsl:when test="./@role='part' or (./bibliomisc[@role='secnum']|./bibliomisc[@role='sectitle'])">
+      <xsl:call-template name="iso690.monogr.part"/>
+    </xsl:when>
+
+    <!-- CONTRIBUTIONS TO MONOGRAPHS -->
+    <xsl:when test="./@role='contribution' or (./biblioset/@relation='part' and ./biblioset/@relation='book')">
+      <xsl:call-template name="iso690.paper.mon"/>
+    </xsl:when>
+
+    <!-- ARTICLES, ETC., IN SERIALS -->
+    <xsl:when test="./@role='article' or (./biblioset/@relation='journal' and ./biblioset/@relation='article')">
+      <xsl:call-template name="iso690.article"/>
+    </xsl:when>
+
+    <!-- PATENT DOCUMENTS -->
+    <xsl:when test="./@role='patent' or (./bibliomisc[@role='patenttype'] and ./bibliomisc[@role='patentnum'])">
+      <xsl:call-template name="iso690.patent"/>
+    </xsl:when>
+
+    <!-- MONOGRAPHS -->
+    <xsl:otherwise>
+      <xsl:call-template name="iso690.monogr"/>
+    </xsl:otherwise>
+
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!-- MONOGRAPHS -->
+<xsl:template name="iso690.monogr">
+  <!-- Primary responsibility -->
+  <xsl:call-template name="iso690.primary"/>
+  <!-- Title and Type of medium -->
+  <xsl:call-template name="iso690.title"/>
+  <!-- Subordinate responsibility -->
+  <xsl:call-template name="iso690.secondary"/>
+  <!-- Edition -->
+  <xsl:call-template name="iso690.edition"/>
+  <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
+  <xsl:call-template name="iso690.pub"/>
+  <!-- Extent -->
+  <xsl:call-template name="iso690.extent"/>
+  <!-- Series -->
+  <xsl:call-template name="iso690.serie"/>
+  <!-- Notes -->
+  <xsl:call-template name="iso690.notice"/>
+  <!-- Avaibility and access -->
+  <xsl:call-template name="iso690.access"/>
+  <!-- Standard number -->
+  <xsl:call-template name="iso690.isbn"/>
+</xsl:template>
+
+<!-- SERIALS -->
+<xsl:template name="iso690.serial">
+  <!-- Title and Type of medium -->
+  <xsl:call-template name="iso690.title"/>
+  <!-- Responsibility [nonEL] -->
+  <xsl:if test="not(./bibliomisc[@role='medium'])">
+    <xsl:call-template name="iso690.secondary"/>
+  </xsl:if>
+  <!-- Edition -->
+  <xsl:call-template name="iso690.edition">
+    <xsl:with-param name="after" select="./bibliomisc[@role='issuing']"/>
+  </xsl:call-template>
+  <!-- Issue designation (date and/or num) [nonEL] -->
+  <xsl:if test="not(./bibliomisc[@role='medium'])">
+    <xsl:call-template name="iso690.issuing"/>
+  </xsl:if>
+  <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
+  <xsl:call-template name="iso690.pub"/>
+  <!-- Series -->
+  <xsl:call-template name="iso690.serie"/>
+  <!-- Notes -->
+  <xsl:call-template name="iso690.notice"/>
+  <!-- Avaibility and access -->
+  <xsl:call-template name="iso690.access"/>
+  <!-- Standard number -->
+  <xsl:call-template name="iso690.issn"/>
+</xsl:template>
+
+<!-- PARTS OF MONOGRAPHS -->
+<xsl:template name="iso690.monogr.part">
+  <!-- Primary responsibility of host document -->
+  <xsl:call-template name="iso690.primary"/>
+  <!-- Title and Type of medium of host document -->
+  <xsl:call-template name="iso690.title"/>
+  <!-- Subordinate responsibility of host document [EL] -->
+  <xsl:if test="./bibliomisc[@role='medium']">
+    <xsl:call-template name="iso690.secondary"/>
+  </xsl:if>
+  <!-- Edition -->
+  <xsl:call-template name="iso690.edition">
+    <xsl:with-param name="after" select="./volumenum"/>
+  </xsl:call-template>
+  <!-- Numeration of the part [nonEL]-->
+  <xsl:if test="not(./bibliomisc[@role='medium'])">
+    <xsl:call-template name="iso690.partnr"/>
+  <!-- Subordinate responsibility [nonEL] -->
+    <xsl:call-template name="iso690.secondary"/>
+  </xsl:if>
+  <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
+  <xsl:call-template name="iso690.pub"/>
+  <!-- Location within host -->
+  <xsl:call-template name="iso690.part.location"/>
+  <xsl:if test="./bibliomisc[@role='medium']">
+  <!-- Numeration within host document [EL] -->
+  <!-- Notes [EL] -->
+    <xsl:call-template name="iso690.notice"/>
+  <!-- Avaibility and access [EL] -->
+    <xsl:call-template name="iso690.access"/>
+  <!-- Standard number [EL] -->
+    <xsl:call-template name="iso690.isbn"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- CONTRIBUTIONS TO MONOGRAPHS -->
+<xsl:template name="iso690.paper.mon">
+<!-- Contribution -->
+  <xsl:apply-templates mode="iso690.paper.part" select="./biblioset[@relation='part']"/>
+<!-- In -->
+  <xsl:text>In </xsl:text>
+<!-- Host -->
+  <xsl:apply-templates mode="iso690.paper.book" select="./biblioset[@relation='book']"/>
+</xsl:template>
+
+<xsl:template match="biblioset" mode="iso690.paper.part">
+<!-- Contribution -->
+  <!-- Primary responsibility -->
+  <xsl:call-template name="iso690.primary"/>
+  <!-- Title -->
+  <xsl:call-template name="iso690.title">
+    <xsl:with-param name="italic" select="0"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="biblioset" mode="iso690.paper.book">
+<!-- Host -->
+  <!-- Primary responsibility -->
+  <xsl:call-template name="iso690.primary"/>
+  <!-- Title and Type of medium -->
+  <xsl:call-template name="iso690.title"/>
+  <!-- Subordinate responsibility [EL] -->
+  <xsl:if test="./bibliomisc[@role='medium']">
+    <xsl:call-template name="iso690.secondary"/>
+  </xsl:if>
+  <!-- Edition -->
+  <xsl:call-template name="iso690.edition"/>
+  <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
+  <xsl:call-template name="iso690.paper.pub"/>
+  <!-- Numeration within host document [EL] -->
+  <!-- Location within host -->
+  <xsl:call-template name="iso690.location"/>
+  <xsl:if test="./bibliomisc[@role='medium']">
+  <!-- Notes [EL] -->
+    <xsl:call-template name="iso690.notice"/>
+  <!-- Avaibility and access [EL] -->
+    <xsl:call-template name="iso690.access"/>
+  <!-- Standard number [EL] -->
+    <xsl:call-template name="iso690.isbn"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- ARTICLES, ETC., IN SERIALS -->
+<xsl:template name="iso690.article">
+<!-- Article -->
+  <xsl:apply-templates mode="iso690.article.art" select="./biblioset[@relation='article']"/>
+<!-- Serial -->
+  <xsl:apply-templates mode="iso690.article.jour" select="./biblioset[@relation='journal']"/>
+</xsl:template>
+
+<xsl:template match="biblioset" mode="iso690.article.art">
+<!-- Article -->
+  <!-- Primary responsibility -->
+  <xsl:call-template name="iso690.primary"/>
+  <!-- Title -->
+  <xsl:call-template name="iso690.title">
+    <xsl:with-param name="italic" select="0"/>
+  </xsl:call-template>
+  <!-- Subordinate responsibility [nonEL] -->
+  <xsl:if test="not(../*/bibliomisc[@role='medium'])">
+    <xsl:call-template name="iso690.secondary"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="biblioset" mode="iso690.article.jour">
+<!-- Serial -->
+  <!-- Title and Type of medium -->
+  <xsl:call-template name="iso690.title"/>
+  <!-- Edition -->
+  <xsl:call-template name="iso690.edition">
+    <xsl:with-param name="after" select="./pubdate[not(@role='issuing')]|./volumenum|./issuenum|./pagenums"/>
+  </xsl:call-template>
+  <!-- Number designation [EL] -->
+  <!-- Location within host -->
+  <xsl:call-template name="iso690.article.location"/>
+  <xsl:if test="./bibliomisc[@role='medium']">
+  <!-- Notes [EL] -->
+    <xsl:call-template name="iso690.notice"/>
+  <!-- Avaibility and access [EL] -->
+    <xsl:call-template name="iso690.access"/>
+  <!-- Standard number [EL] -->
+    <xsl:call-template name="iso690.issn"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- PATENT DOCUMENTS -->
+<xsl:template name="iso690.patent">
+  <!-- Primary responsibility (applicant) -->
+  <xsl:call-template name="iso690.primary"/>
+  <!-- Title of the invention -->
+  <xsl:call-template name="iso690.title"/>
+  <!-- Subordinate responsibility -->
+  <xsl:call-template name="iso690.secondary"/>
+  <!-- Notes -->
+  <xsl:call-template name="iso690.notice"/>
+  <!-- Identification -->
+  <xsl:call-template name="iso690.pat.ident"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- Elements -->
+
+<!-- Primary responsibility -->
+<xsl:template name="iso690.primary">
+  <xsl:param name="primary.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./authorgroup/author|./author">
+      <xsl:call-template name="iso690.author.list">
+        <xsl:with-param name="person.list" select=".//authorgroup/author|.//author"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="./authorgroup/editor|./editor">
+      <xsl:call-template name="iso690.author.list">
+        <xsl:with-param name="person.list" select=".//authorgroup/editor|.//editor"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="./authorgroup/corpauthor|./corpauthor">
+      <xsl:call-template name="iso690.author.list">
+        <xsl:with-param name="person.list" select=".//authorgroup/corpauthor|.//corpauthor"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="(./firstname)and(./surname)">
+        <xsl:call-template name="iso690.author"/>
+        <xsl:call-template name="iso690.endsep">
+          <xsl:with-param name="text" select="string(./firstname[1])"/>
+          <xsl:with-param name="sep" select="$primary.sep"/>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.author.list">
+  <xsl:param name="person.list" select="author|corpauthor|editor"/>
+  <xsl:param name="person.count" select="count($person.list)"/>
+  <xsl:param name="count" select="1"/>
+  <xsl:param name="group" select="./authorgroup[@role='many']"/>
+  <xsl:param name="many" select="0"/>
+
+  <xsl:param name="primary.many">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.many'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="primary.editor">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.editor'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="primary.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.sep'"/></xsl:call-template>
+  </xsl:param>
+
+  <xsl:choose>
+    <xsl:when test="$count &gt; $person.count"/>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="$person.count &lt; 4 and not($group)">
+          <xsl:call-template name="iso690.author">
+            <xsl:with-param name="node" select="$person.list[position()=$count]"/>
+          </xsl:call-template>
+          <xsl:choose>
+            <xsl:when test="$person.count = 2 and $count = 1 and $biblioentry.alt.primary.seps != 0">
+              <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.two.sep'"/></xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$person.count = 2 and $count = 1">
+              <xsl:call-template name="gentext.template">
+                <xsl:with-param name="context" select="'authorgroup'"/>
+                <xsl:with-param name="name" select="'sep2'"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$person.count &gt; 2 and $count+1 = $person.count and $biblioentry.alt.primary.seps != 0">
+              <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.last.sep'"/></xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$person.count &gt; 2 and $count+1 = $person.count">
+              <xsl:call-template name="gentext.template">
+                <xsl:with-param name="context" select="'authorgroup'"/>
+                <xsl:with-param name="name" select="'seplast'"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$count &lt; $person.count and $biblioentry.alt.primary.seps != 0">
+              <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.more.sep'"/></xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$count &lt; $person.count">
+              <xsl:call-template name="gentext.template">
+                <xsl:with-param name="context" select="'authorgroup'"/>
+                <xsl:with-param name="name" select="'sep'"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="($count = $person.count)">
+              <xsl:choose>
+                <xsl:when test="$many!=0">
+                  <xsl:if test="name($person.list[position()=$count])='editor'">
+                    <xsl:value-of select="$primary.editor"/>
+                  </xsl:if>
+                  <xsl:value-of select="$primary.many"/>
+                  <xsl:call-template name="iso690.endsep">
+                    <xsl:with-param name="text" select="$primary.many"/>
+                    <xsl:with-param name="sep" select="$primary.sep"/>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:when test="name($person.list[position()=$count])='editor'">
+                  <xsl:value-of select="$primary.editor"/>
+                  <xsl:value-of select="$primary.sep"/>
+                </xsl:when>
+                <xsl:when test="name($person.list[position()=$count])='corpauthor'">
+                  <xsl:call-template name="iso690.endsep">
+                    <xsl:with-param name="text" select="string($person.list[position()=$count])"/>
+                    <xsl:with-param name="sep" select="$primary.sep"/>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:call-template name="iso690.endsep">
+                    <xsl:with-param name="text" select="string($person.list[position()=$count]//firstname[1])"/>
+                    <xsl:with-param name="sep" select="$primary.sep"/>
+                  </xsl:call-template>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:when>
+          </xsl:choose>
+
+          <xsl:call-template name="iso690.author.list">
+            <xsl:with-param name="person.list" select="$person.list"/>
+            <xsl:with-param name="person.count" select="$person.count"/>
+            <xsl:with-param name="count" select="$count+1"/>
+            <xsl:with-param name="many" select="$many"/>
+            <xsl:with-param name="group"/>
+          </xsl:call-template>
+        </xsl:when>
+
+        <xsl:otherwise>
+          <xsl:choose>
+            <xsl:when test="($biblioentry.primary.count&gt;=3) and ($person.count&gt;=3)">
+              <xsl:call-template name="iso690.author.list">
+                <xsl:with-param name="person.list" select="$person.list[1]|$person.list[2]|$person.list[3]"/>
+                <xsl:with-param name="person.count" select="3"/>
+                <xsl:with-param name="count" select="1"/>
+                <xsl:with-param name="many" select="1"/>
+                <xsl:with-param name="group"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="($biblioentry.primary.count&gt;1) and  ($person.count&gt;1)">
+              <xsl:call-template name="iso690.author.list">
+                <xsl:with-param name="person.list" select="$person.list[1]|$person.list[2]"/>
+                <xsl:with-param name="person.count" select="2"/>
+                <xsl:with-param name="count" select="1"/>
+                <xsl:with-param name="many" select="1"/>
+                <xsl:with-param name="group"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:call-template name="iso690.author.list">
+                <xsl:with-param name="person.list" select="$person.list[1]"/>
+                <xsl:with-param name="person.count" select="1"/>
+                <xsl:with-param name="count" select="1"/>
+                <xsl:with-param name="many" select="1"/>
+                <xsl:with-param name="group"/>
+              </xsl:call-template>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.author">
+  <xsl:param name="node" select="."/>
+  <xsl:param name="lastfirst.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'lastfirst.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="name($node)!='corpauthor'">
+      <span style="text-transform:uppercase">
+        <xsl:apply-templates mode="iso690.mode" select="$node//surname[1]"/>
+      </span>
+      <xsl:if test="$node//surname and $node//firstname">
+        <xsl:value-of select="$lastfirst.sep"/>
+      </xsl:if>
+      <xsl:apply-templates mode="iso690.mode" select="$node//firstname[1]"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <span style="text-transform:uppercase">
+        <xsl:apply-templates mode="iso690.mode" select="$node"/>
+      </span>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="corpauthor|firstname|surname" mode="iso690.mode">
+  <xsl:apply-templates mode="iso690.mode"/>
+</xsl:template>
+
+<!-- Title and Type of medium -->
+<xsl:template name="iso690.title">
+  <xsl:param name="medium" select="./bibliomisc[@role='medium']"/>
+  <xsl:param name="italic" select="1"/>
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'title.sep'"/></xsl:call-template>
+  </xsl:param>
+
+  <xsl:apply-templates mode="iso690.mode" select="./title">
+    <xsl:with-param name="medium" select="$medium"/>
+    <xsl:with-param name="italic" select="$italic"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="title" mode="iso690.mode">
+  <xsl:param name="medium"/>
+  <xsl:param name="italic" select="1"/>
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'title.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="medium1">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'medium1'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="medium2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'medium2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="$italic=1">
+      <xsl:call-template name="iso690.italic.title"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="iso690.make.title"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:if test="$medium">
+    <xsl:value-of select="$medium1"/>
+    <xsl:apply-templates mode="iso690.mode" select="$medium"/>
+    <xsl:value-of select="$medium2"/>
+  </xsl:if>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="concat(string(.),string(../subtitle))"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="iso690.italic.title">
+  <i>
+    <xsl:call-template name="iso690.make.title"/>
+  </i>
+</xsl:template>
+
+<xsl:template name="iso690.make.title">
+  <xsl:param name="submaintitle.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'submaintitle.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:if test="../subtitle">
+    <xsl:value-of select="$submaintitle.sep"/>
+    <xsl:apply-templates mode="iso690.mode" select="../subtitle"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="iso690.mode">
+  <xsl:apply-templates mode="iso690.mode"/>
+</xsl:template>
+
+<xsl:template match="bibliomisc[@role='medium']" mode="iso690.mode">
+  <xsl:apply-templates mode="iso690.mode"/>
+</xsl:template>
+
+<!-- Subordinate responsibility -->
+<xsl:template name="iso690.secondary">
+  <xsl:param name="secondary.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'secondary.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="secondary.person.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'secondary.person.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:for-each select="./bibliomisc[@role='secondary']">
+    <xsl:apply-templates mode="iso690.mode" select="."/>
+    <xsl:choose>
+      <xsl:when test="position()=count(../bibliomisc[@role='secondary'])">
+        <xsl:call-template name="iso690.endsep">
+          <xsl:with-param name="text" select="string(.)"/>
+          <xsl:with-param name="sep" select="$secondary.sep"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$secondary.person.sep"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="bibliomisc[@role='secondary']" mode="iso690.mode">
+  <xsl:apply-templates mode="iso690.mode"/>
+</xsl:template>
+
+<!-- Edition -->
+<xsl:template name="iso690.edition">
+  <xsl:param name="after"/>
+  <xsl:param name="edition.serial.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'edition.serial.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="string($after)!=''">
+      <xsl:apply-templates mode="iso690.mode" select="./edition">
+        <xsl:with-param name="sep" select="$edition.serial.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode" select="./edition"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="edition" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'edition.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- Issue designation (date and/or num) -->
+<xsl:template name="iso690.issuing">
+  <xsl:param name="issuing.div">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="issuing.range">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="issuing.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2] and ./issuenum[2]">
+      <xsl:call-template name="iso690.issuedate"/>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum[1]">
+        <xsl:with-param name="sep" select="$issuing.range"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum[2]">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2]">
+      <xsl:call-template name="iso690.issuedate"/>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
+        <xsl:with-param name="sep" select="$issuing.range"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum and ./issuenum">
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./pubdate[@role='issuing']">
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./volumenum">
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./issuenum">
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
+        <xsl:with-param name="sep" select="$issuing.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.issuedate">
+  <xsl:param name="issuing.div">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="issuing.range">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="issuing.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./pubdate[@role='issuing'][2]">
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][1]">
+        <xsl:with-param name="sep" select="$issuing.range"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][2]">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
+        <xsl:with-param name="sep" select="$issuing.div"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="pubdate[@role='issuing']" mode="iso690.mode">
+  <xsl:param name="sep"/>
+  <xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.space">
+    <xsl:with-param name="text" select="$substr"/>
+  </xsl:call-template>
+  <xsl:choose>
+    <xsl:when test="$substr='-'">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="' '"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="string(.)"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- Numeration of the part -->
+<xsl:template name="iso690.partnr">
+  <xsl:param name="partnr.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'partnr.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+    <xsl:with-param name="sep" select="$partnr.sep"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
+<xsl:template name="iso690.pub">
+  <xsl:param name="onlydate" select="0"/>
+  <xsl:param name="placesep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'placepubl.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="pubsep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'publyear.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="endsep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pubinfo.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="(./publisher/publishername|./publishername|./publisher/address/city)and($onlydate=0)and(./pubdate[not(@role='issuing')]|./copyright/year|./date[@role='upd']|./date[@role='upd'])">
+      <xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
+        <xsl:with-param name="sep" select="$placesep"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
+        <xsl:with-param name="sep" select="$pubsep"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
+        <xsl:with-param name="sep" select="$endsep"/>
+      </xsl:apply-templates>
+      <xsl:if test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
+        <xsl:call-template name="iso690.data">
+          <xsl:with-param name="sep" select="$endsep"/>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:when>
+    <xsl:when test="(./publisher/publishername|./publishername)and(./publisher/address/city)and($onlydate=0)">
+      <xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
+        <xsl:with-param name="sep" select="$placesep"/>
+      </xsl:apply-templates>
+      <xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
+        <xsl:with-param name="sep" select="$endsep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="($onlydate=1)or(./pubdate[not(@role='issuing')]|./copyright/year)">
+      <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
+        <xsl:with-param name="sep" select="$endsep"/>
+      </xsl:apply-templates>
+      <xsl:if test="$onlydate=1">
+        <xsl:call-template name="iso690.location">
+          <xsl:with-param name="onlypages" select="1"/>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:when>
+    <xsl:when test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
+      <xsl:call-template name="iso690.data">
+        <xsl:with-param name="sep" select="$endsep"/>
+      </xsl:call-template>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.paper.pub">
+  <xsl:param name="spec.pubinfo.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'spec.pubinfo.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./volumnum|./issuenum|./pagenums">
+      <xsl:call-template name="iso690.pub">
+        <xsl:with-param name="endsep" select="$spec.pubinfo.sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="iso690.pub"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.data">
+  <xsl:param name="sep"/>
+  <xsl:param name="datecit2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode" select="./date[@role='upd']">
+    <xsl:with-param name="sep"/>
+  </xsl:apply-templates>
+  <xsl:apply-templates mode="iso690.mode" select="./date[@role='cit']"/>
+  <xsl:choose>
+    <xsl:when test="./date[@role='cit']">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="$datecit2"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="./date[@role='upd']">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="string(./date[@role='upd'])"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="publisher/address/city|publishername" mode="iso690.mode">
+  <xsl:param name="sep"/>
+  <xsl:param name="upd" select="0"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="pubdate|copyright/year" mode="iso690.mode">
+  <xsl:param name="sep"/>
+  <xsl:param name="upd" select="1"/>
+  <xsl:param name="datecit2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
+  <xsl:if test="name(.)!='pubdate'">
+    <xsl:value-of select="'&#169;'"/><!-- copyright -->
+  </xsl:if>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.space">
+    <xsl:with-param name="text" select="$substr"/>
+  </xsl:call-template>
+  <xsl:if test="$upd!=0">
+    <xsl:choose>
+      <xsl:when test="name(.)='pubdate'">
+        <xsl:apply-templates mode="iso690.mode" select="../date[@role='upd']"/>
+        <xsl:apply-templates mode="iso690.mode" select="../date[@role='cit']"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="iso690.mode" select="../../date[@role='upd']"/>
+        <xsl:apply-templates mode="iso690.mode" select="../../date[@role='cit']"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:if>
+  <xsl:choose>
+    <xsl:when test="../date[@role='cit']|../../date[@role='cit'] and $upd!=0">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="$datecit2"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="../date[@role='upd']|../../date[@role='upd'] and $upd!=0">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="string(../date[@role='upd'])"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:when test="$substr='-'">
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="' '"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="string(.)"/>
+        <xsl:with-param name="sep" select="$sep"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.space">
+  <xsl:param name="text" select="substring(string(.),string-length(string(.)))"/>
+  <xsl:if test="$text='-'">
+    <xsl:value-of select="' '"/>
+  </xsl:if>
+</xsl:template>
+
+<!-- Date of update/revision -->
+<xsl:template match="date[@role='upd']" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'upd.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$sep"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+</xsl:template>
+
+<!-- Date of citation -->
+<xsl:template match="date[@role='cit']" mode="iso690.mode">
+  <xsl:param name="datecit1">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit1'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="datecit2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$datecit1"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:value-of select="$datecit2"/>
+</xsl:template>
+
+<!-- Extent -->
+<xsl:template name="iso690.extent">
+  <xsl:param name="extent.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'extent.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode" select="./pagenums">
+    <xsl:with-param name="sep" select="$extent.sep"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<!-- Location within host -->
+<xsl:template name="iso690.part.location">
+  <xsl:param name="location.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./pagenums">
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']"/>
+      <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
+    </xsl:when>
+    <xsl:when test="./bibliomisc[@role='sectitle']">
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']">
+        <xsl:with-param name="sep" select="$location.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']">
+        <xsl:with-param name="sep" select="$location.sep"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.article.location">
+  <xsl:param name="location.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="locs.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="not(./date[@role='upd']|./date[@role='cit'])">
+      <xsl:choose>
+        <xsl:when test="./volumenum|./issuenum|./pagenums">
+          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+            <xsl:with-param name="upd" select="0"/>
+            <xsl:with-param name="sep" select="$locs.sep"/>
+          </xsl:apply-templates>
+          <xsl:call-template name="iso690.location"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+            <xsl:with-param name="sep" select="$location.sep"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="./volumenum|./issuenum|./pagenums">
+          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+            <xsl:with-param name="upd" select="0"/>
+            <xsl:with-param name="sep" select="$locs.sep"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+            <xsl:with-param name="upd" select="0"/>
+            <xsl:with-param name="sep" select="$location.sep"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="./issuenum">
+          <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
+          <xsl:apply-templates mode="iso690.mode" select="./issuenum">
+            <xsl:with-param name="sep"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+            <xsl:with-param name="sep"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="./pagenums">
+          <xsl:call-template name="iso690.data">
+            <xsl:with-param name="sep" select="$locs.sep"/>
+          </xsl:call-template>
+          <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="iso690.data">
+            <xsl:with-param name="sep" select="$location.sep"/>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="iso690.location">
+  <xsl:param name="location.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="./volumenum and not(./issuenum) and not(./pagenums)">
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
+        <xsl:with-param name="sep" select="$location.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./issuenum and not(./pagenums)">
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
+        <xsl:with-param name="sep" select="$location.sep"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="./pagenums">
+      <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
+      <xsl:apply-templates mode="iso690.mode" select="./issuenum"/>
+      <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="bibliomisc[@role='secnum']|bibliomisc[@role='sectitle']" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="volumenum|issuenum" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="pagenums" mode="iso690.mode">
+  <xsl:param name="sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- Series -->
+<xsl:template name="iso690.serie">
+  <xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[@role='serie']"/>
+</xsl:template>
+
+<!-- Notes -->
+<xsl:template name="iso690.notice">
+  <xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[not(@role)]"/>
+</xsl:template>
+
+<xsl:template match="bibliomisc[not(@role)]|bibliomisc[@role='serie']" mode="iso690.mode">
+  <xsl:param name="notice.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'notice.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:call-template name="iso690.endsep">
+    <xsl:with-param name="text" select="string(.)"/>
+    <xsl:with-param name="sep" select="$notice.sep"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- Avaibility and access -->
+<xsl:template name="iso690.access">
+  <xsl:for-each select="./biblioid[@class='uri']|./bibliomisc[@role='access']">
+    <xsl:choose>
+      <xsl:when test="position()=1">
+        <xsl:apply-templates mode="iso690.mode" select="."/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="iso690.mode" select=".">
+          <xsl:with-param name="firstacc" select="0"/>
+        </xsl:apply-templates>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="biblioid[@class='uri']/ulink|bibliomisc[@role='access']/ulink" mode="iso690.mode">
+  <xsl:param name="link1">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link1'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="link2">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link2'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$link1"/>
+  <xsl:call-template name="ulink"/>
+  <xsl:value-of select="$link2"/>
+</xsl:template>
+
+<xsl:template match="biblioid[@class='uri']|bibliomisc[@role='access']" mode="iso690.mode">
+  <xsl:param name="firstacc" select="1"/>
+  <xsl:param name="access">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="acctoo">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'acctoo'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="onwww">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'onwww'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="oninet">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'oninet'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="access.end">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.end'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="access.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:choose>
+    <xsl:when test="$firstacc=1">
+      <xsl:value-of select="$access"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$acctoo"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:choose>
+    <xsl:when test="(./ulink)and(string(./ulink)=string(.))">
+      <xsl:choose>
+        <xsl:when test="(starts-with(./ulink/@url,'http://')or(starts-with(./ulink/@url,'https://')))">
+          <xsl:value-of select="$onwww"/>
+          <xsl:value-of select="$access.end"/>
+          <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$oninet"/>
+          <xsl:value-of select="$access.end"/>
+          <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:when test="(./ulink)and(string(./ulink)!=string(.))">
+      <xsl:value-of select="text()[1]"/>
+      <xsl:call-template name="iso690.endsep">
+        <xsl:with-param name="text" select="text()[1]"/>
+        <xsl:with-param name="sep" select="$access.end"/>
+      </xsl:call-template>
+      <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:value-of select="$access.sep"/>
+</xsl:template>
+
+<!-- Standard number - ISBN -->
+<xsl:template name="iso690.isbn">
+  <xsl:choose>
+    <xsl:when test="./biblioid/@class='isbn'">
+      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='isbn']"/>
+    </xsl:when>
+    <xsl:when test="./isbn">
+      <xsl:apply-templates mode="iso690.mode" select="./isbn"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="isbn|biblioid[@class='isbn']" mode="iso690.mode">
+  <xsl:param name="isbn">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'isbn'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="stdnum.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$isbn"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:value-of select="$stdnum.sep"/>
+</xsl:template>
+
+<!-- Standard number - ISSN -->
+<xsl:template name="iso690.issn">
+  <xsl:choose>
+    <xsl:when test="./biblioid/@class='issn'">
+      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='issn']"/>
+    </xsl:when>
+    <xsl:when test="./issn">
+      <xsl:apply-templates mode="iso690.mode" select="./issn"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="issn|biblioid[@class='issn']" mode="iso690.mode">
+  <xsl:param name="issn">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issn'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:param name="stdnum.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:value-of select="$issn"/>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:value-of select="$stdnum.sep"/>
+</xsl:template>
+
+<!-- Identification of patent document -->
+<xsl:template name="iso690.pat.ident">
+  <xsl:param name="patdate.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patdate.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode" select="./address/country"/>
+  <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='patenttype']"/>
+  <xsl:choose>
+    <xsl:when test="./biblioid[@class='other' and @otherclass='patentnum']">
+      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='other' and @otherclass='patentnum']"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='patentnum']"/>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
+    <xsl:with-param name="sep" select="$patdate.sep"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<!-- Country or issuing office -->
+<xsl:template match="address/country" mode="iso690.mode">
+  <xsl:param name="patcountry.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patcountry.sep'"/></xsl:call-template>
+  </xsl:param>
+  <i>
+    <xsl:apply-templates mode="iso690.mode"/>
+  </i>
+  <xsl:value-of select="$patcountry.sep"/>
+</xsl:template>
+
+<!-- Kind of patent document -->
+<xsl:template match="bibliomisc[@role='patenttype']" mode="iso690.mode">
+  <xsl:param name="pattype.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pattype.sep'"/></xsl:call-template>
+  </xsl:param>
+  <i>
+    <xsl:apply-templates mode="iso690.mode"/>
+  </i>
+  <xsl:value-of select="$pattype.sep"/>
+</xsl:template>
+
+<!-- Number -->
+<xsl:template match="biblioid[@class='other' and @otherclass='patentnum']|bibliomisc[@role='patentnum']" mode="iso690.mode">
+  <xsl:param name="patnum.sep">
+    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patnum.sep'"/></xsl:call-template>
+  </xsl:param>
+  <xsl:apply-templates mode="iso690.mode"/>
+  <xsl:value-of select="$patnum.sep"/>
+</xsl:template>
+
+<!-- ==================================================================== -->
+<!-- Supplementary templates -->
+
+<xsl:template name="iso690.endsep">
+  <xsl:param name="text"/>
+  <xsl:param name="sep" select=". "/>
+  <xsl:choose>
+    <xsl:when test="substring($text,string-length($text))!=substring($sep,1,1)">
+      <xsl:value-of select="$sep"/>
+    </xsl:when>
+    <xsl:when test="substring($text,string-length($text))=' '">
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="' '"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="iso690.mode">
+  <xsl:apply-templates select="."/><!-- try the default mode -->
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

+ 1217 - 0
stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/biblio.xsl

@@ -0,0 +1,1217 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--This file was created automatically by html2xhtml-->
+<!--from the HTML stylesheets.-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
+
+<!-- ********************************************************************
+     $Id$
+     ********************************************************************
+
+     This file is part of the XSL DocBook Stylesheet distribution.
+     See ../README or http://docbook.sf.net/release/xsl/current/ for
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<xsl:template match="bibliography">
+  <xsl:call-template name="id.warning"/>
+
+  <div>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:if test="$generate.id.attributes != 0">
+      <xsl:attribute name="id">
+        <xsl:call-template name="object.id"/>
+      </xsl:attribute>
+    </xsl:if>
+
+    <xsl:call-template name="bibliography.titlepage"/>
+
+    <xsl:apply-templates/>
+
+    <xsl:if test="not(parent::article)">
+      <xsl:call-template name="process.footnotes"/>
+    </xsl:if>
+  </div>
+</xsl:template>
+
+<xsl:template match="bibliography/bibliographyinfo"/>
+<xsl:template match="bibliography/info"/>
+<xsl:template match="bibliography/title"/>
+<xsl:template match="bibliography/subtitle"/>
+<xsl:template match="bibliography/titleabbrev"/>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="bibliodiv">
+  <xsl:call-template name="id.warning"/>
+
+  <div>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates/>
+  </div>
+</xsl:template>
+
+<xsl:template match="bibliodiv/title">
+  <h3>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:call-template name="anchor">
+      <xsl:with-param name="node" select=".."/>
+    </xsl:call-template>
+    <xsl:apply-templates/>
+  </h3>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="bibliolist">
+  <div>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:call-template name="anchor"/>
+    <xsl:if test="blockinfo/title|info/title|title">
+      <xsl:call-template name="formal.object.heading"/>
+    </xsl:if>
+    <xsl:apply-templates select="*[not(self::blockinfo)                                    and not(self::info)                                    and not(self::title)                                    and not(self::titleabbrev)                                    and not(self::biblioentry)                                    and not(self::bibliomixed)]"/>
+    <xsl:apply-templates select="biblioentry|bibliomixed"/>
+  </div>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="biblioentry">
+  <xsl:param name="label">
+    <xsl:call-template name="biblioentry.label"/>
+  </xsl:param>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="string(.) = ''">
+      <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
+      <xsl:variable name="entry" select="$bib/bibliography/                                          *[@id=$id or @xml:id=$id][1]"/>
+      <xsl:choose>
+        <xsl:when test="$entry">
+          <xsl:choose>
+            <xsl:when test="$bibliography.numbered != 0">
+              <xsl:apply-templates select="$entry">
+                <xsl:with-param name="label" select="$label"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="$entry"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>No bibliography entry: </xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text> found in </xsl:text>
+            <xsl:value-of select="$bibliography.collection"/>
+          </xsl:message>
+          <div>
+            <xsl:apply-templates select="." mode="class.attribute"/>
+            <xsl:call-template name="anchor"/>
+            <p>
+              <xsl:copy-of select="$label"/>
+              <xsl:text>Error: no bibliography entry: </xsl:text>
+              <xsl:value-of select="$id"/>
+              <xsl:text> found in </xsl:text>
+              <xsl:value-of select="$bibliography.collection"/>
+            </p>
+          </div>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <div>
+        <xsl:apply-templates select="." mode="class.attribute"/>
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="conditional" select="0"/>
+        </xsl:call-template>
+        <p>
+          <xsl:copy-of select="$label"/>
+	  <xsl:choose>
+	    <xsl:when test="$bibliography.style = 'iso690'">
+	      <xsl:call-template name="iso690.makecitation"/>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:apply-templates mode="bibliography.mode"/>
+	    </xsl:otherwise>
+	  </xsl:choose>
+        </p>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="bibliomixed">
+  <xsl:param name="label">
+    <xsl:call-template name="biblioentry.label"/>
+  </xsl:param>
+
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="string(.) = ''">
+      <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
+      <xsl:variable name="entry" select="$bib/bibliography/                                          *[@id=$id or @xml:id=$id][1]"/>
+      <xsl:choose>
+        <xsl:when test="$entry">
+          <xsl:choose>
+            <xsl:when test="$bibliography.numbered != 0">
+              <xsl:apply-templates select="$entry">
+                <xsl:with-param name="label" select="$label"/>
+              </xsl:apply-templates>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:apply-templates select="$entry"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>No bibliography entry: </xsl:text>
+            <xsl:value-of select="$id"/>
+            <xsl:text> found in </xsl:text>
+            <xsl:value-of select="$bibliography.collection"/>
+          </xsl:message>
+          <div>
+            <xsl:apply-templates select="." mode="class.attribute"/>
+            <xsl:call-template name="anchor"/>
+            <p>
+              <xsl:copy-of select="$label"/>
+              <xsl:text>Error: no bibliography entry: </xsl:text>
+              <xsl:value-of select="$id"/>
+              <xsl:text> found in </xsl:text>
+              <xsl:value-of select="$bibliography.collection"/>
+            </p>
+          </div>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <div>
+        <xsl:apply-templates select="." mode="class.attribute"/>
+        <xsl:call-template name="anchor">
+          <xsl:with-param name="conditional" select="0"/>
+        </xsl:call-template>
+        <p>
+          <xsl:apply-templates select="." mode="class.attribute"/>
+          <xsl:copy-of select="$label"/>
+          <xsl:apply-templates mode="bibliomixed.mode"/>
+        </p>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="biblioentry.label">
+  <xsl:param name="node" select="."/>
+
+  <xsl:choose>
+    <xsl:when test="$bibliography.numbered != 0">
+      <xsl:text>[</xsl:text>
+      <xsl:number from="bibliography" count="biblioentry|bibliomixed" level="any" format="1"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:when test="local-name($node/child::*[1]) = 'abbrev'">
+      <xsl:text>[</xsl:text>
+      <xsl:apply-templates select="$node/abbrev[1]"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:when test="$node/@xreflabel">
+      <xsl:text>[</xsl:text>
+      <xsl:value-of select="$node/@xreflabel"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:when test="$node/@id">
+      <xsl:text>[</xsl:text>
+      <xsl:value-of select="$node/@id"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:when test="$node/@xml:id">
+      <xsl:text>[</xsl:text>
+      <xsl:value-of select="$node/@xml:id"/>
+      <xsl:text>] </xsl:text>
+    </xsl:when>
+    <xsl:otherwise><!-- nop --></xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="bibliography.mode">
+  <xsl:apply-templates select="."/><!-- try the default mode -->
+</xsl:template>
+
+<xsl:template match="abbrev" mode="bibliography.mode">
+  <xsl:if test="preceding-sibling::*">
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="abstract" mode="bibliography.mode">
+  <!-- suppressed -->
+</xsl:template>
+
+<xsl:template match="address" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="affiliation" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="shortaffil" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="jobtitle" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="artheader|articleinfo|info" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="artpagenums" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="author" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:call-template name="person.name"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="authorblurb|personblurb" mode="bibliography.mode">
+  <!-- suppressed -->
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:call-template name="person.name.list"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="authorinitials" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="bibliomisc" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="bibliomset" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="biblioset" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="biblioset/title|biblioset/citetitle" mode="bibliography.mode">
+  <xsl:variable name="relation" select="../@relation"/>
+  <xsl:choose>
+    <xsl:when test="$relation='article' or @pubwork='article'">
+      <xsl:call-template name="gentext.startquote"/>
+      <xsl:apply-templates/>
+      <xsl:call-template name="gentext.endquote"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <i><xsl:apply-templates/></i>
+    </xsl:otherwise>
+  </xsl:choose>
+  <xsl:copy-of select="$biblioentry.item.separator"/>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="bookbiblio" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="citetitle" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <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:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="collab" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="collabname" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="confgroup" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="confdates" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="conftitle" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="confnum" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="confsponsor" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="contractnum" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="contractsponsor" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="contrib" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="copyright" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="'Copyright'"/>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:call-template name="dingbat">
+      <xsl:with-param name="dingbat">copyright</xsl:with-param>
+    </xsl:call-template>
+    <xsl:call-template name="gentext.space"/>
+    <xsl:apply-templates select="year" mode="bibliography.mode"/>
+    <xsl:if test="holder">
+      <xsl:call-template name="gentext.space"/>
+      <xsl:apply-templates select="holder" mode="bibliography.mode"/>
+    </xsl:if>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="year" mode="bibliography.mode">
+  <xsl:apply-templates/><xsl:text>, </xsl:text>
+</xsl:template>
+
+<xsl:template match="year[position()=last()]" mode="bibliography.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="holder" mode="bibliography.mode">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="corpauthor" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="corpcredit" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="corpname" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="date" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="edition" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="editor" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:call-template name="person.name"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="firstname" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="honorific" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="invpartnumber" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="isbn" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="issn" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="issuenum" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="lineage" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="orgname" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="orgdiv" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="othername" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="pagenums" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="printhistory" mode="bibliography.mode">
+  <!-- suppressed -->
+</xsl:template>
+
+<xsl:template match="productname" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="productnumber" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="publisher" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="publishername" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="pubsnumber" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="bibliography.mode">
+  <!-- suppressed; how could this be represented? -->
+</xsl:template>
+
+<xsl:template match="seriesinfo" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="seriesvolnums" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="surname" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="title" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <i><xsl:apply-templates mode="bibliography.mode"/></i>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="titleabbrev" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="volumenum" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="bibliocoverage|biblioid|bibliorelation|bibliosource" mode="bibliography.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliography.mode"/>
+    <xsl:copy-of select="$biblioentry.item.separator"/>
+  </span>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template match="*" mode="bibliomixed.mode">
+  <xsl:apply-templates select="."/><!-- try the default mode -->
+</xsl:template>
+
+<xsl:template match="abbrev" mode="bibliomixed.mode">
+  <xsl:if test="preceding-sibling::*">
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match="abstract" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="address" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="affiliation" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="shortaffil" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="jobtitle" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="artpagenums" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="author" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="authorblurb|personblurb" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="authorinitials" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="bibliomisc" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="bibliomset" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="bibliomset/title|bibliomset/citetitle" mode="bibliomixed.mode">
+  <xsl:variable name="relation" select="../@relation"/>
+  <xsl:choose>
+    <xsl:when test="$relation='article' or @pubwork='article'">
+      <xsl:call-template name="gentext.startquote"/>
+      <xsl:apply-templates/>
+      <xsl:call-template name="gentext.endquote"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <i><xsl:apply-templates/></i>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ================================================== -->
+
+<xsl:template match="biblioset" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="citetitle" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <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>
+  </span>
+</xsl:template>
+
+
+<xsl:template match="collab" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="confgroup" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="contractnum" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="contractsponsor" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="contrib" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="copyright" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="corpcredit" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="corpname" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="date" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="edition" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="editor" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="firstname" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="honorific" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="indexterm" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="invpartnumber" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="isbn" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="issn" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="issuenum" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="lineage" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="orgname" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="othername" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="pagenums" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="printhistory" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="productname" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="productnumber" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="publisher" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="publishername" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="pubsnumber" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="bibliomixed.mode">
+  <!-- suppressed; how could this be represented? -->
+</xsl:template>
+
+<xsl:template match="seriesvolnums" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="surname" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="title" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="titleabbrev" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="volumenum" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<xsl:template match="bibliocoverage|biblioid|bibliorelation|bibliosource" mode="bibliomixed.mode">
+  <span>
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:apply-templates mode="bibliomixed.mode"/>
+  </span>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+</xsl:stylesheet>

Some files were not shown because too many files changed in this diff