- if (indentstep >= 0 && prev && prev->GetType() != wxXML_TEXT_NODE)
- OutputIndentation(stream, indent);
- OutputString(stream, wxT("</"));
- OutputString(stream, node->GetName());
- OutputString(stream, wxT(">"));
+
+ if ( rc && indentstep >= 0 &&
+ prev && prev->GetType() != wxXML_TEXT_NODE )
+ {
+ rc = OutputIndentation(stream, indent, convMem, convFile);
+ }
+
+ if ( rc )
+ {
+ rc = OutputString(stream, wxS("</"), convMem, convFile) &&
+ OutputString(stream, node->GetName(),
+ convMem, convFile) &&
+ OutputString(stream, wxS(">"), convMem, convFile);
+ }
+ }
+ else // no children, output "<foo/>"
+ {
+ rc = OutputString(stream, wxS("/>"), convMem, convFile);