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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access