Module escape

Module escape 

Source
Expand description

Manage xml character escapes

Functions§

escape
Escapes a &[u8] and replaces all xml special characters (<, >, &, ’, “) with their corresponding xml escaped value.
partial_escape
Should only be used for escaping text content. In xml text content, it is allowed (though not recommended) to leave the quote special characters “ and ’ unescaped. This function escapes a &[u8] and replaces xml special characters (<, >, &) with their corresponding xml escaped value, but does not escape quote characters.
unescape
Unescape a &[u8] and replaces all xml escaped characters (‘&…;’) into their corresponding value
unescape_with
Unescape a &[u8] and replaces all xml escaped characters (‘&…;’) into their corresponding value, using a dictionnary of custom entities.