sipxportlib
Version 3.3
|
Macros | |
#define | QUOTE """ /* " \x22 */ |
#define | AMPERSAND "&" /* & \x26 */ |
#define | APOSTROPHE "'" /* ' \x27 */ |
#define | LESS_THAN "<" /* < \x3c */ |
#define | GREATER_THAN ">" /* > \x3e */ |
#define | XML_CHARS "[\\x09\\x0a\\x0d\\x20\\x21\\x23-\\x25\\x28-\\x3b\\x3d\\x3f-\\xff]" |
#define | ESC_CHARS "[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x22\\x26\\x27\\x3c\\x3e]" |
Functions | |
bool | XmlEscape (UtlString &destination, const UtlString &source) |
Append escaped source string onto destination string. More... | |
bool | XmlUnEscape (UtlString &destination, const UtlString &source) |
Append unescaped source string onto destination string. More... | |
bool | XmlDecimal (UtlString &destination, int source, const char *format) |
Append decimal string onto destination string. More... | |
Variables | |
const RegEx | CopyChars ("("XML_CHARS"*)("ESC_CHARS")?") |
#define QUOTE """ /* " \x22 */ |
XmlContent provides conversion functions for escaping and unescaping UtlStrings as appropriate for use in XML attribute and element content.
At present, this makes no accomodation for character set differences; input is assumed to be 8 bits. The following characters are encoded using the mandatory character entities:
Other character values outside the range of valid 8-bit characters in XML:
While this is not strictly XML conformant (in that it does not explicitly deal with larger-size character encodings), it is symmetric (esaping and unescaping any 8 bit string using these routines will always produce the original string), and will interoperate correctly for any 8 bit encoding.
#define AMPERSAND "&" /* & \x26 */ |
#define APOSTROPHE "'" /* ' \x27 */ |
#define LESS_THAN "<" /* < \x3c */ |
#define GREATER_THAN ">" /* > \x3e */ |
#define XML_CHARS "[\\x09\\x0a\\x0d\\x20\\x21\\x23-\\x25\\x28-\\x3b\\x3d\\x3f-\\xff]" |
#define ESC_CHARS "[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x22\\x26\\x27\\x3c\\x3e]" |
Append escaped source string onto destination string.
The contents of the source string are appended to the destination string, with all characters escaped as described above.
Append unescaped source string onto destination string.
The contents of the source string are appended to the destination string, with all characters unescaped as described above.
bool XmlDecimal | ( | UtlString & | destination, |
int | source, | ||
const char * | format | ||
) |
Append decimal string onto destination string.
The source value is converted into a decimal string according to "format". The decimal string is appended to the destination string. "format" defaults to "%d", and must generate no more than 20 characters (excluding the ending NUL).