Re: [xsl] Removing Namespace declaration from root element [xsltproc XSLT 1.0]

Subject: Re: [xsl] Removing Namespace declaration from root element [xsltproc XSLT 1.0]
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 17 Sep 2010 09:16:23 +0100
On 17/09/2010 8:00 AM, pankaj.c@xxxxxxxxxxxxxxxxxx wrote:
Hello all,

I am trying to remove namespace declaration from root element in my xml
input. Below is what it looks like:

Root Element:
=========
<chapter xmlns:sb="http://www.elsevier.com/xml/common/struct-bib/dtd";
xmlns:ce="http://www.elsevier.com/xml/common/dtd"; xmlns:mml="
http://www.w3.org/1998/Math/MathML"; xmlns:xlink="
http://www.w3.org/1999/xlink"; xmlns:aid="
http://ns.adobe.com/AdobeInDesign/4.0/"; xmlns:aid5="
http://ns.adobe.com/AdobeInDesign/5.0/"; aid:pstyle="" aid5:tablestyle=""
version="5.2" xml:lang="en" docsubtype="chp" id="c0030">
<ce:footnote id="fn0010">
======

Desired Output
=========

<chapter version="5.2" xml:lang="en" docsubtype="chp" id="c0030">
<ce:footnote id="fn0010">


Your desired output is not namespace-well-formed (prefix ce is undeclared), so it's not possible to generate it using XSLT.

Michael Kay
Saxonica

Current Thread