diff --git a/samples/DOMPrint/DOMPrint.cpp b/samples/DOMPrint/DOMPrint.cpp index 1e7c67026de84f1dc566bceeddd9e3aeb9a5523b..57fed80b8b7c30c156c1e55f42499a87cd98a8cd 100644 --- a/samples/DOMPrint/DOMPrint.cpp +++ b/samples/DOMPrint/DOMPrint.cpp @@ -650,17 +650,27 @@ ostream& operator<<(ostream& target, DOM_Node& toWrite) *gFormatter << XMLFormatter::NoEscapes << gStartDoctype << nodeName; + DOMString id = doctype.getPublicId(); - if (id != 0) + { *gFormatter << XMLFormatter::NoEscapes << chSpace << gPublic - << id << chDoubleQuote; - - id = doctype.getSystemId(); - if (id != 0) + << id << chDoubleQuote; + id = doctype.getSystemId(); + if (id != 0) + { + *gFormatter << XMLFormatter::NoEscapes << chSpace + << chDoubleQuote << id << chDoubleQuote; + } + } + else { - *gFormatter << XMLFormatter::NoEscapes << chSpace << gSystem - << id << chDoubleQuote; + id = doctype.getSystemId(); + if (id != 0) + { + *gFormatter << XMLFormatter::NoEscapes << chSpace << gSystem + << id << chDoubleQuote; + } } id = doctype.getInternalSubset();