Elena Litani wrote:
>
> Davanum Srinivas wrote:
>
> > NullPointerException. This is due to the URI that is stored...In Xerces2 getURI()
>returns null, in
> > Xerces1 getURI() returns an empty string. If you need more information, shoot me a
>mail.
>
> In Xerces2 we've decided to use null instead of empty string for URI.
> As a temporary solution, I can fix the problem in AbstractSAXParser
> (getURI() - to return "" instead of null).
> However, I am not sure that this is right - I believe that the problem
> is in SAX definition.
> Why is it required that URI would be an empty string, which btw is not a
> legal URI?
My guess is that SAX was intentionally designed this way so that apps
can simply compare strings and not worry about null arguments or the
ambiguity between "" and null. Apps could be written like this:
String aString;
startDocument() {
aString = // possibly null
startElement(String nsURI,...) {
if (nsURI.equals(aString)) then
instead of something like this:
startElement(String nsURI,...) {
if (nsURI != null && nsURI.equals(aString)) then
-Edwin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]