Hi,
this has bugged me for some time! SAX is actually
pretty clear about it: the empty string should be
used in the sense "not specified" in all SAX event
methods, but SAX applications seem to ignore this
specification all the time, including Xerces 2,
presumably because using null simply makes more
sense and is more intuitively obvious! If you want
to be implementation-independent you thus simply
have to check for both cases. That sorta sucks! :)
I guess this is just because nobody got around to
fixing the SAX spec. I can't think of any decent
reason for using the empty string rather than null
there. A distinction is made in the Attributes
interface between a null URI/LocalName (meaning
no such attribute) and an empty one (meaning the
attribute exists but is in the default namespace),
but this really doesn't seem important.
I didn't find a bug/enhancement request for this
in the SourceForge SAX project -- and changing
the SAX2 spec now would probably annoy hordes of
maintainers of existing apps! But I for one would
be happy about the change!
- Gulli
---
Gunnlaugur Thor Briem at Dimon Software
"The world is divided into good and bad people.
The good ones sleep better ... while the bad
ones enjoy the waking hours much more."
-- Woody Allen
> -----Original Message-----
> From: Elena Litani [mailto:[EMAIL PROTECTED]]
> Sent: 20. november 2001 16:14
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: Status update: Axis w/Xerces2
>
>
>
>
> 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?
>
> --
> Elena Litani / IBM Toronto
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]