[Expat-discuss] use of expat with socket

Allen, Michael B (RSCH) Michael_B_Allen@ml.com
Tue, 24 Jul 2001 16:19:15 -0400


Just use some special character to signify EOR (end of record) and then
call XML_ParseBuffer with the isFinal parameter as true when you see it.

Mike

> -----Original Message-----
> From:	Thomas J. Clancy [SMTP:tclancy@personity.com]
> Sent:	Tuesday, July 24, 2001 1:23 PM
> To:	expat-discuss@lists.sourceforge.net
> Subject:	[Expat-discuss] use of expat with socket
> 
> Hey There,
> 
> I'm new to this dicussion group and new to expat, so forgive me if this
> question has already been asked (I didn't see anything related to this on
> the web site).
> 
> I want to use expat to replace our own home brewed XML parser.  The problem
> is that while I'm getting in data from a socket (the protocol to our product
> is in XML), I may get more than one XML document at a time.  When I tried to
> simulate this with the xmlwf app by creating a file that contained two xml
> documents, expat crapped out with:
> 
> "junk after document element at line 7."
> 
> Here is the XML I was messing around with:
> 
> <?xml version="1.0" ?>
> <foo>
>   this is a test
>   <b>this is</b>
>   only a test.
> </foo>
> <?xml version="1.0" ?>
> <foo2>
>   this is a test
>   <b>this is</b>
>   only a test.
> </foo2>
> 
> 
> I need to detect through some handler that I've reached the end of the
> document and to not continue processing.  Then I can put away the remainder
> of the buffer and process it later.  Can this be done?
> 
> 
> Thomas J. Clancy
> 
> 
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/expat-discuss