Does anyone have any suggestions for parsing nmap's (www.insecure.org) XML output using PHP's XML expat extensions?
Instead of enclosing data inside tags/elements, nmap's XML output has a lot of attributes that contain data. See this unofficial nmap XML dtd:
http://www.networkexploits.com/projects/nmap/nmap.dtd
Also, many elements don't have a closing tag, but instead something like this:
<address addr="192.168.0.2" addrtype="ipv4" />
How can I handle those types of elements? Would using the DOM XML extensions be easier?
Sorry for the generality of my questions, I'm pretty new to XML. I've read several of the PHP-XML tutorials, but they don't cover some of the things I've encountered when parsing nmap's XML output. Any ideas for making a class to do this would be great too.. maybe I can release it when I'm finished.
o.