1.2. Why XML Schemas?

XML provides a grammar for parsing a particular file or stream format. This XML grammar covers basic syntax, the most interesting being that of element tags and attribute specifications. Most applications need far more structure. XML schemas provide a mechanism for specifying more extensive grammar constraints. The ability to guide the layout of an XML document makes that XML document much more predictable. A programmer can examine an XML schema and know exactly what corresponding XML documents look like. Additionally, a program can reject an XML document out of hand when the XML does not conform to the appropriate XML schema.

An XML schema specifies valid elements and attributes in an XML instance. Furthermore, a schema ...

Get XML Schema Complete Reference, The now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.