Chapter 5. XML Schema


XML Schema [Schema] is a way of describing the allowable syntax of XML. This chapter briefly describes schemas that conform to this standard because of their use as the authoritative descriptions of XML Digital Signature, Encryption, and other constructs. Additionally, schemas are new enough that even people familiar with other aspects of XML or SGML, such as DTDs, may not be familiar with them.

graphics/soapbox.gif

XML Schema offers a number of advantages, particularly in comparison with DTDs (see Chapter 4):

  • It is generally not difficult to guess what simple Schema descriptions mean.

  • Schemas are well integrated with namespaces [Names].

  • They provide finer-grained control over both data types and structures. That is, a schema provides stronger typing.

  • Schemas are part of XML. Of course, by definition, DTDs are also part of XML, but they have their own special syntax. In contrast, XML schemas are expressed in terms of ordinary, garden-variety XML syntax of elements and attributes. This fact makes it easier to manipulate and make assertions about schemas, and schemas can be used to describe themselves.

There are a number of bad, or at least surprising, things about XML Schema:

  • The XML documentation on schemas is huge! The current Schema Recommendation has three parts that total about 400 printed pages.

  • Schemas don't fully replace DTDs. In particular, they do not provide the equivalent to DTD entities, although the "group" construct makes some attempt in this direction. In fact, the XML Schema Recommendation goes so far as to require use of a DTD to define "%p;" and "%s;" (prefix and suffix) entities so they expand into the namespace prefix in use for the elements defined by the schema. That this point surprised so many people may indicate a failure to properly set expectations for schemas.

  • Schemas don't provide some fairly obvious facilities. Suppose you want to have the allowed content of an element depend on the presence or perhaps the value of an attribute a common preference, and something that would have been desirable at least one place in XML Security. Perhaps such a feature will appear in the next, presumably even larger, version of the Schema Recommendation.


Whether you like the Schema Recommendation or not, use of it is clearly on the rise. In the future, schemas will be the way that W3C recommendations and an increasing number of applications describe their XML [Schema].

graphics/history.gif

Schemas "came out" during the development of the XMLDSIG recommendation. The XMLDSIG working group decided to provide both DTD and schema syntax, with Schema serving as the authoritative description. Other W3C working groups made their own decisions, sometimes based on whether they had the resources to convert. In any event, it seems clear that future W3C work will use schemas, as the XML Encryption and XKMS W3C working groups already are.




Secure XML(c) The New Syntax for Signatures and Encryption
Secure XML: The New Syntax for Signatures and Encryption
ISBN: 0201756056
EAN: 2147483647
Year: 2005
Pages: 186

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net