Skip to content

Commit ee2d67e

Browse files
Log unexpected elements when strict is False
1 parent 0029c46 commit ee2d67e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/zeep/xsd/types/complex.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,12 @@ def parse_xmlelement(
216216

217217
# Check if all children are consumed (parsed)
218218
if elements:
219+
err_msg = "Unexpected element %r"
219220
if schema.settings.strict:
220-
raise XMLParseError("Unexpected element %r" % elements[0].tag)
221-
else:
222-
init_kwargs["_raw_elements"] = elements
221+
raise XMLParseError(err_msg % elements[0].tag)
222+
init_kwargs["_raw_elements"] = elements
223+
for element in elements:
224+
logger.debug(err_msg % element.tag)
223225

224226
# Parse attributes
225227
if attributes:

0 commit comments

Comments
 (0)