]> granicus.if.org Git - docbook-dsssl/commitdiff
More tweaks improving profiling of HTML Help
authorJirka Kosek <jirka@kosek.cz>
Wed, 28 Dec 2005 09:38:21 +0000 (09:38 +0000)
committerJirka Kosek <jirka@kosek.cz>
Wed, 28 Dec 2005 09:38:21 +0000 (09:38 +0000)
xsl/profiling/xsl2profile.xsl

index 41fcc7cf703ccf4116c3715dcf65c787d50c67d0..cfd81f7639ecced1fb7b58183413662d0241a9fb 100644 (file)
   <xsl:copy/>
 </xsl:template>
 
-<xsl:template match="xsl:template[@match='/' or @name='hhc-main' or @name='hhp-main']">
-  <xsl:if test="@match='/'">
-    <xslo:include href="../profiling/profile-mode.xsl"/>
-    <xslo:variable name="profiled-content">
-      <xslo:apply-templates select="/" mode="profile"/>
-    </xslo:variable>
-    <xslo:variable name="profiled-nodes" select="exslt:node-set($profiled-content)"/>
-  </xsl:if>
+<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:variable>
+  <xslo:variable name="profiled-nodes" select="exslt:node-set($profiled-content)"/>
   <xsl:copy>
     <xsl:copy-of select="@*"/>
     <xsl:apply-templates mode="correct"/>
   </xsl:copy>
 </xsl:template>
 
-<xsl:template match="*[@select='/']" mode="correct">
+<xsl:template match="xsl:template[@name='hhc-main' or @name='hhp-main'] | xsl:variable[@name='raw.help.title']">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="correct"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="*[starts-with(@select, '/')]" mode="correct">
   <xsl:copy>
     <xsl:for-each select="@*">
       <xsl:choose>
-        <xsl:when test="local-name(.) = 'select' and string(.) = '/'">
+        <xsl:when test="local-name(.) = 'select' and string(.) =  '/'">
           <xsl:attribute name="{local-name(.)}">$profiled-nodes</xsl:attribute>
         </xsl:when>
+        <xsl:when test="local-name(.) = 'select' and starts-with(., '/')">
+          <xsl:attribute name="{local-name(.)}">$profiled-nodes<xsl:value-of select="."/></xsl:attribute>
+        </xsl:when>
         <xsl:otherwise>
           <xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute>
         </xsl:otherwise>