How to extract untranslated XML from a stream

"James Whetstone" <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <004601c705bc$9a9b5490$6501a8c0@crankshaft>
Hi,

I'm working on a project where, in addition to parsing all the elements in 
an XML stream, I need to obtain all the unparsed XML content between 2 tags. 
Here's an example:

<envelope>
    <packet>
        <tag_one>data</tag_one>
        <tag_two>
            <tag_three>more data</tag_three>
        </tag_two>
    </packet>
</envelope>

So with this example, I want to extract all the XML content between the 
<envelope> tags and then parse the stream using standard handlers.  Can 
anyone make some suggestion here or point me in the right direction?  Is 
this even possible with the API?  From what I can tell, it isn't really 
designed to extract untranslated XML bytes like this.

The reason I want to do this is because I want to parse the stream and save 
the data to a database in two ways:  I want to save the data as individual 
columns AND as an entire XML document for quick retrieval.  Ideally, I'd 
like to store the XML document without having to re-copy the content to a 
separate buffer.


Thanks,
James
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.