Nmap Development mailing list archives

[PATCH] Add --dtd and --webdtd for <!DOCTYPE ...> with -oX


From: "Brandon Enright" <bmenrigh () ucsd edu>
Date: Tue, 23 Jan 2007 01:47:46 -0000 (UTC)

Attached is a patch against Subversion that adds '--dtd' and
'--webdtd' options to allow Nmap to print the <!DOCTYPE nmaprun SYSTEM
"..."> element for validating parsers to use.

Rather than change existing -oX output and possibly break some
parsers, the default is still not to print the <!DOCTYPE ...> element.
 If '--dtd <path>' is used, XML output will contain a reference to the
DTD specified in <path>.  I've also added the short-hand '--webdtd'
which outputs <!DOCTYPE nmaprun SYSTEM
"http://insecure.org/nmap/data/nmap.dtd";>.

Since some validating parsers complain if the encoding of the XML file
is not specified I've set the encoding to 'UTF-8' with: <?xml
version="1.0" encoding="UTF-8" ?>.  UTF-8 should always work with the
existing format but just in case, it is only set if either '--dtd' or
'--webdtd' are used.

This patch includes changes against nmap-man.xml which isn't included
with Nmap by default (I think it it should be though).  For the
purposes of this patch I dropped the file in the doc/ directory.  This
was my first time editing DocBook XML but I think I got it right.

Brandon

-- 
Brandon Enright
Network Security Analyst
UCSD ACS/Network Operations
bmenrigh () ucsd edu

Attachment: dtd.patch.txt
Description:


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: