datatracker/ietf/submit/parsers/xml_parser.py
Emilio A. Sánchez López 37458917e0 Make critical parsing explicit. See #584
- Legacy-Id: 2828
2011-02-08 15:40:45 +00:00

16 lines
496 B
Python

from ietf.submit.parsers.base import FileParser
class XMLParser(FileParser):
# If some error is found after this method invocation
# no other file parsing is recommended
def critical_parse(self):
super(XMLParser, self).critical_parse()
self.parse_filename_extension()
return self.parsed_info
def parse_filename_extension(self):
if not self.fd.name.endswith('.xml'):
self.parsed_info.add_error('Format of this document must be XML')