Skip to content

Commit

Permalink
Fix schema_path usage in XMLSchemaBase.iter_errors()
Browse files Browse the repository at this point in the history
  • Loading branch information
brunato committed Sep 29, 2022
1 parent 3cdf541 commit 498311f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions xmlschema/validators/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,6 @@ def iter_errors(self, source: Union[XMLSourceType, XMLResource],

for elem in selector:
if elem is resource.root:
xsd_element = schema.get_element(elem.tag, namespaces=namespaces)
if resource.lazy_depth:
kwargs['level'] = 0
kwargs['identities'] = {}
Expand All @@ -1809,8 +1808,7 @@ def iter_errors(self, source: Union[XMLSourceType, XMLResource],

prev_ancestors = ancestors[:]

xsd_element = schema.get_element(elem.tag, schema_path, namespaces)

xsd_element = schema.get_element(elem.tag, schema_path, namespaces)
if xsd_element is None:
if XSI_TYPE in elem.attrib:
xsd_element = self.create_element(name=elem.tag)
Expand Down

0 comments on commit 498311f

Please # to comment.