[Expat-discuss] expat parsing destructively?

Boris Kolpackov boris at codesynthesis.com
Wed Nov 14 08:36:27 CET 2007


Hi Mohun,

Mohun Biswas <m_biswas at mailinator.com> writes:

> I still say it would be really great if expat had an optional
> destructive-parsing mode. For one thing it seems in keeping with the
> spirit of SAX where you chew through the data once linearly and never
> look back (except with your own state variables of course).

One obvious problem with this approach is that the attribute values
can contain entity references (e.g., &amp;, etc) that need to be
expanded. I suppose the parser could replace them in the original
buffer and zap the gap by moving the rest of the value forward but,
as you can see, it gets really messy.

Boris

-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding



More information about the Expat-discuss mailing list