[saxdotnet-devel] Re: Java SAX docs updated
Brought to you by:
jeffrafter,
kwaclaw
From: Karl W. <ka...@wa...> - 2004-12-20 19:09:54
|
Elliotte Harold wrote: > Folks, > > I just got an e-mail from David Megginson informing me that the JavaDocs > and some other docs at sax.sourceforge.net have been updated. > Apparently, he did not have access to the web site for some time, and > the documentation there was not up to date with the latest round of > revisions for SAX 2.0.2 that went on some months back for Java 1.5. > > Anyway, this probably fixes at least some but not all of the > inconsistencies that have been noted here about what's null and what's > the empty string. I haven't checked in detail yet, but it's worth double > checking all of our assumptions and comments over the last month or so > against the latest docs. I asked Dave Megginson and he does not remember why exactly namespace URI string and prefixes are treated differently, but he thinks it might have been programming convenience. One xml-dev reference I found, was by Tim Bray, arguing that since namespace URI references are not allowed to be empty strings (as per the namespace specs), passing an empty string should indicate an absent URI ref and then one can use the Equals method on it without worrying about null. (RFC 2396 gives a different meaning to empty URI references). In C# this seems less of an issue, as there are two other null-safe options: 1) static method: if (String.Equals(uri, "http://my.namespace.com")) {...} 2) operator: if (uri == "http://my.namespace.com") {...} Of which the latter would be the standard way to compare strings. Karl |