Selection from instance documents

While derived simple types and complex types can be referenced from element definitions, like any other type, they can also be used in a more flexible way that echoes techniques available to software developers using object-oriented programming languages.

An attribute in a document instance is used to reference a derived type. Essentially, the same Type attribute is used, but this time in the document instance instead of in the schema document. It therefore must belong to the 'http://www/w3/org/2001/XMLSchema-instance' namespace.

In the following example, an extension of the book cover model that allows for a date to be added is selected (but the Cover element that refers to the original cover type still appears ...

Get XML Companion, The, Third 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.