quick-xml
quick-xml copied to clipboard
Rework handling general entity references (`&entity;`)
This is a big change in handling general entity references and character references. Open PR early to get feedback.
With this changes we can correctly parse document
<!DOCTYPE root [
<!ENTITY root "<root/>">
]>
&root;
as equivalent normalized document
<root/>
The updated custom_entities
example shows how it would be possible to implement requirement from the specification about parsed general entities. Serde deserializer did not updated yet, because this is not trivial part and probably that will be done in another PR.
Of course, such change probably makes the performance worse, I didn't measure impact yet.
Closes #667