Which should be pretty straightforward, however XmlParser seems to be somewhat limited - at least, in terms of the functions we can access thus making the control very limited. Thing is, I’ve tried a lot of stuff, but maximum I can do, is for it to return the two tags, but never its children. Since there can be various children - and nested children as well - GetNextNode() is the way to go. However, this doesn’t seem to work properly as it always crashes the editor.
This way only finds the two tags:
if (rootNode->GetChildrenNodes().Num() > 0)
{
FXmlNode* childNode;
int i = 1;
for (auto child = rootNode->GetChildrenNodes().CreateConstIterator(); child; ++child)
{
childNode = *child;
if (!childNode)
continue;
if(GEngine)
GEngine->AddOnScreenDebugMessage(i, 2.0f, FColor::Red, childNode->GetTag());
i++;
}
}
This one - which should be better as it has GetNextNode(), just crashes the editor:
int i = 1;
for (const FXmlNode* node = rootNode->GetNextNode(); rootNode ; node = rootNode->GetNextNode())
{
if (GEngine)
GEngine->AddOnScreenDebugMessage(1, 2.0f, FColor::Red, node->GetTag());
i++;
// Sounds ridiculous but this would keep going up (i++) until infinity, had to include a manual stop for testing purposes, it seems XmlParser can't find the end of
// the XML Nodes and just keeps on moving eternally and not let the launcher get past beyond 72% loading
if (i > 80)
break;
}
From my understanding, that is the intended behaviour. rootNode matches the item. This node only has two children … and … which are the two ChildrenNodes you get from GetChildrenNodes(). In order to access the ChildrenNodes of the elements you’d need to get the children from these two nodes (which already are child nodes themselves). Something like this should list the elements (WARNING: the following hasn’t seen a compiler with the exception of the stuff copied from your post):