Adding the XML namespace to an element node has no effect, because every
element node has a namespace node for the XML namespace automatically.
When serializing, redundant namespace nodes are never serialized as
namespace declarations; so the namespace node for the XML namespace is
never serialized because it is always redundant.
The serializer doesn't know that this particular namespace node was
added explicitly rather than implicitly.
(Internally, of course, the implementation is a bit different, in that
redundant namespace nodes aren't even stored in the data model. But the
above explains the behaviour in terms of the language semantics.)
Michael Kay
Saxonica
On 20/04/2012 10:48, Manfred Staudinger wrote:
> Hi,
>
> To get a document with the xml namespace declared explicitly:
> <msg xmlns:xml="http://www.w3.org/XML/1998/namespace"><text/></msg&gt;
>
> I tried
> <xsl:template match="/">
> <msg>
> <xsl:namespace name="xml"
> select="'http://www.w3.org/XML/1998/namespace'"/&gt;
> <text/>
> </msg>
> </xsl:template>
>
> but only got
> <msg><text/></msg>
>
> Did I miss something? Using Saxon-HE 9.4.0.3J
>
> Regards,
> Manfred
>
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>