How to check whether an Xml file have processing Instruction
Example
<?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"?>
from the XML file.
Please help me to do this.
You can use
FirstChild
property ofXmlDocument
class andXmlProcessingInstruction
class:Parse
Value
orData
properties to get appropriate values.How about:
How about letting the compiler do more of the work for you: