Stylus Studio XML Editor

Table of contents

Appendices

2.4 Character Data and Markup

Character Data and Markup

Text consists of intermingled Character Data and markup. Markup takes the form of Start-Tag, End Tag, Empty, Entity Reference, Character Reference, Comment, CDATA Section delimiters, Document Type Declaration, Processing instruction, XML declarations, text declarations, and any white space that is at the top level of the document entity (that is, outside the document element and not inside any other markup).

All text that is not markup constitutes the character data of the document.

The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form, except when used as markup delimiters, or within a Comment, a Processing instruction, or a CDATA Section. If they are needed elsewhere, they MUST be escape using either Character Reference or the strings "&amp;" and "&lt;" respectively. The right angle bracket (>) MAY be represented using the string "&gt;", and MUST, For Compatibility, be escaped using either "&gt;" or a character reference when it appears in the string "]]>" in content, when that string is not marking the end of a CDATA Section.

In the content of elements, character data is any string of characters which does not contain the start-delimiter of any markup or the CDATA-section-close delimiter, "]]>". In a CDATA section, character data is any string of characters not including the CDATA-section-close delimiter.

To allow attribute values to contain both single and double quotes, the apostrophe or single-quote character (') MAY be represented as "&apos;", and the double-quote character (") as "&quot;".

Character Data
2.4    CharData   ::=   [^<&]* - ([^<&]* ']]>' [^<&]*)