-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
If XML contains empty tags (self-closing, example: <ram:Content/>), the following error occurs:
doc = DrafthorseDocument.parse(xml_bytes, strict=False)
File "env/lib/python3.10/site-packages/drafthorse/models/elements.py", line 124, in parse
return cls().from_etree(root, strict)
File "env/lib/python3.10/site-packages/drafthorse/models/elements.py", line 114, in from_etree
getattr(self, name).from_etree(child, strict)
File "env/lib/python3.10/site-packages/drafthorse/models/elements.py", line 112, in from_etree
getattr(self, name).add_from_etree(child, strict)
File "env/lib/python3.10/site-packages/drafthorse/models/container.py", line 24, in add_from_etree
childel.from_etree(root, strict)
File "env/lib/python3.10/site-packages/drafthorse/models/elements.py", line 112, in from_etree
getattr(self, name).add_from_etree(child, strict)
File "env/lib/python3.10/site-packages/drafthorse/models/container.py", line 91, in add_from_etree
self.add(root.text)
File "env/lib/python3.10/site-packages/drafthorse/models/container.py", line 9, in add
raise TypeError("{} is not of type {}".format(item, self.child_type))
TypeError: None is not of type <class 'str'>
Version: drafthorse~=2025.1.0
barredterra
Metadata
Metadata
Assignees
Labels
No labels