There is an XML of the form:

<result name="response" numFound="252> <doc score="1"> <field name="content"> ...123... </field> </doc> <doc score="2"> <field name="content"> ...123... </field> </doc> 

Tell me, please, how to read the hml by nodes (... 123 ...) and write each node to a separate RichTextBox ! Hpas tried that does not work !!!

    1 answer 1

    You can consider the nodes of interest from the document as LINQ into the array, and then use the values ​​from the array to set the text in the RichTextBox. Extracting values ​​to an array:

     XElement result = XElement.Load(@"result.xml"); string[] fields = result .Descendants("field") .Select(f => f.Value) .ToArray(); 
    • What I honestly did not understand !!! If it is not difficult it is possible more! - IGOR
    • LINQ to Xml . - AlexeyM