SetForceCompactMode() now also handles case of a single tag inside another correctly.
This commit is contained in:
15
xmltest.cpp
15
xmltest.cpp
@@ -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\"/>";
|
||||
|
||||
Reference in New Issue
Block a user