[JDEV] newbie problem...
Iain Shigeoka
iainshigeoka at yahoo.com
Wed Feb 20 10:56:25 CST 2002
On 2/18/02 11:38 AM, "Dave" <daves at cyberclass.com> wrote:
> Hi all...I'm developing a Jabber client in J++ using a Xerces parser.
> When I hand the parser an InputSource with an InputStream object
> pointing to jabber.org, it hangs up. I can read the returned <stream>
> element into a String reader and then parse it just fine, but trying to
> parse with an InputStream or InputStreamReader argument in the
> InputSource constructor causes the program to hang, and I have to quit.
> Any ideas?
By default Xerces doesn't handle streaming data. You need to hand it a
reader that returns from reads with what is available rather than blocking
for the normal cache size of input. If you have the Xerces documentation,
see the Xerces FAQ. One of the questions is how do I parse streaming XML
data and the answer has the source code for a character reader class that
does the trick. If not, go to the Xerces website where you'll find the
same.
BTW, once you get it working let me know. I've been having trouble getting
the character reader to return odd numbers of characters (it seems to slurp
in pairs of characters) which causes some Jabber packets to jam up unless I
artificially inject an extra whitespace. I'd love to know a better
workaround or solution.
-iain
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
More information about the JDev
mailing list