xsl-list
[Top] [All Lists]

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

2012-12-07 10:03:09

On 07/12/2012 15:39, Andrew Welch wrote:
On 7 December 2012 15:31, Michael Kay <mike(_at_)saxonica(_dot_)com> 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





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--