I have string simillar to
xmlDataEntAddAttr = @"<ADDITIONAL INFO>
<Host> Test Host Name </Host>
<IP Address>Test IP Address</IP Address>
<Domain>Test Domain</Domain>
<Host Method>Test Host Method</Host Method>
<Flag>Test Flag</Flag>
</ADDITIONAL INFO>";
How can i read this into a String list with tag names and Values in it or in any collection.
Please not the inner Tags like <Host></Host> can be any value only constant thing here is the root means <ADDITIONAL INFO></ADDITIONAL INFO>.
Please suggest any method to parse.
Use a
XDocument(in theSystem.Xml.Linqnamespace) and Linq to Xml.However, your string is not a valid XML. You can’t have whitespace in the XML element names. A valid version of you string is: