Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, Consider this: "<highscore>You got a new high score!</highscore>" Why is getNodeName always the same as getNodeData? That is, for that example line I get 3 nodes: "highscore", "You got a new high score!" and "highscore" (the closing tag). Shouldn't it just give one node? With getNodeName as "highscore" and getNodeData as "You got a new high score!"? Because the contents are really associated with the container tag names... I tried to hack around this by saving the last EXN_ELEMENT name, then on each EXN_TEXT I can do: case EXN_TEXT: if (lastElement == "highscore") highScoreText = xml->getNodeData(); But the problem with this is empty lines (not inside tags) and whitespace seem to appear as nodes. So often after setting "highScoreText" to the correct value, lastElement will not have changed by the times some whitespace appears, and "highScoreText" will be set incorrectly to this whitespace. Thanks |
||||
|
getNodeData is used for text nodes and getNodeName for element nodes. Because getNodeData() would not make sense for elements and getNodeNames not for text nodes, instead of returning an error, this is returned. But if you say empty lines not inside tags appear as nodes, than this is a bug, but I've never discovered this one. Could you post a file as examlpe? |
||||
|
I should have mentioned I am using the version of irrxml with irrlicht 1.3. With this XML (saved with wordpad as unicode text document) <?xml version="1.0" encoding="UTF-16"?> And using this code: while (xml->read()) I get this output: Node contents: [] Thanks! I'm getting around this by not using the node if it starts with '13'. So if it is a bug it's not urgent. |
||||
|
AnAJTW Hi! Nice site! Where is a add to favorite button& ;) |
|