<xsl:copy>
<xsl:copy-of select="@*"/>
<!-- Fix base URI of some elements -->
- <xsl:if test="$profile.baseuri.fixup and (self::textdata or self::imagedata or self::videodata or self::audiodata or self::inlinegraphic or self::graphic)">
+ <xsl:if test="$profile.baseuri.fixup and (self::textdata or self::imagedata or self::videodata or self::audiodata or self::inlinegraphic or self::graphic) and not(@xml:base)">
<xsl:choose>
<xsl:when test="@fileref
and not(contains(@fileref,':'))
<xsl:template match="xsl:template[@match='/']">
<xslo:include href="../profiling/profile-mode.xsl"/>
<xslo:variable name="profiled-content">
- <xslo:apply-templates select="/" mode="profile"/>
+ <xslo:choose>
+ <xslo:when test="*/self::ng:* or */self::db:*">
+ <xslo:message>Stripping NS from DocBook 5/NG document.</xslo:message>
+ <xslo:variable name="stripped-content">
+ <xslo:apply-templates select="/" mode="stripNS"/>
+ </xslo:variable>
+ <xslo:message>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>
</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="@*"/>