| [ directory ] |
|
9.4 SummaryIn this chapter, we have seen the problems associated with DTDs and introduced W3C XML Schema and RELAX NG through numerous examples. DTDs have three problems: a peculiar syntax, a lack of datatypes, and the inability to handle namespaces. W3C XML Schema is a powerful schema language: It provides many data types and facets, and supports namespaces. However, W3C XML Schema is also a complicated schema language, and we have merely covered a DTD-mimicking subset with namespaces and datatypes added. On the other hand, RELAX NG is a simple yet powerful alternative to W3C XML Schema. In particular, RELAX NG can support co-occurrence constraints. RELAX NG can borrow datatype libraries, including W3C XML Schema Part 2, and also support namespaces. It is not easy to compare schema languages. If we merely create a list of supported features, complicated schema languages will look better. However, deliberate omission of features is often crucial because some features violate layering of XML parsers, validators, and application programs. In Chapter 16, we study the principles of schema languages and compare XML Schema and RELAX NG. For impatient readers, here is a piece of advice. This author (Murata) believes that RELAX NG is technically superior to W3C XML Schema. However, it is true that W3C XML Schema is supported by W3C, Microsoft, and IBM. If you need a simple yet powerful language and reliable implementations, it is a good idea to use RELAX NG. If you care about authorization by W3C and support from large companies, you might want to use a DTD-mimicking subset of W3C XML Schema together with datatypes and namespaces. |
| [ directory ] |
|