include ../buildtools/Makefile.incl
+XTANGLE_PARAMS=
+
all: tangle.xsl weave.xsl w2docbook.xsl xtangle.xsl
$(MAKE) -C html
$(MAKE) -C example
# it can rebuild itself.
xtangle.xsl: tangle.xweb bootstrap-tangle.xsl
$(XSLT) $< bootstrap-tangle.xsl .boot.tangle.xsl
- $(XSLT) $< .boot.tangle.xsl $@ top=xtop
+ $(XSLT) $< .boot.tangle.xsl $@ top=xtop $(XTANGLE_PARAMS)
rm -f .boot.tangle.xsl
-tangle.xsl: tangle.xweb xtangle.xsl
- $(XSLT) $< xtangle.xsl $@
+tangle.xsl: tangle.xweb xtangle.xsl
+ $(XSLT) $< xtangle.xsl $@ $(XTANGLE_PARAMS)
tangle.xml: tangle.xweb w2docbook.xsl
$(XSLT) $< w2docbook.xsl $@
weave.xsl: weave.xweb xtangle.xsl
- $(XSLT) $< xtangle.xsl $@
+ $(XSLT) $< xtangle.xsl $@ $(XTANGLE_PARAMS)
weave.xml: weave.xweb w2docbook.xsl
$(XSLT) $< w2docbook.xsl $@
xjparse $@
w2docbook.xsl: weave.xweb xtangle.xsl weave.xsl
- $(XSLT) $< xtangle.xsl $@ top=w2docbook
+ $(XSLT) $< xtangle.xsl $@ top=w2docbook $(XTANGLE_PARAMS)
realclean: clean
rm -f xtangle.xsl
<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"/>
</src:fragment>
</orderedlist>
<src:fragment id="copy-default">
-<xsl:template match="*" mode="copy">
- <xsl:variable name="node" select="."/>
- <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
- <src:fragref linkend="copy-namespaces"/>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="copy"/>
- </xsl:element>
-</xsl:template>
+ <xsl:template match="*" mode="copy">
+ <xsl:variable name="node" select="."/>
+ <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}">
+ <src:fragref linkend="copy-namespaces"/>
+ <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>
</src:fragment>
<para>For non-XML source docuements, this template will never match