Text UtilitiesLesson 98Free preview
XML Escape
This lesson is part of Web Developer Tools · All levels
Summary
XML escape replaces characters that have structural meaning in XML with entities, e.g. & become & and < become < Without this step, text containing tags or ampersand can render a document invalid. Similar rules are also used for HTML, with additional entities for quotes. This tool helps prepare text for safe display as the content of the elements.
Key points
- Five important entities: & & &gt; &quot; and &quot;
- Ampersand is escaped first so the entity doesn't escape twice.
- CDATA blocks mark unparsed text as a markup
- Escape is not a substitute for validating the document structure
- Numerical entities such as © can represent special characters
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.