Understanding Content Models

Speaking of content models, the previous chapter touched on how XML Schema supports two different types of content models: open and closed. An open content model allows a schema developer to use child elements and attributes within an element that aren't declared in the document's schema. DTDs only support closed content models, which require you to declare all elements and attributes in order to use them in a document. Not surprisingly, the open content model made possible by XML Schema is much more extensible than the DTD approach.

Note

In XML Schema, content models are open by default.

Open content models provide lots of flexibility, allowing you to extend the vocabulary of schemas while still being able to create ...

Get XML Unleashed 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.