xsl-list
[Top] [All Lists]

Re: [xsl] Unwanted default namespace copied to output in XSLT v1.0

2007-11-30 06:52:06


David Carlisle wrote:
Any suggestions how to avoid this problem?


in xslt 1 xsl:copy always copie in scope namespaces so if you don't want
that, don't use xsl:copy, instead use

<xsl:element name="{name()}" namespace="{namespace-uri()}">

which generates a new element with same name as the old one, but without
copying namespace nodes.

In fact, that was what I was doing before, however I was missing the namespace="..." attribute and the result was the stylesheet only worked when I had all the input document namespaces declared in the stylesheet, which was not possible since the input document namespaces are not known in advance.

Thanks for your help.  Works a charm.

Ian

--
Ian Stokes-Rees, Consultant           SP Metric Technology Consulting
ijstokes(_at_)spmetric(_dot_)com                 http://www.spmetric.com


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>