[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Re: Unwanted namespace prefix _0

Subject: [xsl] Re: Unwanted namespace prefix _0
From: Martin Holmes <mholmes@xxxxxxx>
Date: Mon, 23 Dec 2013 10:41:38 -0800

<xsl:copy copy-namespaces="no">

That does it! But why is this only a problem in Oxygen?

I've posted a question on the Oxygen forum about it.


On 13-12-23 10:03 AM, Graydon wrote:
On Mon, Dec 23, 2013 at 09:49:07AM -0800, Martin Holmes scripsit:
It's easy to cleanup with a regex search-and-replace, but it's
really annoying. There must be some way around it, otherwise people
would be asking this question all the time, surely? I assumed I'd
just forgotten something obvious or screwed something up.

I'm not sure I understand your specific problem, but if you're using the identity template and XSLT 2.0, instead of

<xsl:template match="node()|@*">
       <xsl:apply-templates select="node()|@*" />

you may wish to try

<xsl:template match="node()|@*">
    <xsl:copy copy-namespaces="no">
        <xsl:apply-templates select="node()|@*" />

That won't help you with namespaces that really have to be there, but if what
you're trying to do is, effectively, copy the document out of some defined
namespace in the source document into the default namespace in the result
document I think it'll work.

-- Graydon

Current Thread