How to search a node in XML?
-
Hi! I am using C#, i want to search a node in XML file having a given Attribute. the structure of XML file is not known, i.e. we dont know that how many nodes are there and each node conatins how many child nodes. following is a sample of the structure of XML file. I want to traverse all nodes of file and return the "Name" attribute of the node if it matches with the user defined string. I tried to do it with recursion but could not handle it. Please tell me how to do it. Thanks in advance.. Regards, Affan Ahmad Toor
-
Hi! I am using C#, i want to search a node in XML file having a given Attribute. the structure of XML file is not known, i.e. we dont know that how many nodes are there and each node conatins how many child nodes. following is a sample of the structure of XML file. I want to traverse all nodes of file and return the "Name" attribute of the node if it matches with the user defined string. I tried to do it with recursion but could not handle it. Please tell me how to do it. Thanks in advance.. Regards, Affan Ahmad Toor
Affan Toor wrote:
could not handle it
What does that mean? Show us the code you got so far.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook