I am updating code that uses the legacy TinyXml library, to use new TinyXML-2 version instead.
While editing, I noticed that the function TiXmlNode::FirstChild(const char *)
has no direct replacement in TinyXML-2.
My questions are:
- Is there a convenient replacement for the aforementioned function that I missed?
- In case there isn't, how should the example code below be updated for TinyXML-2?
// TiXmlElement *element; // assume this was correctly loaded
TiXmlNode *node;
if ((node = element->FirstChild("example")) != nullptr)
{
for (TiXmlElement *walk = node->FirstChildElement();
walk != nullptr;
walk = walk->NextSiblingElement())
{
// ...
}
}