diff options
author | Simon MacMullen <simon@lshift.net> | 2010-03-12 13:49:50 +0000 |
---|---|---|
committer | Simon MacMullen <simon@lshift.net> | 2010-03-12 13:49:50 +0000 |
commit | 2763fd3c1775f17ae210b55bb381069d490faee5 (patch) | |
tree | 52463d4b0d9ee1b2490aadf4d16c24dc2411139c | |
parent | cad0b9e9b6d393190aac3b676eef91776b84951a (diff) | |
download | rabbitmq-server-2763fd3c1775f17ae210b55bb381069d490faee5.tar.gz |
Remove DOCTYPE with --novalid and namespaces with XSLT.
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | docs/remove-namespaces.xsl | 17 |
2 files changed, 22 insertions, 8 deletions
@@ -208,18 +208,15 @@ distclean: clean docs/usage.xsl $< | sed -e s/\\\"/\\\\\\\"/g | sed -e s/%QUOTE%/\\\"/g | \ fmt -s > docs/`basename $< .1.xml`.usage.erl -# This evil with grep and sed is due to the remarkable ugliness otherwise -# experienced trying to get XSLT to work with an input doc where all nodes are -# in a namespace. -# Also we rename the file before xmlto sees it since xmlto will use the name of +# We rename the file before xmlto sees it since xmlto will use the name of # the file to make internal links. %.man.xml: %.xml docs/html-to-website-xml.xsl cp $< `basename $< .xml`.xml && \ xmlto xhtml-nochunks `basename $< .xml`.xml ; rm `basename $< .xml`.xml - cat `basename $< .xml`.html | grep -v DOCTYPE | \ - sed -e s,xmlns=\"http://www.w3.org/1999/xhtml\",, | \ - xsltproc --stringparam original `basename $<` \ - docs/html-to-website-xml.xsl - | xmllint --format - > $@ + cat `basename $< .xml`.html | \ + xsltproc --novalid docs/remove-namespaces.xsl - | \ + xsltproc --stringparam original `basename $<` docs/html-to-website-xml.xsl - | \ + xmllint --format - > $@ rm `basename $< .xml`.html docs_all: $(MANPAGES) $(WEB_MANPAGES) diff --git a/docs/remove-namespaces.xsl b/docs/remove-namespaces.xsl new file mode 100644 index 00000000..58a1e826 --- /dev/null +++ b/docs/remove-namespaces.xsl @@ -0,0 +1,17 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://www.rabbitmq.com/namespaces/ad-hoc/doc" + version='1.0'> + +<xsl:output method="xml" /> + + <!-- Copy every element through with local name only --> + <xsl:template match="*"> + <xsl:element name="{local-name()}"> + <xsl:apply-templates select="@*|node()"/> + </xsl:element> + </xsl:template> + + <!-- Copy every attribute through --> + <xsl:template match="@*"><xsl:copy/></xsl:template> +</xsl:stylesheet> |