Validity and the Schema

<<< Of course, just because an English sentence has proper spelling, grammar, and punctuation doesn't make it meaningful:

The brick astonished the sunlight.

Similarly, there are some questions about the weather report that the DTD can't answer:

To be able to do this level of validation, the W3C has created XML Schema, a markup language that lets you describe how other XML languages are to be validated. Since XML Schema is itself in XML, it's much easier to read than a DTD. [Note: This material is based on the excellent XML Schema primer available at the W3C website.] Let's start with the skeleton of an XML Schema to describe EWEML

<schema xlmns="http://www.w3.org/1999/XMLSchema"
           xmlns:ewe="http://catcode.com/eweml"
           targetNamespace="http://catcode.com/eweml">
</schema>

Since the schema uses XML tags to define another set of XML tags, the attributes in the opening <schema> tag establish namespaces so that we can know whose tag names are whose.

In detail, the attributes in the opening tag mean:

  1. Unless specified otherwise, the tags and attributes that we use in this document come from the definitions for XML Schema.
  2. If we use a tag or attribute name with a prefix of ewe, it comes from the definitions for the EWEML markup language that we're describing.
  3. The target namespace; that is, the set of tags we're defining, are the ones for EWEML.

The things that look like web addresses are used to uniquely identify each of the two markup languages that we're dealing with.

Now let's fill in some of the schema. >>>

  1. Validating XML with XML Schema
  2. Validity and the DTD
  3. Validity and the Schema
  4. Specifying Elements
  5. Making Validation More Specific
  6. Making New Types
  7. Enumerations
  8. The Big Picture
  9. Summary