且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在不将其加载到内存中并使用 XElement 的情况下读取大型 xml 文件

更新时间:2023-09-10 20:15:40

是的,您可以将 XmlReader 与 方法 XNode.ReadFrom,参见文档中的示例,该示例使用 C# 将 XmlReader 发现的节点选择性地处理为 XElement.

Yes, you can combine XmlReader with the method XNode.ReadFrom, see the example in the documentation which uses C# to selectively process nodes found by the XmlReader as an XElement.