]> granicus.if.org Git - docbook-dsssl/commitdiff
Checkpointing clean copies of w2docbook.xsl and xtangle.xsl. This
authorMichael Smith <xmldoc@users.sourceforge.net>
Sun, 1 Jul 2007 15:24:31 +0000 (15:24 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sun, 1 Jul 2007 15:24:31 +0000 (15:24 +0000)
xtangle.xsl supports the suppress.doctype.in.output param.

releasetools/w2docbook.xsl
releasetools/xtangle.xsl

index c03cd87b7ab4f948d0930c4957ee783596577486..356d72f9a266cc5d2e4746b5d9b3a0fd8f1d6289 100644 (file)
@@ -7,14 +7,9 @@
 <!-- * copy of the file, check out that directory from the source repository -->
 <!-- * and build it. -->
 <!-- * -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
-  exclude-result-prefixes="xsl src xml" version="1.1">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:src="http://nwalsh.com/xmlns/litprog/fragment" exclude-result-prefixes="xsl src xml" version="1.0">
 
-  <xsl:param name="foo"></xsl:param>
-  <xsl:param name="bar"></xsl:param>
-
-  <xsl:output method="xml" indent="no" doctype-public="{$foo}" doctype-system=""/>
+  <xsl:output method="xml" indent="no"/>
 
   <xsl:preserve-space elements="*"/>
 
index 19e7e47b69b123c50f6b2cb34b45b1966087fdc7..15c9820e2aaf9dab4535a79c575b79e5e57c7331 100644 (file)
@@ -15,6 +15,7 @@
   <xsl:key name="fragment" match="src:fragment" use="@*[local-name() = 'id']"/>
 
   <xsl:param name="top" select="'top'"/>
+  <xsl:param name="suppress.doctype.in.output" select="0"/>
 
 
   <xsl:output method="xml"/>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
-<xsl:template match="*" mode="copy">
-  <xsl:variable name="node" select="."/>
-  <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
-      <xsl:for-each select="namespace::*">
+  <xsl:template match="*" mode="copy">
+    <xsl:variable name="node" select="."/>
+    <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
+        <xsl:for-each select="namespace::*">
     <xsl:if test="string(.) != namespace-uri($node)">
       <xsl:copy/>
     </xsl:if>
   </xsl:for-each>
-    <xsl:copy-of select="@*"/>
-    <xsl:apply-templates mode="copy"/>
-  </xsl:element>
-</xsl:template>
+      <xsl:for-each select="@*">
+        <xsl:choose>
+          <xsl:when test="not($suppress.doctype.in.output = 0)           and (local-name(.) = 'doctype-public'           or local-name(.) = 'doctype-system')           "/>
+          <xsl:otherwise>
+            <xsl:copy-of select="."/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+      <xsl:apply-templates mode="copy"/>
+    </xsl:element>
+  </xsl:template>
   <xsl:template match="processing-instruction()" mode="copy">
   <xsl:processing-instruction name="{name(.)}">
     <xsl:value-of select="."/>