instant-labs / instant-xml

11 stars 3 forks source link

Handle entities #16

Closed djc closed 1 year ago

djc commented 1 year ago

XML has 5 pre-defined character entities which we should be able to encode and decode. These are:

Thus, when serializing a &str or String or similar, if any of these characters occurs, we should replace them in the output. When deserializing, there are typically three possible target types:

(Additionally a DTD may define custom entities in the XML header/prolog. This is something to keep in mind for the design but let's skip this feature for now -- as I understand it, it's not heavily used.)