quick-xml icon indicating copy to clipboard operation
quick-xml copied to clipboard

Rework handling general entity references (`&entity;`)

Open Mingun opened this issue 2 weeks ago • 4 comments

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

Mingun avatar Jun 21 '24 16:06 Mingun