added whitespace=collapse support. tests work. code needs review
This commit is contained in:
19
xmltest.cpp
19
xmltest.cpp
@@ -938,6 +938,25 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||
XMLTest( "QueryBoolText", boolValue, true, false );
|
||||
}
|
||||
|
||||
// ----------- Whitespace ------------
|
||||
{
|
||||
const char* xml = "<element>"
|
||||
"<a> This \nis ' text ' </a>"
|
||||
"<b> This is ' text ' \n</b>"
|
||||
"<c>This is ' \n\n text '</c>"
|
||||
"</element>";
|
||||
XMLDocument doc( true, COLLAPSE_WHITESPACE );
|
||||
doc.Parse( xml );
|
||||
|
||||
const XMLElement* element = doc.FirstChildElement();
|
||||
for( const XMLElement* parent = element->FirstChildElement();
|
||||
parent;
|
||||
parent = parent->NextSiblingElement() )
|
||||
{
|
||||
XMLTest( "Whitespace collapse", "This is ' text '", parent->GetText() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ----------- Performance tracking --------------
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user