Re: [xsl] Remove Namespace from ouput's root element

Subject: Re: [xsl] Remove Namespace from ouput's root element
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 26 Oct 2010 15:55:32 +0200
Ramkumar.V wrote:

I doing xml to xml transformation using xslt2.0 with Saxon.

My Input XML uses namespace at the root element is: xmlns:xlink="http://www.w3.org/1999/xlink"; and some elements used this attributes like xlink:href="something".

The same namespace is coming to my transformed output xml at the root element. But this namespace is not used by any element in output xml.

I like to remove or avoid this namespace also i am getting xml parsing error due to this.

Could you please any one suggest me for the above issue?

Well we need to see the relevant templates to suggest the proper changes. I assume you use xsl:copy or xsl:copy-of and that by default copies any namespace nodes. If you don't want that then with XSLT 2.0 you can use copy-namespace and inherit-namespaces to change that behaviour.


As for the parse error, please post more details on that.


--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

Current Thread