How can I iterate though each child node in an XML file?

后端 未结 7 907
说谎
说谎 2021-01-04 00:49

I have an XML File and i would like to iterate though each child node gathering information.

Here is my C# code it only picks up one node, the FieldData i would like

7条回答
  •  轮回少年
    2021-01-04 01:35

    Just touching on @Waynes answer, which worked well. I used the below code to push further into the child nodes in my xml

    foreach (var child in doc.Element("rootnodename").Element("nextchildnode").Elements()) 
    
    {
    
     //do work here, probs async download xml content to file on local disc
    
    } 
    

提交回复
热议问题