Nmap Development mailing list archives

Re: [PATCH] No direct XML in nmap.cc


From: David Fifield <david () bamsoftware com>
Date: Thu, 31 Jul 2014 07:50:55 -0700

On Thu, Jul 31, 2014 at 04:16:46PM +0200, Michal Hrusecky wrote:
Hi,

I've been looking at customizing nmaps output and thus looking primarily
at how XML output works. While there are many changes that I can do to
get what I need, I found a particular change that I believe can be
accepted in general. In nmap.cc, there is a line that puts hardcoded
string to the XML output directly, bypassing usage of XML library.  I
think it would be much nicer to put it in the XML library and keep
nmap.cc from writing XML directly. See patch attached.

Thanks for the patch. I kind of disagree with it though. Now the XML
library isn't general-purpose anymore; xml_start_document can't be used
for anything but Nmap XML files.

Maybe it's better to make a new xml_doctype_public(root, pubid, uri)
function, that outputs the DTD in a general way.
http://www.w3.org/TR/REC-xml/#dt-doctype
http://www.w3.org/TR/REC-xml/#dt-extent

Or even make a new nmap_xml_start_document function that wraps
xml_start_document. But xml.cc should remain general-purpose.

David Fifield
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: