XML Schema Attributes for Use in Instance Documents

While many developers create XML Schemas and use them to validate all documents which come through a given application, there are times when applications may prefer to work with information stored in the document instance, much as the DOCTYPE declaration of an XML document identifies the DTD against which that document should be validated and may include extra information extending that DTD. XML Schema supports both instance document information that points to external schemas for validation and two pieces that let document parts specify more precisely what their contents are.

All of these attributes are in the http://www.w3.org/2001/XMLSchema-instance namespace. There is no mechanism in XML Schema for constraining where these attributes may appear. In some sense, though they appear in a document instance that is validated with an XML Schema, these attributes are more document-specific supplements to the schema processing than they are parts of the document.

Get XML Pocket Reference, 3rd Edition 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.