<xsl:strip-space elements="*"/>
<xsl:param name="ns" select="'http://docbook.org/ns/docbook'"/>
+<xsl:param name="html-ns" select="'http://www.w3.org/1999/xhtml'"/>
+<xsl:param name="rddl-ns" select="'http://www.rddl.org/'"/>
<xsl:template match="/">
<xsl:apply-templates/>
<xsl:value-of select="@name"/>
<xsl:text> </xsl:text>
- <xsl:text>	xmlns	CDATA	#FIXED	"</xsl:text>
- <xsl:value-of select="$ns"/>
- <xsl:text>" </xsl:text>
+ <xsl:choose>
+ <xsl:when test="starts-with(@name,'rddl:')">
+ <xsl:text>	xmlns:rddl	CDATA	#FIXED	"</xsl:text>
+ <xsl:value-of select="$rddl-ns"/>
+ <xsl:text>" </xsl:text>
+ </xsl:when>
+ <xsl:when test="starts-with(@name,'html:')">
+ <xsl:text>	xmlns:html	CDATA	#FIXED	"</xsl:text>
+ <xsl:value-of select="$html-ns"/>
+ <xsl:text>" </xsl:text>
+ </xsl:when>
+ <xsl:when test="contains(@name, ':')">
+ <xsl:message terminate="yes">
+ <xsl:text>Unexpected prefix on </xsl:text>
+ <xsl:value-of select="@name"/>
+ </xsl:message>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>	xmlns	CDATA	#FIXED	"</xsl:text>
+ <xsl:value-of select="$ns"/>
+ <xsl:text>" </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:apply-templates/>
<xsl:text> > </xsl:text>