Building Well-Formed Document Structure

We've gotten a lot of the syntax and rules of creating XML documents at the element and character data level down now. It's time to move on to the next level: actually giving your document structure.

The W3C has a lot of rules about how to structure your document in a way to make it well-formed, and I'll take a look at those rules here. In this chapter, I'm going to talk only about standalone documents; in Chapter 3, we'll see that we have to adjust these points somewhat for documents that have a DTD.

Checking Well-Formedness

If you have doubts whether your XML document is well-formed, use an online XML validator, such as the excellent one hosted by the Brown University Scholarly Technology Group at ...

Get Inside XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.