Hey Icewing, I had to do something similar for my project. What I did was to
create a struct for an XML Element.
// Represent an attribute of an XML element
typedef struct {
char *name;
char *type;
char *value;
} ElementAttribute;
typedef vector<ElementAttribute> ElementsAttrib;
// Represent an XML Element Parsed
typedef struct {
ElementsAttrib attributes;
string content;
string name;
} ElementXML;
Then inside the startElement() I had
// copy element's attributes into local data structure
for(int i = 0; i < attributes.getLength(); i++)
{
ElementAttribute attrib;
attrib.name = XMLString::transcode(attributes.getName(i));
attrib.type = XMLString::transcode(attributes.getType(i));
attrib.value = XMLString::transcode(attributes.getValue(i));
elemEntry.attributes.push_back(attrib); // elemEntry is a
ElementXML struct
}
Hope this helps you.
- Keno -
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]