"Hardy Wang" <ha********@marketrend.com> wrote in message news:Oe**************@TK2MSFTNGP14.phx.gbl...
.Net framework does not support SAX, at least I do not
find classes for SAX.
This is correct, the .NET Framework doesn't support SAX.
Instead, it supports a pull model streaming XML processing
API, through it's XmlReader and XmlWriter classes in the
System.Xml namespace.
What you'll probably need to do is subclass XmlTextReader.
It's still necessary to 'read' the whole file up to that point with
these classes, but what you avoid is building up the internal
structures supporting a DOM node tree for the XML content
you don't care about. That's why it can perform better.
Override the properties to detect (through some combination
of LocalName and NamespaceURI for that portion of the doc
you care about) when you enter the region of interest ... raise
a flag. In your overrides of other methods, capture the info
read while this flag is raised until you leave the region of
interest.
A Stack from the System Collections namespace is useful
here to track as you descend and ascend the node tree.
Derek Harmon