]> granicus.if.org Git - docbook-dsssl/commitdiff
Replace docbook.xsl with docbook-no-doctype.xsl in xsl:import
authorBob Stayton <bobs@sagehill.net>
Mon, 29 Oct 2012 23:18:22 +0000 (23:18 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 29 Oct 2012 23:18:22 +0000 (23:18 +0000)
elements so the chunking stylesheet can generate output
without a doctype if needed.

xsl/xhtml/html2xhtml.xsl

index 52ee16a58e9aca5be62aca0dbcfcc1198cbde7b0..30478f65436e4632089c812573d8e87ac1bb9a07 100644 (file)
 <xsl:template match="xsl:import">
   <xsl:copy>
     <xsl:attribute name="href">
-      <xsl:call-template name="string.subst">
-        <xsl:with-param name="string" select="@href"/>
-        <xsl:with-param name="target">/html/</xsl:with-param>
-        <xsl:with-param name="replacement">/xhtml/</xsl:with-param>
-      </xsl:call-template>
+      <xsl:choose>
+        <!-- Fix problem of hardwired doctype in the xsl:output
+        of docbook.xsl, replacing it with an identical file
+        but with no doctype in the xsl:output element. The
+        chunking stylesheet adds the doctype for the chunks. -->
+        <xsl:when test="@href = 'docbook.xsl'">
+          <xsl:text>docbook-no-doctype.xsl</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:call-template name="string.subst">
+            <xsl:with-param name="string" select="@href"/>
+            <xsl:with-param name="target">/html/</xsl:with-param>
+            <xsl:with-param name="replacement">/xhtml/</xsl:with-param>
+          </xsl:call-template>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:attribute>
   </xsl:copy>
 </xsl:template>