Home » Categories » Solutions by Business Process » E-Business » XML

“Escaped” Data Characters

Datafile Software

"Escaped” Data Characters


Data in an XML file can consist of virtually any character. However, special processing is required if the data contains any of five characters that serve specific functions within an XML file. When present in data, these characters are converted to special "escape” sequences on output to an XML file, or converted back to their original form from an input XML file. Escape sequences start with an ampersand "&”, and are terminated by a semi-colon ";”.

The special characters are:

< The opening angle bracket character is interpreted as the start of an element tag, and is converted to the sequence "&lt;” (ignoring the quotes, this is an ampersand, "lt” for "less than”, which is how the opening angle bracket is known, and a semi-colon)

& The ampersand itself is represented as "&amp;”

> The closing angle bracket closes an element tag, and is converted to "&gt;”

" Double quotes are used to enclose the value of an attribute, and each one is converted to the sequence "&quot;”

' The apostrophe can be used as an alternative to the double quote, and is converted to the sequence "&apos;”

According to the XML standards, only &lt; and &amp; must always be used instead of their literal character equivalents in element content. But often the other three are also converted for both symmetry reasons (&gt;) and to prevent them being misconstrued as XML markup rather than data (&quot; and &apos;).
Custom Fields
  • Release ID: Standard
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Sales Ledger Accounts (SLA)
Viewed 3426 times since Tue, Jul 10, 2012
Constants File - Other XML Associated Files
Viewed 1285 times since Tue, Jul 10, 2012
XML Audit Trail Error Codes
Viewed 1781 times since Tue, Jul 10, 2012
break
Viewed 1289 times since Mon, Jul 9, 2012
Using Table Flags
Viewed 1435 times since Tue, Jul 10, 2012
Input XML File Questions
Viewed 1267 times since Mon, Jul 9, 2012
Linking to POP Document Layouts
Viewed 1344 times since Mon, Jul 9, 2012
Permitted Characters
Viewed 1416 times since Mon, Jul 9, 2012
Element Tags
Viewed 1221 times since Mon, Jul 9, 2012
Namespaces
Viewed 44655 times since Tue, Jul 10, 2012