[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] RE: MSXML and name() on namespace nodes


Subject: [xsl] RE: MSXML and name() on namespace nodes
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sat, 17 Feb 2001 22:53:36 -0800 (PST)

Hi Mike,

I reported exactly this issue to this lists months ago.

I got an acknowledgement from a MS employee, who confirmed that the fix will appear with the next
webrelease of MSXML.

Dimitre Novatchev.

MSXML and name() on namespace nodes
To: xsl-list at lists dot mulberrytech dot com 
Subject: [xsl] MSXML and name() on namespace nodes 
From: Mike Brown <mike at skew dot org> 
Date: Sat, 17 Feb 2001 23:34:49 -0700 (MST) 
Reply-To: xsl-list at lists dot mulberrytech dot com 

--------------------------------------------------------------------------------

I noticed what I believe is a minor bug in MSXML3.

While playing with the ASCII stylesheet viewer, I was comparing the
output from XML4J+Saxon against the output from MSXML3 in IE5, and
noticed one difference, aside from the expected whitespace stripping
that occurs in the MS DOM builder.

The name() function, when the current node is a namespace node,
returns in MSXML3 'xmlns' or 'xmlns:someprefix', whereas in Saxon
it returns just '' or 'someprefix'. I believe Saxon is correct and
MSXML3 is in error.

Quoting XPath 1.0, section 4.1,

"The name function returns a string containing a QName representing 
the expanded-name of the node [...] An implementation may include 
information about the original prefix in its representation of
nodes; in this case, an implementation can ensure that the returned
string is always the same as the QName used in the XML source"

...This make me think yeah, MSXML is allowed to tell us what was
in the source XML, and I guess that in the case of namespace nodes,
seeing the 'xmlns' would be OK.

*But* right after that paragraph, XPath says:

"NOTE: The string returned by the name function will be the same as
the string returned by the local-name function except for element
nodes and attribute nodes"

So, when we combine that with this:

"A namespace node has an expanded-name: the local part is the
namespace prefix (this is empty if the namespace node
is for the default namespace); the namespace URI is always null"

then it follows that local-name() would return for a namespace
node just the namespace prefix or an empty string, and that the
NOTE above would mean that name() cannot return the 'xmlns'...
thus MSXML3 is in error.

   - Mike
_________________________________________


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords