Re: expat parsing destructively?

"Mark" <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
I think this is extremely unlikely this will work.  You are assuming that expat will always return a pointer to the data contained within the original memory buffer and not in any internal buffers.   

---- Original Message ----
Simply allocate 2 copies of the same data... i.e. read in the data to
one buffer, malloc() another buffer the same size, and do a huge
memcpy() to make a duplicate copy.  Now let eXpat scan one copy, and
doing some quick and dirty pointer math, you can now find
corresponding locations in the "non-eXpat" buffer and destroy it to
your hearts content.  When you're all done, simply free both buffers.
Its a little more memory intensive.. but sounds fairly elegant to me,
and you don't need to worry about doing anything unsupported by eXpat.


--------------------------------------
Protect yourself from spam, 
use http://sneakemail.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.