[Expat-discuss] Nested calls to XML_Parse

Greg Martin Greg.Martin at TELUS.COM
Wed Jun 11 13:40:15 EDT 2003


Expat is a stream oriented parser. It seems to me (as a bystander using the API) that it wouldn't make sense to embed a call to XML_Parse. You're not starting a new document you are simply parsing embedded tags and that's what your callback functions handle. A call to XML_Parse probably resets the
state of the parser or the stream position(and hence your loop).  I suppose if the contents of a tag was another xml document you could create a second parser object and call XML_Parse using that parser ...
Regards,
Greg.

-----Original Message-----
From: Derek Snider [mailto:derek at bluegenesis.com]
Sent: Wednesday, June 11, 2003 11:42 AM
To: expat-discuss at libexpat.org
Subject: [Expat-discuss] Nested calls to XML_Parse


Why do nested calls to XML_Parse (i.e. calling XML_Parse from within an
element handler) end up putting the parser into an endless loop?

I don't mean code-wise why the library acts this way, but why is this
the intention?

Is it not reasonable to want the possibility of XML elements expanding
into more XML to be passed to the parser?

It seems to add a lot of unneccessary overhead to require that nested
parsing involve nested creation and freeing of additional parsers (the
only way I could get this to work).

Am I missing something?


_______________________________________________
Expat-discuss mailing list
Expat-discuss at libexpat.org
http://mail.libexpat.org/mailman/listinfo/expat-discuss





More information about the Expat-discuss mailing list