not properly handling namespaced document.
stylesheets for DocBook5 if you don't want to use this feature.-->
<xsl:when test="$exsl.node.set.available != 0
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:text>processing stripped document</xsl:text>
</xsl:with-param>
</xsl:call-template>
- <xsl:apply-templates select="exsl:node-set($nons)"/>
+
+ <xsl:apply-templates select="exsl:node-set($no.namespace)"/>
</xsl:when>
<!-- Can't process unless namespace removed -->
<xsl:when test="*/self::ng:* or */self::db:*">
<xsl:variable name="chunk.hierarchy">
<xsl:if test="$chunk.fast != 0">
<xsl:choose>
+ <!-- Are we handling a docbook5 document? -->
+ <xsl:when test="$exsl.node.set.available != 0
+ and (*/self::ng:* or */self::db:*)">
+ <xsl:if test="$chunk.quietly = 0">
+ <xsl:message>Computing stripped namespace chunks...</xsl:message>
+ </xsl:if>
+ <xsl:apply-templates mode="find.chunks" select="exsl:node-set($no.namespace)"/>
+ </xsl:when>
<xsl:when test="$exsl.node.set.available != 0">
<xsl:if test="$chunk.quietly = 0">
<xsl:message>Computing chunks...</xsl:message>
</xsl:if>
+
<xsl:apply-templates select="/*" mode="find.chunks"/>
</xsl:when>
<xsl:otherwise>
<xsl:param name="node" select="."/>
</xsl:template>
+<!-- To use the same stripped nodeset everywhere, it should
+be created as a global variable here.
+Used by docbook.xsl, chunk-code.xsl and chunkfast.xsl -->
+<xsl:variable name="no.namespace">
+ <xsl:if test="$exsl.node.set.available != 0
+ and (*/self::ng:* or */self::db:*)">
+ <xsl:apply-templates select="/*" mode="stripNS"/>
+ </xsl:if>
+</xsl:variable>
+
<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:text>stripped namespace before processing</xsl:text>
</xsl:with-param>
</xsl:call-template>
- <xsl:variable name="nons">
- <xsl:apply-templates mode="stripNS"/>
- </xsl:variable>
- <!--
+ <!-- DEBUG: to save stripped document.
<xsl:message>Saving stripped document.</xsl:message>
<xsl:call-template name="write.chunk">
<xsl:with-param name="filename" select="'/tmp/stripped.xml'"/>
<xsl:with-param name="method" select="'xml'"/>
<xsl:with-param name="content">
- <xsl:copy-of select="exsl:node-set($nons)"/>
+ <xsl:copy-of select="exsl:node-set($no.namespace)"/>
</xsl:with-param>
</xsl:call-template>
-->
<xsl:text>processing stripped document</xsl:text>
</xsl:with-param>
</xsl:call-template>
- <xsl:apply-templates select="exsl:node-set($nons)"/>
+ <xsl:apply-templates select="exsl:node-set($no.namespace)"/>
</xsl:when>
<!-- Can't process unless namespace removed -->
<xsl:when test="*/self::ng:* or */self::db:*">