sipxportlib  Version 3.3
Macros | Functions
XmlContent.h File Reference
#include "os/OsDefs.h"
#include "utl/UtlString.h"
Include dependency graph for XmlContent.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define XML_VERSION_1_0   "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
 

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=NULL)
 Append decimal string onto destination string. More...
 

Macro Definition Documentation

#define XML_VERSION_1_0   "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"

Function Documentation

bool XmlEscape ( UtlString destination,
const UtlString source 
)

Append escaped source string onto destination string.

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:

  • #x09 | #x0A | #x0D | [#x20-#FF] are encoded using the numeric entity encoding (&#x??;).

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 string these routines will always produce the original string), and will interoperate correctly for any 8 bit encoding. The contents of the source string are appended to the destination string, with all characters escaped as described above.

Returns
true for success, false if an error was returned from any UtlString operation.

The contents of the source string are appended to the destination string, with all characters escaped as described above.

Returns
true for success, false if an error was returned from any UtlString operation.
bool XmlUnEscape ( UtlString destination,
const UtlString source 
)

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.

Returns
true for success, false if an error was returned from any UtlString operation.
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).

Returns
true for success, false if an error was returned from any UtlString operation.

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).

Returns
true for success, false if an error was returned from any UtlString operation.