如何查看一个xml文件是否有处理指令
例子
<?xml-stylesheet type="text/xsl" href="Sample.xsl"?>
<Root>
<Child/>
</Root>
我需要阅读处理指令
<?xml-stylesheet type="text/xsl" href="Sample.xsl"?>
来自 XML 文件。
请帮我做这件事。
最佳答案
怎么样:
XmlProcessingInstruction instruction = doc.SelectSingleNode("processing-instruction('xml-stylesheet')") as XmlProcessingInstruction;
关于c# - 如何使用 .NET 3.5 从 XML 文件中读取处理指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3100345/