[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: ginga(A.E.)
Subject: [DotGNU]XmlNamespaceManager.LookupPrefix
Date: Sat, 18 Jan 2003 03:28:43 +0900

Hello DotGNU developers, I'm one of the XML developer of Mono.

Yesterday I found a problem about LookupPrefix method of
XmlNamespaceManager class. This method is documented in the
ECMA spec to return String.Empty if there are no entry for
argument namespace-uri.

I think this specification is wrong because if the argument
namespace-uri is mapped to "" (default namespace), then
it should return the same value as if there were no match.

XmlNamespaceManager of Intel's OCL is coded as below:

// TODO: ECMA V1 docs say to return string.Empty if there is no 
// mapped prefix, but believe this is wrong. Told committee and
// will probably see a change in edition 2
//return string.Empty;
return null;

Currently both DotGNU and Mono are implemented conforming to
ECMA specification. But if possible, I think it is good for both
of us to change its implementation way.

Of course It must occur some (or many) derivative modification,
especially XmlTextWriter.WriteStartElement method or so. And are
the same for XML library users.

BTW, I also noticed that XmlTextWriter.LookupPrefix of pnetlib
is not conformant to the ECMA spec because current code uses
return-value of the above XmlNamespaceManager straightly, as below:

  return namespaceManager.LookupPrefix(ns);

So if you decided to conform to ECMA spec, then it should be like:

  string prefix = namespaceManager.LookupPrefix(ns);
  return prefix == String.Empty ? null : prefix;


-- Atsushi Enomoto

reply via email to

[Prev in Thread] Current Thread [Next in Thread]