[xsl] Cannot include namespaces [XSLT 1.0] xsltproc

Subject: [xsl] Cannot include namespaces [XSLT 1.0] xsltproc
From: pankaj.c@xxxxxxxxxxxxxxxxxx
Date: Mon, 23 Aug 2010 19:17:45 +0530
Hello all,

It seems that I really missing something very stupid with inclusion of 
namespaces in root element.

Everything was fine yesterday but it seems I mistakenly did some changes 
(BTW nothing much just written templates for some new environments )

I am not able to include my declared namespaces in my resulting xml. Below 
what I declare in my stylesheet.

Stylesheet:
<xsl:stylesheet version="1.0" xmlns:aid="
http://ns.adobe.com/AdobeInDesign/4.0/"; xmlns:aid5="
http://ns.adobe.com/AdobeInDesign/5.0/"; xmlns:ce=" 
http://www.elsevier.com/xml/common/dtd"; xmlns:xsl="
http://www.w3.org/1999/XSL/Transform";> 

My xml snippet:
<chapter version="5.2" xml:lang="en" docsubtype="chp" id="c0030" 
xmlns:sb="http://www.elsevier.com/xml/bk/dtd"; xmlns:ce="
http://www.elsevier.com/xml/common/dtd";><ce:title>xxxxx</ce:title>

stylesheet snippet

<xsl:template match="chapter">
<xsl:copy>
<xsl:attribute name="aid:pstyle"/>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>


Using XSLTPROC the root element output is 

<chapter xmlns:sb="http://www.elsevier.com/xml/bk/dtd"; xmlns:ce="
http://www.elsevier.com/xml/common/dtd"; xmlns="
http://www.elsevier.com/xml/bk/dtd"; xmlns:xlink="
http://www.w3.org/1999/xlink"; version="5.2" xml:lang="en" docsubtype="chp" 
id="c0030">

Means missing xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/"; 
xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/";, what could be 
possible reason.

I have written so many similar stylesheet but never encountered such error 
(making me crazy).

I cannot use <xsl:namespace name="aid"/> since using 1.0 version. Can 
somebody throw some light on it. I do not see issue with xsltproc but 
seems to be my mistake.

TIA,
Pankaj

Current Thread