@@ -0,0 +1,1720 @@
+import re%0A%0Afrom libptp.exceptions import NotSupportedVersionError%0Afrom libptp.info import Info%0Afrom libptp.parser import AbstractParser%0A%0A%0Aclass W3AFXMLParser(AbstractParser):%0A%0A    __tool__ = 'w3af'%0A    __format__ = 'xml'%0A    __version__ = %5B'1.6.0.2'%5D%0A%0A    def __init__(self, *args, **kwargs):%0A        AbstractParser.__init__(self, *args, **kwargs)%0A        self.re_version = re.compile(r'Version: (%5CS*)%5Cs')%0A%0A    @classmethod%0A    def is_mine(cls, stream):%0A        %22%22%22Check if it is a supported report.%22%22%22%0A        raw_metadata = stream.find('.//w3af-version')%0A        if raw_metadata is None:%0A            return False%0A        return True%0A%0A    def parse_metadata(self, stream):%0A        %22%22%22Parse the metadatas of the report.%22%22%22%0A        raw_metadata = stream.find('.//w3af-version').text%0A        # Find the version of w3af.%0A        version = self.re_version.findall(raw_metadata)%0A        if len(version) %3E= 1:  # In case we found several version numbers.%0A            version = version%5B0%5D%0A        # Reconstruct the metadata%0A        # TODO: Retrieve the other metadata likes the date, etc.%0A        metadata = %7B'version': version,%7D%0A        if self.check_version(metadata):%0A            self.metadata = metadata%0A        else:%0A            raise NotSupportedVersionError(%0A                'PTP does NOT support this version of ' + self.__tool__ + '.')%0A%0A    def parse_report(self, stream, scale):%0A        %22%22%22Parse the report.%22%22%22%0A        res = %5B%5D%0A        for vuln in stream.findall('.//vulnerability'):%0A            info = Info(%0A                # Convert the severity of the issue thanks to an unified%0A                # ranking scale.%0A                ranking=scale%5Bvuln.get('severity')%5D,)%0A            res.append(info)%0A        return res%0A

Add parser for 1.6.0.2 XML report.