Let's Try It

In Your favorite Editor

There are two levels of quality we may enforce on XML files. Wellformedness, which is a must, and validity which is optional. Create a new file by keying in the following:

<?xml version="1.0"?>
<schedule>
    <lesson>
        <module>
            <group>1wu09B</group>
            <unit>
                <subject>Databases and XML</subject>
                <faculty>Niels Müller Larsen</faculty>
            </unit>
        </module>
        <room>A2.08</room>
        <time>
            <dow>Wed</dow>
            <tod>09:00</tod>
            <duration>2</duration>
        </time>
    </lesson>
</schedule>

Syntactical Wellformedness

Figure 39.3. Wellformedness As The Browser Sees it
Wellformedness As The Browser Sees it

and live: see the parsed results.

Validity

You may safely assume, that if there are no errors from a decent browser, then the document is wellformed, as we have just heard or read. Taking it one step further you may use your editor capabilites to check wellformed-ness.

Validation is a step above wellformedness. It depends on setting a set of rules for the document in the form of an associated DTD or an XML Schema. We are not there yet.