Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, I've searched in all the forums for some clues to help me but i have not found something. I'm a little bit lost with the xml parser. Here's a little xml test file i've wrote :
Here's the code to read the file :
The result is : Bonzo How are you today? As you can see, it reads only the last "dialog" element. I'm doing it that way because i want to collect each line in an array. So, can i retrieve each line ? Thank you in advance for your patience, and sorry for faults. Byebye, |
||||
|
Because that's what you are doing in the code :) To print out each line, print it or store it for example where you call getNodeData. |
||||
|
Hello, Thank you for your answer ! I've changed my code, and i've tried to follow your recommendation. Something is sure, i still don't understand how it works :D . Here's the code :
Here's the result : dialog[0] : How are you today? dialog[1] : Let me know, i'm doing the same mistake. I'm sorry, i'm certainly hopeless lol. In any case, thank you for your time and for Irrlicht :B. Bye, |
||||
|
Maybe it would help using instead of this line if(ReadPtr->getNodeData(), i < 2) this one: if(ReadPtr->getNodeData() && i < 2) But it's just a guess :) |
||||
|
Hello, This doesn't change anything. I'll remake an investigation later. Thank you for your answer and your time ;) Cheers ! Bye, |
||||
|
You are resetting i to 0 so it keeps overwriting dialog[0]. |
||||
|
Ok, i see ::) thank you ! |
|