Hi anyone know of a C++ class capable of parsing a XML stream in to
elements?
I have tried using the xerces class but unfortunately this requires me
to do a lot of complex processing to isolate the elements and their
attributes and content which I do not want to do.
I want a class that will parse the XML stream and then allow me to
iterate the elements recursively, similar to this
void iterateElements (element)
{
for (element.attrib utes)
{
attributePair = element.nextAtt ribute();
// do some processing on the attribute pair
}
elementPair = element.getCont entPair();
// do some processing on the element content
for (element.elemen ts)
{
iterateElements (element.nextEl ement()); // recursively call
this function
}
}
So I would get a key/data pair for each element and for each element
attribute.
Here's hoping :)
elements?
I have tried using the xerces class but unfortunately this requires me
to do a lot of complex processing to isolate the elements and their
attributes and content which I do not want to do.
I want a class that will parse the XML stream and then allow me to
iterate the elements recursively, similar to this
void iterateElements (element)
{
for (element.attrib utes)
{
attributePair = element.nextAtt ribute();
// do some processing on the attribute pair
}
elementPair = element.getCont entPair();
// do some processing on the element content
for (element.elemen ts)
{
iterateElements (element.nextEl ement()); // recursively call
this function
}
}
So I would get a key/data pair for each element and for each element
attribute.
Here's hoping :)
Comment