]> granicus.if.org Git - docbook-dsssl/commitdiff
Allow bibliography to be a root element
authorNorman Walsh <ndw@nwalsh.com>
Mon, 28 Jan 2002 16:11:08 +0000 (16:11 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 28 Jan 2002 16:11:08 +0000 (16:11 +0000)
xsl/fo/biblio.xsl

index 0b024222e6bab7688cc47f6d3976be8b6bb580d4..4adc605cf8fc9e9fd105cdf91dc57e9c35db5fbe 100644 (file)
     <xsl:call-template name="object.id"/>
   </xsl:variable>
 
-  <fo:block id="{$id}">
-    <xsl:call-template name="component.separator"/>
-    <xsl:call-template name="bibliography.titlepage"/>
-    <xsl:apply-templates/>
-  </fo:block>
-</xsl:template>
-
-<xsl:template match="book/bibliography">
-  <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 id="{$id}"
-                    hyphenate="{$hyphenate}"
-                    master-reference="{$master-reference}">
-    <xsl:attribute name="language">
-      <xsl:call-template name="l10n.language"/>
-    </xsl:attribute>
-    <xsl:if test="$double.sided != 0">
-      <xsl:attribute name="force-page-count">end-on-even</xsl:attribute>
-    </xsl:if>
-
-    <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="bibliography.titlepage"/>
-      <xsl:apply-templates/>
-    </fo:flow>
-  </fo:page-sequence>
+  <xsl:choose>
+    <xsl:when test="not(parent::*) or parent::book">
+      <xsl:variable name="master-reference">
+        <xsl:call-template name="select.pagemaster"/>
+      </xsl:variable>
+
+      <fo:page-sequence id="{$id}"
+                        hyphenate="{$hyphenate}"
+                        master-reference="{$master-reference}">
+        <xsl:attribute name="language">
+          <xsl:call-template name="l10n.language"/>
+        </xsl:attribute>
+        <xsl:if test="$double.sided != 0">
+          <xsl:attribute name="force-page-count">end-on-even</xsl:attribute>
+        </xsl:if>
+
+        <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="bibliography.titlepage"/>
+          <xsl:apply-templates/>
+        </fo:flow>
+      </fo:page-sequence>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}">
+        <xsl:call-template name="component.separator"/>
+        <xsl:call-template name="bibliography.titlepage"/>
+        <xsl:apply-templates/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="bibliography/bibliographyinfo"></xsl:template>