XML technologies / XML Schema / References to schemas and schema data types in XML documents / Beware of cuckoo’s eggs
(Excerpt from “XML Schema” by Eric van der Vlist)
The heading says it all! Using the xsi namespace makes instance documents dependent on a particular schema technology, which is fundamentally questionable. A great strength of XML is separating document information from applications extracting and processing it. If a schema validator is one of those applications, using specific W3C XML Schema constructs violates this principle.
Another concern is that data and information outlive applications. We can often expect today’s XML documents to outlive W3C XML Schema 1.0 technology. The working group began considering XML Schema 1.1 before 1.0 became a recommendation; such dependencies create potential migration problems. XML 1.0 has already seen two schema-language generations, DTD and W3C XML Schema 1.0. DTD features not included in W3C XML Schema, such as external parsed and unparsed entities, risk becoming obsolete in general use. Other schema technologies also exist; tight integration of documents with W3C XML Schema may close doors your application needs.
On the other hand, these instance attributes are available to applications unaware of schemas, and attributes xsi:type or xsi:nil are easily processed with a simple XSLT transformation.
Finally, these are attributes. Obvious as that sounds, attributes cannot contain attributes, so an attribute cannot be further specified by xsi:nil or xsi:type. This adds another distinction between elements and attributes that XML application designs may need to consider.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top