XML Schema

Although DTDs help with the additional higher-level validation of XML documents, they can't perform data-type validations. DTDs ensure that all the elements and attributes expected in the right structure exist in the XML document. But data validations—for example, if the value of an element is supposed to be a date or the value of an attribute is supposed to be a number between 1 and 10—are not possible. XML Schema is a better mechanism for defining data schemas and ensuring that XML documents have the right data in addition to the right structure.

XML Schema allows the addition of user data types. If you're familiar with C, XML Schema is something like the typedef feature that allows programmers to define their own C structures and ...

Get Java™ Connector Architecture: Building Custom Connectors and Adapters 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.