Mark, I share your pain.  I tried to implement something similar as well,
with little success.  My goal was to achieve a "best of both worlds" -
process the inbound XML using SAX/streaming, but access the XML as a DOM.

I was heading down the path of "skipping" the stream/stream element and
processing only the snippets of XML contained within...using some type of
custom stream handler, but got pulled off onto higher priority efforts..

Keep us posted on your progress!

Rick Bullotta
CTO
Lighthammer Software (http://www.lighthammer.com)

-----Original Message-----
From: Mark Studenka [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 09, 2004 11:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Parser issue 


So, I'm using a SAX parser, so the closing tag shouldn't be an issue
if it's not there.  But, it did point me in the right direction.  The
parser was throwing the error because the client was closing the connection,
whereas I thought the server was closing the connection because of the
exception.

So once I figured out the client was closing, I discovered the problem was
in the response XML I was sending back to the client.

I think the main reason I couldn't figure this out before was that the
exception thrown was telling me the error was on line 3 column 1, so
I thought it was reading the next tag coming in but was really just
reporting the stream closing and this was the next character to read.

Thanks for your patience whilst I think outloud and figure out my
problems.

-markrs

> You are missing the </stream:stream> end tag, or did you just omit to
> show it?
> 
> -----Original Message-----
> From: Mark Studenka [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 09, 2004 1:50 PM
> To: [EMAIL PROTECTED]
> Subject: Parser issue
> 
> 
> I'm having a small issue that I'm having some problems debugging.
> 
> I'm getting an exception: "XML document structures must start and end 
> within the same entity"
> 
> I'm trying to implement a jabber server.  So I'm parsing off an incoming
> socket connection and can't actually see the data as it comes in from
> the
> client.  The issue I have is that I'm testing with multiple clients and
> most of them seem to work just fine except for one.  When I connect to a
> test server and dump the raw xml so I can see it everything looks just
> normal.  I'm guessing there may be some kind of encoding issue that I
> just
> can't tell when I dump the xml to see it, but is causing an issue when
> I parse it off the connection.  This particular client is using the Qt
> libs to generate the xml, so I figure it's pretty clean.
> 
> So I guess what I'm trying to say is, any ideas on what could be causing
> the exception?
> 
> The xml I'm expecting is:
> <?xml version="1.0"?>
> <stream:stream xmlns:stream="http://etherx.jabber.org/streams";
> xmlns="jabber:client" to="localhost">
> <iq type="get" id="auth_1" to="localhost">
> <query xmlns="jabber:iq:auth">
> <username>user</username>
> </query>
> </iq>
> 
> The exception gets thrown at the "<" at the start of the iq tag.
> 
> Thanks for any insight you might be able to provide.  I realize this may
> sound fairly vague, but I just can't seem to figure out what might be
> going wrong.  I can provide any info that might help.
> 
> -markrs
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to