I am saving a character to be the delimiter for csv files (comma or tab). TinyXML is writing the tab character like this:
<Delimiter>	</Delimiter>
but when it is read back in, the text is thrown away in this section of TiXmlElement::ReadValue at line 1155 in tinyxmlparser (from version 2.4.2, unpatched):
if ( TiXmlBase::IsWhiteSpaceCondensed() )
{
p = textNode->Parse( p, data, encoding );
}
else
{
// Special case: we want to keep the white space
// so that leading spaces aren't removed.
p = textNode->Parse( pWithWhiteSpace, data, encoding );
}
if ( !textNode->Blank() )
LinkEndChild( textNode );
else
delete textNode;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am saving a character to be the delimiter for csv files (comma or tab). TinyXML is writing the tab character like this:
<Delimiter>	</Delimiter>
but when it is read back in, the text is thrown away in this section of TiXmlElement::ReadValue at line 1155 in tinyxmlparser (from version 2.4.2, unpatched)(yes, IsWhiteSpaceCondensed is false):
if ( TiXmlBase::IsWhiteSpaceCondensed() )
{
p = textNode->Parse( p, data, encoding );
}
else
{
// Special case: we want to keep the white space
// so that leading spaces aren't removed.
p = textNode->Parse( pWithWhiteSpace, data, encoding );
}
if ( !textNode->Blank() )
LinkEndChild( textNode );
else
delete textNode;
The entity is properly parsed into a std::string of length one, contents 0x10, as it should be. However 'textNode->Blank()' tests true and the node is thrown away. I'm guessing this is a bug, and not correct XML, but I'm not sure.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
TinyXML in its default mode throws away white space. (Getting white space parsing consistent with the XML spec is fairly high on my todo, but for now it works more like HTML.) You may be able to work around your problem by setting CondenseWhiteSpace to 'false'.
lee
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am saving a character to be the delimiter for csv files (comma or tab). TinyXML is writing the tab character like this:
<Delimiter>	</Delimiter>
but when it is read back in, the text is thrown away in this section of TiXmlElement::ReadValue at line 1155 in tinyxmlparser (from version 2.4.2, unpatched):
if ( TiXmlBase::IsWhiteSpaceCondensed() )
{
p = textNode->Parse( p, data, encoding );
}
else
{
// Special case: we want to keep the white space
// so that leading spaces aren't removed.
p = textNode->Parse( pWithWhiteSpace, data, encoding );
}
if ( !textNode->Blank() )
LinkEndChild( textNode );
else
delete textNode;
repost with the part truncated accidentally:
I am saving a character to be the delimiter for csv files (comma or tab). TinyXML is writing the tab character like this:
<Delimiter>	</Delimiter>
but when it is read back in, the text is thrown away in this section of TiXmlElement::ReadValue at line 1155 in tinyxmlparser (from version 2.4.2, unpatched)(yes, IsWhiteSpaceCondensed is false):
if ( TiXmlBase::IsWhiteSpaceCondensed() )
{
p = textNode->Parse( p, data, encoding );
}
else
{
// Special case: we want to keep the white space
// so that leading spaces aren't removed.
p = textNode->Parse( pWithWhiteSpace, data, encoding );
}
if ( !textNode->Blank() )
LinkEndChild( textNode );
else
delete textNode;
The entity is properly parsed into a std::string of length one, contents 0x10, as it should be. However 'textNode->Blank()' tests true and the node is thrown away. I'm guessing this is a bug, and not correct XML, but I'm not sure.
TinyXML in its default mode throws away white space. (Getting white space parsing consistent with the XML spec is fairly high on my todo, but for now it works more like HTML.) You may be able to work around your problem by setting CondenseWhiteSpace to 'false'.
lee