2

Looking for something that can take an xml file and turn it into a struct like this.

typedef struct XMLpage{
    string type;
    string names[];
    string text;
    int Pos;

    struct XMLpage *Pages[];
}; XMLpage

Basically i have a page that could contain other pages that could contain other pages and the plan was to have it read from an xml file and output it as a struct to be used later in someway.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
  • You may want to consider http://stackoverflow.com/questions/8802208/jaxb-equivalent-for-generating-c-classes-from-xsd –  Feb 05 '13 at 13:38

2 Answers2

0

I used to use xerces and use SAX, DOM Parsers provided by it, parse and store it in Class/Struct.

Satish
  • 713
  • 1
  • 5
  • 18
0

Take a look at TinyXML, I've used this library a lot and I'm heavily satisfied. It's reading the XML into a convenient object structure which you can easily read/manipulate.

You'll have to write some simple code for putting the data in your struct, but it is well worth it.

DarkWanderer
  • 8,739
  • 1
  • 25
  • 56