Hey everyone! Tiny XML has been great so far but I'm having what I feel like is a really basic problem but it's been stumping me pretty bad... What I need to do is just take input from Cin and put it into the TiXmlElement and TiXmlText classes. I can't seem to get it so that I can take in something in a reasonable format that will also preserve any spaces I have.
I want to be able to input things like "Tem Village" or a small paragraph of text between my tags, and it's only reading in the first element. I've tried doing things like this:
Tried running the TiXmlBase::SetCondenseWhiteSpace(false); method with no results.. Please help! This is very important to what I'm working on and any help would be greatly apprecaited!
-Terra
Last edit: Terra Ray 2015-12-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Been banging my head on it for a few hours... Tried the c_str method to try and convert a string to a const char * once I have it but it still only copies the first word of my input into the XML document...
If anyone has done this before I could really use your help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Been banging my head on it for a few hours... Tried the c_str method to
try and convert a string to a const char * once I have it but it still only
copies the first word of my input into the XML document...
If anyone has done this before I could really use your help!
Ha ha yeah I realized that last night... I feel like an idiot for not using GetLine but now I am and everything is fine! If only I could fix my damn segmentation faults! Thank you though!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey everyone! Tiny XML has been great so far but I'm having what I feel like is a really basic problem but it's been stumping me pretty bad... What I need to do is just take input from Cin and put it into the TiXmlElement and TiXmlText classes. I can't seem to get it so that I can take in something in a reasonable format that will also preserve any spaces I have.
I want to be able to input things like "Tem Village" or a small paragraph of text between my tags, and it's only reading in the first element. I've tried doing things like this:
Tried running the TiXmlBase::SetCondenseWhiteSpace(false); method with no results.. Please help! This is very important to what I'm working on and any help would be greatly apprecaited!
-Terra
Last edit: Terra Ray 2015-12-22
Been banging my head on it for a few hours... Tried the c_str method to try and convert a string to a const char * once I have it but it still only copies the first word of my input into the XML document...
If anyone has done this before I could really use your help!
It seems to me this isn't a TinyXml problem.
If you want to read a paragraph of text you'll need something more than
what you've typed with
cin
.And once you have a paragraph, if you want to keep text with newlines and
spaces you'll need to use a CDATA block:
http://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean
On 22 December 2015 at 12:57, Terra Ray xaidenshouni@users.sf.net wrote:
It seems to me this isn't a TinyXml problem.
To read a paragraph of text you'll need something more than what you've listed with
cin
.And once you have a paragraph of text, if you want to keep text with newlines and spaces you'll need to use a CDATA block:
http://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean
Relevant TinyXml class: http://www.grinninglizard.com/tinyxmldocs/classTiXmlText.html
Ha ha yeah I realized that last night... I feel like an idiot for not using GetLine but now I am and everything is fine! If only I could fix my damn segmentation faults! Thank you though!