1
1
forked from 0ad/0ad

Skip standalone document declaration in generated XML, since it's pointless.

Unrelated to this checkin, fixed #194.

This was SVN commit r5884.
This commit is contained in:
Ykkrosh 2008-04-15 13:45:17 +00:00
parent 7d82d87ce8
commit 00cdb335c6
3 changed files with 12 additions and 12 deletions

View File

@ -59,7 +59,7 @@ XMLWriter_File::XMLWriter_File()
// Encoding is always UTF-8 - that's one of the only two guaranteed to be
// supported by XML parsers (along with UTF-16), and there's not much need
// to let people choose another.
m_Data = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
m_Data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
}
bool XMLWriter_File::StoreVFS(const char* filename)

View File

@ -50,7 +50,7 @@ end of XMLWriter.cpp.
*/
// Encoding should usually be "utf-8" (or "iso-8859-1" to limit it to ASCII).
// Starts generating a new XML file.
#define XML_Start() XMLWriter_File xml_file_
// Set pretty printing (newlines, tabs). Defaults to true.
@ -62,7 +62,7 @@ end of XMLWriter.cpp.
// Start a new element: <name ...>
#define XML_Element(name) XMLWriter_Element xml_element_ (xml_file_, name)
// Add text to the interior of the current element: ...>text</...>
// Add text to the interior of the current element: <...>text</...>
#define XML_Text(text) xml_element_.Text(text)
// Add an attribute to the current element: <... name="value" ...>

View File

@ -53,7 +53,7 @@ public:
CStr output = XML_GetOutput();
TS_ASSERT_STR_EQUALS(output,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"\n"
"<Root>\n"
"\t<!-- Comment test. -->\n"
@ -89,7 +89,7 @@ public:
CStr output = XML_GetOutput();
TS_ASSERT_STR_EQUALS(output,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"\n"
"<Test>\n"
"\t<example>\n"
@ -117,7 +117,7 @@ public:
CStr output = XML_GetOutput();
TS_ASSERT_STR_EQUALS(output,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<Test><example><content>text</content></example></Test>"
);
}
@ -134,7 +134,7 @@ public:
CStr output = XML_GetOutput();
TS_ASSERT_STR_EQUALS(output,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"\n"
"<Test>ab</Test>"
);
@ -155,7 +155,7 @@ public:
CStr output = XML_GetOutput();
TS_ASSERT_STR_EQUALS(output,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\n"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"
"<Test>\xC9\x91</Test>"
);
}
@ -171,7 +171,7 @@ public:
CStr output = XML_GetOutput();
TS_ASSERT_STR_EQUALS(output,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\n"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"
"<Test example=\"abc > ]]> &lt; &amp; &quot;&quot; \"/>"
);
}
@ -187,7 +187,7 @@ public:
CStr output = XML_GetOutput();
TS_ASSERT_STR_EQUALS(output,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\n"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"
"<Test>abc > ]]&gt; &lt; &amp; \"\" </Test>"
);
}
@ -203,7 +203,7 @@ public:
CStr output = XML_GetOutput();
TS_ASSERT_STR_EQUALS(output,
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\n"
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"
"<Test>\n"
"\t<!-- test - \xE2\x80\x90\xE2\x80\x90 \xE2\x80\x90\xE2\x80\x90- \xE2\x80\x90\xE2\x80\x90\xE2\x80\x90\xE2\x80\x90 test -->\n"
"</Test>"