Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个转换 html 文件并返回 XMLDocument 对象的静态方法。
经过广泛的研究,出现了以下问题:
可以将 XMLDocument 对象传递给 XPathDocument 对象,以便在简单地从文档中读取数据而不是对其进行编辑时变得容易。
研究01
MSDN
请回复并让我知道这是否可能?如果是这样,怎么做?
干杯。
您如何从文档中读取数据?两者XmlDocument都有XPathDocument一个CreateNavigator返回XPathNavigator用于读取文档的方法。否则,只需将 a 流式传输XmlDocument到 aMemoryStream并XPathDocument从中创建。
XmlDocument
XPathDocument
CreateNavigator
XPathNavigator
MemoryStream