OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Some clarificatiosn -- RE: [Question] How to do incremental parsing?

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
	   ISAXErrorHandler interfaces
	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
tree-node structure
   at a time.

Hope this helps.

Thank you,