如何检查XML文件是否有处理指令
How to check whether an Xml file have processing Instruction
示例
<?xml-stylesheet type="text/xsl" href="Sample.xsl"?>
<Root>
<Child/>
</Root>
我需要阅读的处理指令
I need to read the processing instruction
<?xml-stylesheet type="text/xsl" href="Sample.xsl"?>
从XML文件中。
from the XML file.
请帮我做这件事。
怎么样:
XmlProcessingInstruction instruction = doc.SelectSingleNode("processing-instruction('xml-stylesheet')") as XmlProcessingInstruction;