How to use event driven SAX parser (Simple API FOR XML) in C # or is it better to use the System.XML namespace?

In C ++, we can import the msxml library into our application, and then implement the ISAXContentHandler interface methods in our application class. Later create an ISAXReader object and call contentHandler with an instance of this class, where we provided the implementation of the event handler interfaces.
    Similarly, I want to achieve the same thing in C #. Is there any way to do this in C #? I mean, is there a way to parse SAX in C #. There is another method that I thought would help me in parsing an XML document and getting the XML information in my application. I clicked on the link " http://www.codeguru.com/csharp/csharp/cs_data/xml/article.php/c4221 "

It uses the DOM, and uses the System.XML namespace. Can anyone kindly help me in this regard ---- What is the way to achieve event-based XML parsing in C #  , or should I use the System.XML (DOM) namespace. if there is a SAX event controlled by plz method let me know how to do this in C #

+3
source share
2 answers

, SAX- .Net XmlReader. , , . : http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.read.aspx

, XmlReader - , , api. XmlDocument XML- , XDocument LINQ xml. , , .

+2

. , , System.XML DOM # SAX ( ), , SAX- #.

CodeProject: SAX: 1 - SAX-to-#.

0

Source: https://habr.com/ru/post/1774497/


All Articles