0

i am having a xml file like this

<ward>  <pods>
<name>Pod A</name>
<direction>North</direction>
<beds>
  <id>a1</id>
  <id>a2</id>
  <id>a3</id>
  <id>a4</id>
  <id>a5</id>
</beds>   </pods>  <pods>
<name>Pod B</name>
<direction>North</direction>
<beds>
  <id>b1</id>
  <id>b2</id>
  <id>b3</id>
  <id>b4</id>
  <id>b5</id>
</beds>   </pods> </ward>

i am trying to put the names as column header and beds-> id as their children, i am not at all having a clue to do this, any help?

sansknwoledge
  • 4,209
  • 9
  • 38
  • 61

1 Answers1

3

Try out this and see what exactly you will have:

DataSet dataSet = new DataSet();
dataSet.ReadXml("Data.xml");
repeater.DataSource = dataSet;
repeater.DataBind();

If something displayed wrong - you can manually restructure it traversing dataSet.Tables (I believe you can't change XML structure)

Brendan
  • 868
  • 1
  • 16
  • 38
sll
  • 61,540
  • 22
  • 104
  • 156