You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Vijay S. Bajwa" <vi...@citigroup.com> on 2007/01/17 16:04:09 UTC
Peek into Document?
I have a rather large document consisting of the following elements:
<trdMsg>
<msgHdr>
...
...
</msgHdr>
<block>
...
...
</block>
<alloc>
...
...
</alloc>
<alloc>
...
...
</alloc>
<!-- allocs could be repeating 10000 times -->
</trdMsg>
I just want to peek into the msgHdr. Currently I am using SAXParser to parse
the whole document. Is there a way to just extract out msgHdr w/o parsing all
the remaining elements? I guess just stop the SAX parsing after the msgHdr, but
is this efficient if internally some producer thread is merrily parsing ahead?
Thanks a lot!
Vijay
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: Peek into Document?
Posted by Jason Stewart <ja...@gmail.com>.
Hey,
On 1/17/07, Vijay S. Bajwa <vi...@citigroup.com> wrote:
> I just want to peek into the msgHdr. Currently I am using SAXParser to parse
> the whole document. Is there a way to just extract out msgHdr w/o parsing all
> the remaining elements? I guess just stop the SAX parsing after the msgHdr, but
> is this efficient if internally some producer thread is merrily parsing ahead?
>
SAX is as efficient as you will get in this situation.
Grab the piece in between your <msgHdr>...</msgHdr> and stop the parse.
Cheers, jas.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org