]> granicus.if.org Git - docbook-dsssl/commitdiff
Profiling now works together with namespace stripping (V5 documents). Namespace strip...
authorJirka Kosek <jirka@kosek.cz>
Mon, 6 Mar 2006 07:47:42 +0000 (07:47 +0000)
committerJirka Kosek <jirka@kosek.cz>
Mon, 6 Mar 2006 07:47:42 +0000 (07:47 +0000)
xsl/profiling/profile-mode.xsl
xsl/profiling/xsl2profile.xsl

index 25afa06310da0a5ed63d96592fed4ca450a4e9fd..9ee4de78bb024deffdc4d0abe1e2cb885ca69b1e 100644 (file)
     <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,':'))
index cfd81f7639ecced1fb7b58183413662d0241a9fb..2341713c609ea245691f4631e7025dedf7292781 100644 (file)
 <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="@*"/>