Question

I have a XML file

<resources>
  <string name="aaa">Hotel</string>
  <string name="bbb">Home</string>
  <string name="ccc">Castle</string>
  ...
<resourses>

I tried got content string (Hotel or Home ...) in using special name of this (aaa, bbb ..).

Was it helpful?

Solution

var xml = XDocument.Parse(yourxmlstring, LoadOptions.None);
var resources= xml.Descendants("resources");
foreach (var resourceElement in resources.Descendants("Hotel"))
{
    MessageBox.Show(resourceElement.Attribute("name").Value);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top