-4

I have a xml file that looks like this

 <?xml version="1.0" standalone="yes"?>
    <Ribbon>
      <Tab Text="Tab1">
        <Grupi Text="Grupi1">
          <Buttoni Moduli="Appdec.Simea.Modulet.DepartamentetM.dll" />
        </Grupi>
        <Grupi Text="Grupi2" />
      </Tab>
      <Tab Text="Tab2">
        <Grupi Text="Grupi1">
          <Buttoni Moduli="Appdec.Simea.Modulet.DhomatM.dll" />
        </Grupi>
        <Grupi Text="Grupi2">
          <Buttoni Moduli="Appdec.Simea.Modulet.KategoriteEArtikujveM.dll" />
          <Buttoni Moduli="Appdec.Simea.Modulet.KategoriteEArtikujveM.dll" />
        </Grupi>
      </Tab>
    </Ribbon>

How to iterate throught each element and print the value

Matthew Strawbridge
  • 19,940
  • 10
  • 72
  • 93
ademg
  • 197
  • 2
  • 4
  • 17

1 Answers1

1

The top sample in this article, Accessing Attributes in the DOM, shows how to retrieve the attributes and their values for an XML snippet containing only one Element. If you combine that with the ChildNodes property of the XmlElement class, you could iterate first through all the elements and then through all the attributes of each element.

Hans Olsson
  • 54,199
  • 15
  • 94
  • 116