SAXParser equivalent in C#

后端 未结 2 1041
鱼传尺愫
鱼传尺愫 2020-12-20 19:22

I have below java code , I need to convert these in C#, Kindly help me ..

public class Configuration {

  private ConfigContentHandler confHandler;

  public         


        
2条回答
  •  臣服心动
    2020-12-20 19:38

    C# native XML parser XmlReader doesn't support SAX and is forward-only. You may take a look at this article presenting some specific points about it. You could simulate a SAX parser using XmlReader. If it doesn't suit your needs you could also use XDocument which is a different API for working with XML files in .NET. So to conclude there's no push XML parser built into .NET framework so you might need to use a third party library or COM Interop to MSXML to achieve this if you really need an event driven parser.

提交回复
热议问题