summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@lshift.net>2010-03-12 13:49:50 +0000
committerSimon MacMullen <simon@lshift.net>2010-03-12 13:49:50 +0000
commit2763fd3c1775f17ae210b55bb381069d490faee5 (patch)
tree52463d4b0d9ee1b2490aadf4d16c24dc2411139c
parentcad0b9e9b6d393190aac3b676eef91776b84951a (diff)
downloadrabbitmq-server-2763fd3c1775f17ae210b55bb381069d490faee5.tar.gz
Remove DOCTYPE with --novalid and namespaces with XSLT.
-rw-r--r--Makefile13
-rw-r--r--docs/remove-namespaces.xsl17
2 files changed, 22 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index cd6b1420..eda87c50 100644
--- a/Makefile
+++ b/Makefile
@@ -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>