XML Schema

I continue to pass on information learned in my XML Training class. Previously I had learned that a well formed XML document is one that has correct syntax. That just means that the formatting meets the XML rules. But this has little to do whether the required type of data, or the correct data format is contained in the file. For this we need XML validation.

XML validation used to be performed by a Document Type Definition (DTD). This is another file which describes the required rules to determine whether the XML data is valid. DTDs did not work well with XML. They allow specification of structure definition. They were weak on data types. This led to creation of a new validation language called XML Schema.

Initially there were many flavors of XML Schema. However on 05/02/2001, a single version of XML Schema became a standard. Although you can code XML Schema documents using a text editor, it is much easier to use a tool to design the schema graphically. XML Schema has an XML namespace that normally is denoted with the alias xsd. XML Schema comes with 40+ built in data types. These are the simple types. You can also use a complex type which is either a set of sub elements, attributes, or a combination of both.

There is a lot more to what you can specify in the XML Schema language. I think I will save that for a future post. Mind you that we learned all about XML Schema in one afternoon. I am in a demanding training class.