NAME
std/data/xml/escape - XML entity escaping helpers.
SYNOPSIS
from std/data/xml/escape import
escape_xml, unescape_xml;
let escaped := escape_xml(
"<tea attr=\"hot\">& 'biscuits'</tea>"
);
let text := unescape_xml(
"<tea>AA</tea>"
);
IMPLEMENTATION SUPPORT
This module is supported by all implementations of ZuzuScript.
DESCRIPTION
This module provides lightweight XML entity escaping and unescaping helpers.
EXPORTS
Functions
escape_xml(value)Parameters:
valueis any value. Returns:String. Escapes XML special characters&,<,>,", and'.unescape_xml(value)Parameters:
valueis any value. Returns:String. Unescapes XML named entities<,>,",', and&.Also decodes numeric entities in decimal and hexadecimal forms, such as
AandA.
COPYRIGHT AND LICENCE
std/data/xml/escape is copyright Toby Inkster.
It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.