Well-formedness
Close tags, escape characters and use CDATA deliberately.
What you will be able to do
- Escape & < > with entities.
- Use CDATA for blocks of unescaped text.
- Attribute values need quotes.
- Well-formed is not the same as valid.
In plain English
A document is well-formed when it follows XML syntax: tags close, attributes quote and special characters are escaped. Validity is a separate, stronger claim defined by a schema.
<note>
<text>A < B & C</text>
<code><![CDATA[if (a < b) { run(); }]]></code>
</note>Your turn
EasyEscape an ampersand
Write the escaped form of the text A & B.
HTML · starter
A & BCheck your understanding before moving on.
Knowledge checkQuestion 1
What does CDATA do?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.