<!-- * 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="*"/>
<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="."/>