SetForceCompactMode() now also handles case of a single tag inside another correctly.

This commit is contained in:
Uli Kusterer
2014-02-01 13:35:05 +01:00
parent 15354f88c3
commit ca412e87f2
3 changed files with 21 additions and 6 deletions

View File

@@ -1039,6 +1039,21 @@ int main( int argc, const char ** argv )
XMLTest( "Selective text wrapping", "<root>\n <text>Before <tag>Tag</tag><tagtwo two=\"2\">TagTwo</tagtwo> After</text>\n</root>\n", printer.CStr() );
}
{
XMLDocument doc0;
XMLElement* root = doc0.NewElement("root");
doc0.InsertEndChild(root);
XMLElement* cool = doc0.NewElement("cool");
cool->SetForceCompactMode(true);
root->InsertEndChild(cool);
XMLElement* tag = doc0.NewElement("true");
cool->InsertEndChild(tag);
XMLPrinter printer;
doc0.Print( &printer );
XMLTest( "Selective text around single tag", "<root>\n <cool><true/></cool>\n</root>\n", printer.CStr() );
}
{
// Make sure an attribute with a space in it succeeds.
static const char* xml0 = "<element attribute1= \"Test Attribute\"/>";