How to stop parsing a block at a appl-level error

"Andre Luis Monteiro" <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
Hi,

I'm one more Expat newbie just amazed by the conceptual simplicity and roubustness of this lib / API. Great work!

I'm building a C parser state machine on top of Expat, targeting config XML files. It was quite easy to code, and it's working fine and fast.

But I'm not satisfied with it's error handling, since the "semantic errors" -- XML structure errors or application-level errors derived from config actions -- must be "postponed" to the next XML document block to parse; I have not found a (fancy) manner to handle them as soon as they are found, stopping further parsing and returning the XML_Parser info (like line number and column etc.).

I didn't understand why the XML handler typedefs (like XML_StartElementHandler) do not declare a return value that could signal "user errors", in such a way that applications (XML parsers) could tell Expat to "get away with the shit" in a simple manner. Please explain the reasons why, ok? I'm a novice, just learning XML, SAX, Expat.

Moreover, please tell me how to stop the parsing and return as soon as an application-level error could be found (in a XML_StartElementHandler or a XML_EndElementHandler, for ex.).


regards

André Luís


PS: sorry for my bad English...




-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.