xsl-list
[Top] [All Lists]

Re: [xsl] Re: Unwanted namespace prefix _0

2013-12-23 12:03:25
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:copy>
      <xsl:apply-templates select="node()|@*" />
  </xsl:copy>
</xsl:template>

you may wish to try

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

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--