Closed michaelrsweet closed 2 months ago
Original reporter: Michael Sweet
Unfortunately, the current mxml_sax_cb_t function can't return a value, so this isn't something I can easily add support for without breaking compatibility with existing apps.
I'll keep this feature request open, but don't expect an implementation until at least Mini-XML 3.0 (which isn't even planned at this point...)
Original reporter: Michael Sweet
No problem, i patched the code myself to get it working.
Maybe it's possible to add an extra boolean parameter to be able to quit the parsing. With a default value of false, you won't break existing applications.
Original reporter:
Hi leon.wennekers,
currently I have the same issue. I want to stop parsing the XML file.
I read that you have added the feature to stop parsing XML files to minixml. May I ask you, if it is possible to get your patch?
Greetings Drake
Original reporter: Michael Sweet
Moving this to the Mini-XML 3.0 timeframe.
OK, I'm scoping the changes that will land in Mini-XML 3.0 and I think I will be holding off on breaking API changes for now, sorry...
I am working on a C project in which this feature could be very useful, but you say that the patch will break retro-compatibility?
@GPaso Yes because changing the SAX callback function to return a value (right now it is a void function) will break existing users of the API.
Is not feasible to implement a function, which can be called from the callback, that stops the SAX parsing? This should not brake compatibility
@GPaso It is not feasible since there is no context information in the callback that could be used for this, and Mini-XML is a multi-threaded library. I'm not going to hack together a solution, but will include this in the next major release when I can safely break backwards-compatibility.
[master 3df751f] SAX callback now returns a boolean (Issue #51)
Version: 3.x-feature Original reporter: Michael Sweet
In a project i'm currently working on we have xml-files of several MB's. As i don't want to read the whole document in memory i will use the new SAX API. From this document i only want to read the attributes of the rootnode.
It would be nice if we could stop the stream parsing if we have found what we were looking for. So we don't need to read through the whole document.