]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed addNS substitution in variable named profile-content
authorBob Stayton <bobs@sagehill.net>
Wed, 27 Jun 2007 21:24:30 +0000 (21:24 +0000)
committerBob Stayton <bobs@sagehill.net>
Wed, 27 Jun 2007 21:24:30 +0000 (21:24 +0000)
to use the mode="profile".

releasetools/xslns-build

index c426b87441881869ee162eab1b06b2a18fc6cc21..af3779b06a7492032ae3039a86834cc07bc43e06 100755 (executable)
@@ -255,8 +255,14 @@ sub nsfilter {
   # Convert stripNS to addNS
   s|href="../common/stripns.xsl"|href="../common/addns.xsl"|sg;
   
+  # Convert stripNS to addNS for profiling stylesheets
+  s|(<xslo?:variable[^>]*name="profiled-content").*?mode="profile".*?(</xslo?:variable>)|<xslo:variable name="profiled-content"> <xslo:choose> <xslo:when test="namespace-uri(*[1]) != 'http://docbook.org/ns/docbook'"> <xsl:message>Adding DocBook namespace to version 4 DocBook document</xsl:message> <xsl:variable name="addns"> <xsl:apply-templates mode="addNS" mode="profile"/> </xsl:variable> <xsl:apply-templates select="exsl:node-set(\$addns)"/> </xslo:when> <xslo:otherwise> <xslo:apply-templates select="/" mode="profile"/> </xslo:otherwise> </xslo:choose> </xslo:variable>|sg;
+
   s|(\s*\n*)(\s*)(<xslo?:when)\s+test\s*=\s*"[^"]*?self::db:[^"]*?">.*?(</xslo?:when>)|$1$2$3 test="namespace-uri\(\*\[1\]\) != 'http://docbook.org/ns/docbook'">\n$2 <xsl:variable name="doc.title">\n$2 <xsl:call-template name="get.doc.title"/>\n$2 </xsl:variable>\n$2 <xsl:call-template name="log.message">\n$2 <xsl:with-param name="level">Note</xsl:with-param>\n$2 <xsl:with-param name="source" select="\$doc.title"/>\n$2 <xsl:with-param name="context-desc">\n$2 <xsl:text>namesp. add</xsl:text>\n$2 </xsl:with-param>\n$2 <xsl:with-param name="message">\n$2 <xsl:text>added namespace before processing</xsl:text>\n$2 </xsl:with-param>\n$2 </xsl:call-template>\n$2 <xsl:variable name="addns">\n$2    <xsl:apply-templates mode="addNS"/>\n$2  </xsl:variable>\n$2  <xsl:apply-templates select="exsl:node-set\(\$addns\)"/>\n$2$4|sg;
   
+  # Remove the "Hack!" message -->
+  s|<!-- Hack! If someone hands us a.*?-->||sg;
+
   # Add namespace d to exclude-result-prefixes
   
   if ( $_ =~ /exclude-result-prefixes\s*=/ ) {