Mandatory escape sequences, Xml encoding – Cisco OL-20949-01 User Manual

Page 39

Advertising
background image

3-21

Cisco Unified IP Phone Services Application Development Notes

OL-20949-01

Chapter 3 CiscoIPPhone XML Objects

XML Considerations

Note

All CiscoIPPhone element names and attribute names are case sensitive.

Mandatory Escape Sequences

By XML convention, the XML parser also requires that you provide escape values for a few special
characters.

Table 3-5

lists characters and their escape values.

.

Escaping text can be tedious, but some authoring tools or scripting languages can automate this task.

XML Encoding

Because the phone firmware can support multiple encodings, the XML encoding should always be set in
the XML header.

If the XML encoding header is not specified, the phone will default to the encoding specified by the
current user locale.

Note

This behavior is NOT compliant with XML standards, which specify UTF-8 as the default encoding, so
any UTF-8 encoded XML object must have the encoding explicitly set for the phone to parse it correctly.

The encoding value specified in the XML header must match one of the encodings provided by the IP
Phone in its Accept-Charset HTTP request header, as shown in the example below.

Example

The following examples illustrate UTF-8 and ISO-8859-1 encoding, respectively:

<?xml version="1.0" encoding="utf-8" ?>

<?xml version="1.0" encoding="iso-8859-1" ?>

For details on setting HTTP header encoding settings, see the

“HTTP Encoding Header Setting” section

on page 6-6

.

Table 3-5

Escape Sequences for Special Characters

Character

Name

Escape Sequence

&

Ampersand

&amp;

Quote

&quot;

'

Apostrophe

&apos;

<

Left angle bracket

&lt;

>

Right angle bracket

&gt;

Advertising