I have an xml file, what I am trying to do is to parse the complete file and search for a specific xml tag (in my case I am searching for queryString
) and when the tag is encountered pull out the inner text corresponding to it. I am using XmlDocument
and using XmlDocument.SelectNodes("/stringList")
.
While doing so a null
value is being returned. Am I missing out on something?
XmlDocument xml = new XmlDocument();
Jrxml.Load(file_path);
XmlNodeList xml_nodes = xml.SelectNodes("/stringList");
foreach (XmlNode jr_node in xml_nodes)
{
XmlNode query_node = jr_node.SelectSingleNode("queryString");
}
While execution it does not enter the for loop as xml_nodes
value is null
Xml File looks like this.
<stringList>
<property1/>
<property2/>
<style>
<queryString>
</queryString>
</style>
<queryString>
</queryString>
</stringList>