[Expat-discuss] How can I add a function to skip a set number of bytes
Michael B. Allen
Wed, 29 Aug 2001 13:43:57 -0400
On Wed, Aug 29, 2001 at 09:52:35AM -0500, Joe Wiemann wrote:
> How can I add a function to skip a set number of bytes in the expat parser buffer...
> Such as if I get a certain begin tag ? it gives me a length of text that it has in it.
> I want to skip the text that is in the tag.
You don't want to "skip some bytes", you want to skip that tag and all
it's children? This is very simple to do with Expat. Look at the outline.c
or elements.c example programs that come with Expat. Modify the example
to pass a flag with or as the user ponter and use it to indicate that
the input should(n't) be ignored. IOW, start with the flag off. Test
it at the beginning of you start tag handler. If it's off, process as
normal. When you see that flag on, don't do anything in the begin tag
handler, just return. When you see the end tag for that element, flip
the flag off. Get it?
I beleive the Expat tutorial at XML.com describes exactly this problem.
Wow a memory-mapped fork bomb! Now what on earth did you expect? - lkml