diff --git a/nmap.cc b/nmap.cc index b73dfb4f5..24ef5149e 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1737,7 +1737,7 @@ int nmap_main(int argc, char *argv[]) { Strncpy(mytime, ctime(&timep), sizeof(mytime)); chomp(mytime); char *xslfname = o.XSLStyleSheet(); - xml_start_document(); + xml_start_document("nmaprun"); if (xslfname) { xml_open_pi("xml-stylesheet"); xml_attribute("href", "%s", xslfname); diff --git a/xml.cc b/xml.cc index e75287031..d391171c2 100644 --- a/xml.cc +++ b/xml.cc @@ -308,8 +308,10 @@ int xml_write_escaped_v(const char *fmt, va_list va) { return 0; } -/* Write the XML declaration: . */ -int xml_start_document() { +/* Write the XML declaration: + * and the DOCTYPE declaration: + */ +int xml_start_document(const char *rootnode) { if (xml_open_pi("xml") < 0) return -1; if (xml_attribute("version", "1.0") < 0) @@ -319,7 +321,7 @@ int xml_start_document() { if (xml_newline() < 0) return -1; - log_write(LOG_XML, "\n", NMAP_XMLOUTPUTVERSION); + log_write(LOG_XML, "\n", rootnode); return 0; } diff --git a/xml.h b/xml.h index a473d5efe..568daca57 100644 --- a/xml.h +++ b/xml.h @@ -129,7 +129,7 @@ int xml_write_raw(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); int xml_write_escaped(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); int xml_write_escaped_v(const char *fmt, va_list va) __attribute__ ((format (printf, 1, 0))); -int xml_start_document(); +int xml_start_document(const char *rootnode); int xml_start_comment(); int xml_end_comment();