Re: [xsl] problem adding namespace node

Subject: Re: [xsl] problem adding namespace node
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Feb 2006 12:04:57 -0500
At 2006-02-28 17:57 +0100, Majirus FANSI wrote:
I did try <xsl:copy-of select="xalan:nodeset($dummy)/*/namespace::p"/>.
But the situation remains the same. No namespace created. I have tried both with xalan 2.6.0 and saxon 8. The result is the same: only <p:a/>, without namespace declaration.

Ummmm ... those processors do emit well-formed XML, so if you didn't get an error, and you did get <p:a/> then your "p" namespace is already declared in an ancestor and is already in scope so it isn't needed.


The XML syntax generator will not create a redundant declaration of a namespace that is already in scope.

any other tips are welcome.

If my suggestion below also does not add a namespace declaration, then I assume you already have the namespace declared in scope.


I hope this helps.

. . . . . . . . . . Ken

At 2006-02-28 11:28 -0500, I wrote:
I think it would be cleaner if you had in your stylesheet:

<xsl:stylesheet xmlns:p="http://majirus.org";>

then you could do:

<xsl:copy-of select="document('')/*/namespace::p"/>


--
Upcoming XSLT/XSL-FO hands-on courses: Washington,DC 2006-03-13/17
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread