[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Some clarificatiosn -- RE: [Question] How to do incremental parsing?
- From: Ajay K sanghi <firstname.lastname@example.org>
- To: "Xu, Mousheng (SEA)" <Mousheng.Xu@sea.celltechgroup.com>,email@example.com
- Date: Mon, 09 Jul 2001 21:03:03 +0530
Mousheng Xu writes:
An incremental SAX parser such as the suggested MSXML SAX parser seems to be
the closest idea, but an incremental DOM parser has to be built upon it.
Ajay, do you have a quick reference on MSXML?
As for quick reference on MSXML,
1. We have never used DOM.
2. We use both MSXML SAX parser and writer.
3. For parsing we use:
a. ISAXXMLReader for Parse()ing.
b. IMXReaderControl for Suspend(), Resume() and Abort()
c. Class derrived from ISAXContentHandler for registering our own
content handler for SAX Events (startDocument(), endDocument(),
startElement(), endElement(), characters() etc)
d. Class derrived from ISAXErrorHandler to catch error situations
e. Initialise ISAXXMLReader with your own ISAXContentHandler and
f. Initiate Parse()ing and catch events
g. Suspend() (probably in one of the ISAXContentHandler events) and
Abort() (probably in one of the ISAXErrorHandler event) in one the
catch'ed events and Resume() when ready for parsing again
4. Writing is even simpler as far as the interfaces are concerned but
end-tags can be a bit tricky depending on nestedness of your structure. I
think if you use DOM, you don't have to worry about writing the
but I guess you do have to worry about the memory constraints. I am not
if you can create small DOM-lets and "append" to the same file, one
at a time.
Hope this helps.