XML Schema validation |
|
XML Schema simalarity to DTD |
|
Functionally XML Schema and DTD do the same thing. They provide a specification for XML web pages. XML web pages that conform to their corresponding XML Schema or DTD are said to be valid. So, you will find all the things we say here are very similar to what was discussed for a DTD. XML Schema and DTD are written in different languages. An XML Schema is written in the XML language. A DTD is written in a different subset of the SGML language. |
|
XML relationship to XML Schema |
|
What does an XML document do? |
|
What does an XML Schema document do? |
|
An XML document does not need to be related to an XML Schema.
If it has no XML Schema to specify what the XML document must contain,
then the XML document may contain anything.
For example, it might contain the country of birth of the first 97
presidents of the United States of America. |
|
An XML document can be related to an XML Schema. |
|
Validate your XML Schema document |
|
Your XML Schema document is itself an XML document. So you need to validate it first, before using it to validate your XML instance doucment. There are two steps to validate your XML Schema document.
|
|
Validate your XML document |
|
There are two steps needed to validate your XML document. Always do the first step, then the second step.
|
|
Build good XML Schema and instance documents |
|
Do not try to just sit down and build complete XML Schema and instance documents all at once. Use the following set of simple steps, adding a little at a time.
By taking small steps, you can correct problems as you go along. It can dificult to sort out a combination of problems that may be in the XML, or may be in the XML Schema, or may be due to an interaction of both. Taking small steps makes this much easier. At some point in the process, you may wish to introduce an additional XML document, to test other capabilities of the XML Schema you are building. |
|
Lab 4 assignment |
|
Create an XML Schema document that will validate your lab 2 XML document.
Design your XML Schema document carefully, so it will validate other similar XML documents. |
|
Put your web page on the Internet |
|
You have built your DTD doucment; now put it on the Internet, so it can be used there. |
|
Complete lab |
|
You have built your lab 4 XML Schema document and uploaded it to voyager.
|
|