I have great use for NoChildren() though its behavior seems strange to me. I would think it would return false is the FirstChild() is of type TEXT though this is no the case. A simple change would be in order to fix this:
bool NoChildren() const {
if (firstChild) {
if (firstChild->Type() == TiXmlNode::TEXT) { return true; } else { return !firstChild; }
} else {
return !firstChild;
}
}
The above change just needs to be made in tinyxml.h around line 700.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
TinyXML sees Text nodes as "normal" nodes. It's an artifact of the original design...but changing it changes the whole design of TinyXML. It's one of those "just how it works" things for TinyXML.
lee
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have great use for NoChildren() though its behavior seems strange to me. I would think it would return false is the FirstChild() is of type TEXT though this is no the case. A simple change would be in order to fix this:
bool NoChildren() const {
if (firstChild) {
if (firstChild->Type() == TiXmlNode::TEXT) { return true; } else { return !firstChild; }
} else {
return !firstChild;
}
}
The above change just needs to be made in tinyxml.h around line 700.
TinyXML sees Text nodes as "normal" nodes. It's an artifact of the original design...but changing it changes the whole design of TinyXML. It's one of those "just how it works" things for TinyXML.
lee