Hi can anybody help me out. I have a XML which contains my own namespace xmlns:NS . I need to select all the nodes which contains the namespace "NS". How can we do this using C#.net.
I tried like below:
XmlDocument doc=new XmlDocument();
doc.Load(Path);
XmlNodeList oNodeList=doc.GetElementByTagname("NS:Text");
Here i am getting all the nodes which have "NS:Text" namespace. But I need to select all the nodes like below:
XmlDocument doc=new XmlDocument();
doc.Load(Path);
XmlNodeList oNodeList=doc.GetElementByTagname("NS");
so that i can select all the nodes which contains namespace "NS". but this is not working. How can we achieve this?
Following is my XML format.
<xml 1.0 ?>
<Root xmlns:NS="www.yembi.com">
<NS:Entry Value="User">
<table>
<tr>
<td>
<NS:display type="Label" name="First Name">
</td>
</tr>
<tr>
<td>
<NS:Text type="Text">
</td>
</tr>
<tr>
<td>
<NS:Button Type="SubmitButton" name="submit">
</td>
</tr>
</table>
</NS:Entry>