From 98dc8e99f30f9a845a8df8f59c5acc852f0b59e4 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 12 Nov 2019 18:27:01 +0000 Subject: [PATCH] Changed the call arguments for submission tool conversion from XML to v3 text to match those of the standalone tool. Fixes an issue where would have line ends stripped when converted by the datatracker. - Legacy-Id: 17021 --- ietf/submit/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ietf/submit/forms.py b/ietf/submit/forms.py index 0a17cfdd3..44e4664fb 100644 --- a/ietf/submit/forms.py +++ b/ietf/submit/forms.py @@ -182,7 +182,7 @@ class SubmissionBaseUploadForm(forms.Form): # --- Parse the xml --- try: parser = xml2rfc.XmlRfcParser(str(tfn), quiet=True) - self.xmltree = parser.parse(normalize=True) + self.xmltree = parser.parse(remove_comments=False, quiet=True, add_xmlns=True) self.xmlroot = self.xmltree.getroot() xml_version = self.xmlroot.get('version', '2') except Exception as e: @@ -224,8 +224,8 @@ class SubmissionBaseUploadForm(forms.Form): file_name['xml'] = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.%s' % (self.filename, self.revision, ext)) try: if xml_version == '3': - prep = xml2rfc.PrepToolWriter(self.xmltree, quiet=True, liberal=True) - prep.options.accept_prepped = True + prep = xml2rfc.PrepToolWriter(self.xmltree, quiet=True, liberal=True, keep_pis=[xml2rfc.V3_PI_TARGET]) + prep.options.accept_prepped = True self.xmltree.tree = prep.prep() if self.xmltree.tree == None: raise forms.ValidationError("Error from xml2rfc (prep): %s" % prep.errors)