Skip to content

Commit 2f31f7f

Browse files
committed
Temorary workaround to upload xml validation. The tree.validate() of xml2rfc should be updated to check vocabulary version and validate against the appropriate schema, to fix this properly.
- Legacy-Id: 16101
1 parent a60ac98 commit 2f31f7f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ietf/submit/forms.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,14 @@ def clean(self):
146146
try:
147147
parser = xml2rfc.XmlRfcParser(str(tfn), quiet=True)
148148
self.xmltree = parser.parse(normalize=True)
149-
ok, errors = self.xmltree.validate()
149+
root = self.xmltree.getroot()
150+
ver = root.get('version', '2')
151+
debug.show('ver')
152+
if ver == '2':
153+
ok, errors = self.xmltree.validate()
154+
else:
155+
# XXX TODO: Add v3 validation
156+
ok, errors = True, ''
150157
except Exception as exc:
151158
raise forms.ValidationError("An exception occurred when trying to process the XML file: %s" % exc)
152159
if not ok:

0 commit comments

Comments
 (0)