I don't know any SAX parsers for .NET. They are not really needed and not included in .NET Framework. Instead, there is a different forward-only technology implemented in the class
System.Xml.XmlReader
:
http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[
^].
Please also see this article on SAX and XmlReader comparison:
http://msdn.microsoft.com/en-us/library/sbw89de7.aspx[
^].
If you really want, you can create a technique fully equivalent to the SAX in the following way:
class SaxEventArgs : System.Args() {
internal SaxEventArgs(
System.Xml.XmlReader.NodeType,
string localName,
string namespace,
);
public System.Xml.XmlReader.NodeType NodeType { get; private set; }
public string LocalName { get; private set; }
}
public event System.EventHandler<saxeventargs> XmlNodeParsed;
void InvokeSaxEvent(XmlReader reader) {
if (XmlNodeParsed != null)
XmlNodeParsed.Invoke(reader, new SaxEventArgs(reader.NodeType, reader.LocalName, ));
}
while (reader.Read()) {
InvokeSaxEvent(reader);
}</saxeventargs>
Are you getting the idea?
However, I don't think you will ever need it much. :-)
I think the
XmlParser
is better. You can parse whatever you want. If you face some problems, you are welcome to ask another question.
Good luck,
—SA