-1

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 ..).

Christoph Fink
  • 22,727
  • 9
  • 68
  • 113
ALuc
  • 3
  • 2
  • 3
    What have you already tried? What where your problems/errors? – Christoph Fink Apr 28 '14 at 08:58
  • 1
    And what has nsxmlparser got to do with this? – Jon Skeet Apr 28 '14 at 08:59
  • Will give you everything: (See the 1st answer) http://stackoverflow.com/questions/13588868/parsing-xml-using-c-sharp-and-windows-phone-7 – pxm Apr 28 '14 at 09:01
  • sorry. I'm a starter programing. I work follow that: http://stackoverflow.com/questions/3750678/getting-attribute-value-of-an-xml-document-using-c-sharp – ALuc Apr 28 '14 at 09:05

1 Answers1

2
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);
}
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396