diff --git a/nmap.cc b/nmap.cc index a5be648f1..c61cf2037 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1748,7 +1748,6 @@ int nmap_main(int argc, char *argv[]) { chomp(mytime); char *xslfname = o.XSLStyleSheet(); xml_start_document(); - log_write(LOG_XML, "\n", NMAP_XMLOUTPUTVERSION); if (xslfname) { xml_open_pi("xml-stylesheet"); xml_attribute("href", "%s", xslfname); diff --git a/xml.cc b/xml.cc index 26c9725f4..27997bc5a 100644 --- a/xml.cc +++ b/xml.cc @@ -320,6 +320,8 @@ int xml_start_document() { if (xml_newline() < 0) return -1; + log_write(LOG_XML, "\n", NMAP_XMLOUTPUTVERSION); + return 0; }