Re: [xsl] Coalesce namespaces for XHTML

Subject: Re: [xsl] Coalesce namespaces for XHTML
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Mon, 9 Feb 2009 21:13:40 +0000
> I can achieve that if I replace the template that matches xh:a with
> the following -
>
> <xsl:template match="xh:a">
>        <xsl:element name="{local-name()}">
>            <xsl:copy-of select="@*|text()"/>
>        </xsl:element>
>    </xsl:template>
>
> However it does not seem like a good solution - is there a better way
> of achieving this?

That's pretty much it - you have to a create a new element with the
same local name in a different namespace.

So along with the identity template, have:

<xsl:template match="*">
  <xsl:element name="{local-name()}">
    <xsl:apply-templates select="@*|node()"/>
  </xsl:element>
</xsl:template>

-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread