O'Reilly logo

Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Quoted Printable

The quoted printable encoding was designed for e-mail, but it works surprisingly well in XML. It can encode any ASCII or UTF-8 text including characters that are not normally allowed in XML documents, such as form feed, vertical tab, null, and the reserved XML characters less than sign (<), greater than sign (>), and ampersand (&). Most importantly, most of the ASCII text is intact and can be read by a normal browser. Only the problematic characters need to be escaped.

The basic algorithm uses just five rules.

  1. Each byte can be encoded as an equals sign (=) followed by two hexadecimal digits; for example, a less than sign can be represented as =3C. Only capital letters are used for the hexadecimal digits A–F.

  2. The bytes with values ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required