You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently XMLSchemaValidationError exceptions raised by xmlschema library do not include specific line numbers of the error occurrence in the XML file. Including the line number in the error reason could be useful information for users and ParseError exceptions already include the position in the detail.reason that gets returned upon validation error.
@otahontas mentioned in #88 that one way to do this would be:
import lxml.etree as etree
root = etree.parse("XPTO.XML").getroot()
errors = [e for e in schema.iter_errors(root)]
DoD (Definition of Done)
detail.reason generated in xml validation method includes line number for any error case.
As an example, validating SRP000539_invalid6.xml could return: Unexpected child with tag 'BAD_ELEMENT' at position 2, line 34.
Testing
Unit tests
The text was updated successfully, but these errors were encountered:
Proposed solution
Currently
XMLSchemaValidationError
exceptions raised byxmlschema
library do not include specific line numbers of the error occurrence in the XML file. Including the line number in the error reason could be useful information for users andParseError
exceptions already include the position in thedetail.reason
that gets returned upon validation error.@otahontas mentioned in #88 that one way to do this would be:
DoD (Definition of Done)
detail.reason
generated in xml validation method includes line number for any error case.As an example, validating
SRP000539_invalid6.xml
could return:Unexpected child with tag 'BAD_ELEMENT' at position 2, line 34.
Testing
Unit tests
The text was updated successfully, but these errors were encountered: