Select all the nodes which have namespace in XML using C#

xtoths

New Member
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:\[code\]XmlDocument doc=new XmlDocument();doc.Load(Path);XmlNodeList oNodeList=doc.GetElementByTagname("NS:Text");\[/code\]Here i am getting all the nodes which have "NS:Text" namespace. But I need to select all the nodes like below:\[code\]XmlDocument doc=new XmlDocument();doc.Load(Path);XmlNodeList oNodeList=doc.GetElementByTagname("NS");\[/code\]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.\[code\]<xml 1.0 ?> <Root xmlns:NS="www.yembi.com"> <NS:Entry Value="http://stackoverflow.com/questions/11289507/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>\[/code\]
 
Back
Top