XML to nested repeater control ASP.net

533 Views Asked by At

I followed this simple tutorial and created a nested repeater. This tutorial is simple enough so i could easily create something like that.

But I have different XML structure in my organisation which i can't change. My XML structure is repeated structure of this.

    <pupil>
    <academicYear>2011/2010</academicYear>
    <grade>Kindergarten 1</grade>
    <class>class 1</class>    
    <name>emma</name>
    <admissionDate>01/05/2010</admissionDate>
    <language>English</language>
    <CountryofBirth>United Kingdom</CountryofBirth>
    <fullName>emma watson</fullName>
    </pupil>

I would like to see academicYear, grade, class, name, admissiondate, etc As Titles. And below each title, there should be coresponding data about it.

Eg.

    *Academic Year
      -2011/2010
      -2010/2009
    *Grade
      -kingdergarten1
      -kingdergarten2
      -kingdergarten3

I don't post all my code again coz it's same as in this tutorial. Please don't tell me why don't u go and ask the guy who made that tutorial. I found people here are very nice and always helpful. Thanks so much.

1

There are 1 best solutions below

1
On BEST ANSWER

Having looked at the tutorial and your XML, the big difference between your XML and the example given on the tutorial is that yours isn't nested XML.

I'd also dispute your assertion that you cannot change the XML structure. Sure, you might not be able to change what you get from the service that is providing you with the XML, but there is no reason why you couldn't reorganise the XML you are receiving into a nested XML document that is more compliant with your intentions.