dotgnu-general
[Top][All Lists]
Advanced

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

RE: [DotGNU]XmlNamespaceManager.LookupPrefix


From: Marcey, Joel I
Subject: RE: [DotGNU]XmlNamespaceManager.LookupPrefix
Date: Wed, 22 Jan 2003 09:07:45 -0800

Greetings,

Just to let you know, the edition 2 specification has corrected this
issue to state that:

"Return Value

A System.String containing the namespace URI for prefix, or null if
there is no mapped namespace."

I actually brought this issue up to the committee during a meeting
because I was implementing NamespaceManager for Intel's OCL.

If you go to one of the ECMA TC39 TG3 committee member mirror sites
(e.g. http://www.intel.com/ids/ecma), you can get the edition 2
specifications...posted there about 1 1/2 months ago. There are a lot of
fixes/updates to the edition 1 specification in these updated specs and
might help resolve some of these inconsistency issues you have been
seeing.

Thanks,
- Joel Marcey

* The views expressed here do not necessarily represent those of Intel
Corporation, its subsidiaries and/or its employees.*

-----Original Message-----
From: ginga(A.E.) [mailto:address@hidden 
Sent: Friday, January 17, 2003 10:29 AM
To: address@hidden
Subject: [DotGNU]XmlNamespaceManager.LookupPrefix

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:

<blockquote>
// 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;
</blockquote>

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;


Thanks,

-- Atsushi Enomoto

_______________________________________________
Developers mailing list
address@hidden
http://www.dotgnu.org/mailman/listinfo/developers


reply via email to

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