Building Well-Formed Document Structure

We've learned a lot of the syntax and rules of creating XML documents at the element and character data levels. 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'm going to take a look at those rules here. In this chapter, I'm going to talk about only standalone documents; in the next chapter, we'll see that we have to adjust these points somewhat for documents that have a DTD.

Checking Well-Formedness

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

Get Real World 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.