Skip to content

Commit 8f237f7

Browse files
Log unexpected elements when strict is False
1 parent 368861c commit 8f237f7

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
@@ -219,10 +219,12 @@ def parse_xmlelement(
219219

220220
# Check if all children are consumed (parsed)
221221
if elements:
222+
err_msg = "Unexpected element %r"
222223
if schema and schema.settings.strict:
223-
raise XMLParseError("Unexpected element %r" % elements[0].tag)
224-
else:
225-
init_kwargs["_raw_elements"] = elements
224+
raise XMLParseError(err_msg % elements[0].tag)
225+
init_kwargs["_raw_elements"] = elements
226+
for element in elements:
227+
logger.debug(err_msg % element.tag)
226228

227229
# Parse attributes
228230
if attributes:

0 commit comments

Comments
 (0)