Re: [xsl] serialized form of XML using xslt 1.0

Subject: Re: [xsl] serialized form of XML using xslt 1.0
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 07 Dec 2012 16:02:55 +0000
On 07/12/2012 15:39, Andrew Welch wrote:
On 7 December 2012 15:31, Michael Kay <mike@xxxxxxxxxxxx> wrote:
<foo>
    <bar/>
    <bar xmlns=''/>
</foo>

with

<xsl:template match="bar">
    <xsl:value-of select="boolean(namespace::*[name() = '']"/>

Saxon 6.5.5 returns true true

Xalan returns false true

I would have expected false false. But it's Friday afternoon.
....and the day after the christmas party :-( my head hurts.

You are right - false false for Saxon, false true for Xalan.

Any thoughts on a Xalan alternative approach?

Well, I imagine if they create a namespace node for xmlns="" then it will have name(.)="" and string(.)="", so you could test for that combination. A namespace node should never have string(.)="" so you could just filter out any such nodes.


Michael Kay
Saxonica

Current Thread