Resolving entities
Asked by
Kovid Goyal
Hi,
My application needs to process XML files that do not have DTD declarations but that contain entities. Can I inform XMLParser of the entities somehow? Setting resolve_entities to False doesn't work (still raises an undeclared entity error). Setting recover=True causes the entities to be removed from the tree:
etree.tostring(
gives
'<a>12</a>'
etree.LXML_VERSION
(2, 0, 5, 0)
etree.LIBXML_
(2, 6, 32)
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- lxml Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Kovid Goyal for more information if necessary.
To post a message you must log in.