- return OutputString(stream,
- wxString::Format
- (
- wxS("<?xml version=\"%s\" encoding=\"%s\"?>\n"),
- GetVersion(), GetFileEncoding()
- ),
- convMem.get(),
- convFile.get()) &&
- OutputNode(stream, GetRoot(), 0,
- convMem.get(), convFile.get(), indentstep) &&
- OutputString(stream, wxS("\n"), convMem.get(), convFile.get());
+ wxString dec = wxString::Format(
+ wxS("<?xml version=\"%s\" encoding=\"%s\"?>\n"),
+ GetVersion(), GetFileEncoding()
+ );
+ bool rc = OutputString(stream, dec, convMem.get(), convFile.get());
+
+ wxXmlNode *node = GetDocumentNode();
+ if ( node )
+ node = node->GetChildren();
+
+ while( rc && node )
+ {
+ rc = OutputNode(stream, node, 0, convMem.get(),
+ convFile.get(), indentstep) &&
+ OutputString(stream, wxS("\n"), convMem.get(), convFile.get());
+ node = node->GetNext();
+ }
+ return rc;
+}
+
+/*static*/ wxVersionInfo wxXmlDocument::GetLibraryVersionInfo()
+{
+ return wxVersionInfo("expat",
+ XML_MAJOR_VERSION,
+ XML_MINOR_VERSION,
+ XML_MICRO_VERSION);