Validity
Programmers have long known the value of verifiable preconditions on functions and methods. (A lot of us carelessly don't use them, but that's a topic for another book.) One of the important innovations of XML is the ability to place preconditions on the data the programs read, and to do this in a simple declarative way. XML allows you to say that every Order element must contain exactly one Customer element; that each Customer element must have an id attribute that contains an XML name token; that every ShipTo element must contain one or more Streets, one City, one State, and one Zip; and so forth. Checking an XML document against this list of conditions is called validation. Validation is an optional step but an important one.
There ...
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