fixed xmlns handling in man pages

This commit is contained in:
Jim Apperly 2010-09-24 14:08:57 +01:00
parent 42cd6a4e55
commit 1ae11f41ce
2 changed files with 15 additions and 11 deletions

View File

@ -1,6 +1,9 @@
<?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"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="html"
version='1.0'>
<xsl:param name="original"/>
@ -15,9 +18,9 @@
</xsl:template>
<!-- Copy the root node, and munge the outer part of the page -->
<xsl:template match="/html">
<xsl:template match="/html:html">
<xsl:processing-instruction name="xml-stylesheet">type="text/xml" href="page.xsl"</xsl:processing-instruction>
<html xmlns:doc="http://www.rabbitmq.com/namespaces/ad-hoc/doc">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:doc="http://www.rabbitmq.com/namespaces/ad-hoc/doc">
<head>
<title><xsl:value-of select="document($original)/refentry/refnamediv/refname"/><xsl:if test="document($original)/refentry/refmeta/manvolnum">(<xsl:value-of select="document($original)/refentry/refmeta/manvolnum"/>)</xsl:if> manual page</title>
</head>
@ -49,7 +52,7 @@
<doc:heading>Table of Contents</doc:heading>
</doc:toc>
<xsl:apply-templates select="body/div[@class='refentry']"/>
<xsl:apply-templates select="html:body/html:div[@class='refentry']"/>
</doc:div>
</body>
</html>
@ -57,32 +60,32 @@
<!-- Specific instructions to revert the DocBook HTML to be more like our ad-hoc XML schema -->
<xsl:template match="div[@class='refsect1'] | div[@class='refnamediv'] | div[@class='refsynopsisdiv']">
<doc:section name="{h2}">
<xsl:template match="html:div[@class='refsect1'] | html:div[@class='refnamediv'] | html:div[@class='refsynopsisdiv']">
<doc:section name="{html:h2}">
<xsl:apply-templates select="node()"/>
</doc:section>
</xsl:template>
<xsl:template match="div[@class='refsect2']">
<doc:subsection name="{h3}">
<xsl:template match="html:div[@class='refsect2']">
<doc:subsection name="{html:h3}">
<xsl:apply-templates select="node()"/>
</doc:subsection>
</xsl:template>
<xsl:template match="h2 | h3">
<xsl:template match="html:h2 | html:h3">
<doc:heading>
<xsl:apply-templates select="node()"/>
</doc:heading>
</xsl:template>
<xsl:template match="pre[@class='screen']">
<xsl:template match="html:pre[@class='screen']">
<pre class="sourcecode">
<xsl:apply-templates select="node()"/>
</pre>
</xsl:template>
<xsl:template match="div[@class='cmdsynopsis']">
<div class="cmdsynopsis" id="{p/code[@class='command']}">
<xsl:template match="html:div[@class='cmdsynopsis']">
<div class="cmdsynopsis" id="{html:p/html:code[@class='command']}">
<xsl:apply-templates select="node()"/>
</div>
</xsl:template>

View File

@ -1,6 +1,7 @@
<?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"
xmlns="http://www.w3.org/1999/xhtml"
version='1.0'>
<xsl:output method="xml" />