an XML Collection...

XML Schema Tutorial Change History

Last updated September 13, 2003

The tutorial includes a complete set of labs with answers. All examples and lab answers are complete and have been validated. I am continually revising and adding new material to this tutorial. Please check back periodically for updates.

Go to the XML Schema Tutorial


Update History

September 13:I added a slide on how to create a line break regex that is independent of the platform that the instance document resides on. (Does anyone read this change history?)
January 19: More cosmetic changes
December 7: Some more cosmetic changes
November 2: I carefully went through the entire tutorial and made little changes here and there.
July 5: I added some slides on NOTATIONs
May 12: I added some slides on attributeFormDefault, and Lax vs Strict validation. Also, I fixed some typos.
May 4: I added an example showing how to validate an instance document using an externally specified schema. That is, the instance document does not specify schemaLocation. Instead the targetNamespace and schema URI is specified on the command line. Real cool! See the description in xml-schema2.ppt, and example40.
March 13: I discovered that it is best not to create a namespace declaration for xml: (some validators generate an error if you do). I note all this in xml-schema2.ppt
March 2: I added a couple of high-level slides at the beginning. I added a slide on complexContent versus simpleContent. Also, I modified my validate.bat file to use xerces-2_0_0.
December 7: I fixed a couple typos. I am pretty much done! There may be some minor typo fixes over time, but nothing substantial. Thanks to all those who helped to create this tutorial by sending me typos/bugs. I hope that people find this schema tutorial is helpful. Cheers!
September 29: I fixed a couple typos.
August 26: I fixed a couple typos that Jonathan Rich discovered. Thanks Jonathan! Also, Jonathan pointed out that I was bundling in an old version of XSV. The xml-schema.zip file now comes bundled with the latest version of XSV. Thanks Jonathan, and Henry Thompson!
August 18: I fixed a typo that Carol Xi discovered. Thanks Carol! Also, I added a couple slides on using xml:lang and xml:space. Plus, I put an example in showing the use of hex values in regular expressions.
August 15: I added a slide showing when not to use schemaLocation (thanks Dave Cleary!), and I added a folder containing Java code which shows how to programmatically access xerces.
July 29: I added a couple more slides on regular expressions, and a slide on xPath expressions in key/unique elements.
July 26: I fixed a couple of errors that Paulo Villela found. Thanks Paulo!
July 22: My examples on key/unique/keyref had a bug (need to namespace qualify the xpath expressions). I fixed them. Now they validate properly.
July 21: I added a few slides on how XML Schemas may be used as a rich source of metadata.
July 14: Continuing with the XML Schema Reference Manual, I have nearly completed the section on elements. I added examples for each of the various forms for using elements.
July 12: Paul Barriere notified me of a typo, which I fixed. Thanks Paul!
July 10: Made a few corrections to the Reference Manual - an attribute with a default or fixed value cannot have a type of ID, and an element with a fixed value cannot have the nillable attribute.
July 7: I have made a real good start on the Reference Manual for the element component. I have identified 17 different forms for declaring elements. I show each of the forms in the Reference Manual.
July 4: Massimo Gentili-Tedeschi notified me of a typo, which I have fixed. Thanks a lot Massimo! Also, I completed the reference manual on declaring attributes. I hope that you find it helpful.
June 30: Jonathan Rich sent me a list of typos, which I have fixed. Thanks a lot Jonathan! Also, I have started work on a third Powerpoint document. This document will be a Reference Guide of all the schema components, filled with lots of examples. Currently, it contains everything you ever wanted to know about attributes.
June 9: Fixed a lot of bugs. Added a summary of simpleTypes.
June 2: I have gone through the entire tutorial with great care. I have added a lot of explanations where it was previously missing. I also added some new stuff - on fixing facet values. I am getting close to the 300 mark, in terms of slide count.
May 28: At last, I have updated the material to the latest spec. In addition, I touched up a lot of slides and changed the examples from BookCatalogue to BookStore.
May 6: I added a couple of slides on using substitutionGroups using derived types. Also, I showed the difference between DTD vocabulary and XMLSchema vocabulary.
April 30: I added a couple of slides on using substitutionGroups for international clients. I also stopped explicitly specifying minOccurs and maxOccurs when their value is 1. It makes for a much cleaner, easier to read schema.
April 15: I added another slide on uses for schemas, fixed some typos.
March 24: I added a few slides on mixed content, along with an example (example33).
March 17: I added a few more slides on annotating schemas. Also, I fixed a bug in lab 13.
March 11: I added a few slides describing XML Schemas as a wonderful source of metadata, and how that metadata source may be used to automatically generate an API, or a GUI, etc. Also, I bundled in the latest version of XSV (XSV11a).
March 4: I totally reworked all the slides, examples, and labs to conform to the Best Practice of making the targetNamespaces the default (previously, I was using XMLSchema as the default). I also added some new material on <union> and typical uses of schemas.
February 25: I added a slide listing all the schema validators. Also, I added a couple slides showing what to do to check your XML data for constraints that XML Schemas does not support.
February 24: I added a lot more material on open content using the <any/> element. Also, I did a lot of reorganizing, as there were some parts that weren't very clear I felt.
January 16: Schemas don't need to have a xsi:schemaLocation attribute (matter of fact, they can't have one unless you extend the schema for schemas). All my schemas were using xsi:schemaLocation, so I changed them all to eliminate xsi:schemaLocation. Also, I have bundled in the latest version of xsv.
December 1: Fixed a lot of typos. Added a few more labs. I think that it's looking pretty good!
November 5: Enhanced my batch files to run both XSV and Oracle's schema validator. See the README.txt file in the xml-schemas folder for instructions on how to run either validator.
October 31: Added info on <include>ing components from a schema with no targetNamespace (read about the "Chameleon effect"). Added a new example - example14.1.
October 29: Added info on redefining components in an included schema using the <redefine> element. (<redefine> is pretty cool!) Added two new examples - example14.2, 14.3.
October 28: With permission from Henry Thompson, I have bundled the schema validator, xsv, with the tutorial package. Thus, you will be able to start validating schemas right out of the box!
October 21: Added info on the <unique> and <keyref> elements. Added two new examples (example26, 27) to demonstrate uniqueness and keyref.
October 15: Added info on the <key> element. Added two new examples (example23, 24) to demonstrate keys.
October 14: Added info on the union simple type. Updated the datatype to facet mapping table.
October 7: First release of the tutorial updated to the latest working draft (September 22).
September 22: There is a discussion on xml-dev on XML Schemas: Best Practices. I have recorded that thread and added it to the tutorial. Also, I added a note to those Win95 users. Those users will need to increase their DOS window memory size in order to use my batch files. I explain in my note how to do that.
September 16: Added slides on capturing the semantics of the elements and types that a schema creates (slides were submitted by Mary Pulvermacher. Thanks Mary!). Added info on ur-type.
September 11: The tutorial now comes bundled with the Apache schema validator, xerces-1.2.0. Thus, you will be able to download this tutorial and start schema validating your XML files straight "out of the box"!!! Please see the README.txt for a description of how to do validation using my batch files. In addition, I have created two more labs, added info an
, and have clarified a lot of stuff.
September 9: Created a README.txt file that describes how to set up your directory structure to enable you to use my batch files (I know, this is really, really long overdue). I have added more material on type substitutability, on abstract types, and on blocking element substitution. Also, I have made my batch files pretty solid. They now catch a lot of user errors.
September 5: More reorganization. Created some batch files to make it easy to run all the exercises and labs.
September 4: Reorganized everything! Fixed a lot of typos. Changed from using Oracle's validator to xerces 1.2.
August 26: Added info on creating a schema with no namespace. Created example22 to demonstrate this.
August 12: Added a validator batch file that may be used to run Oracle's schema validator. Added info about import and version. Added example21 to show the import element.
August 5: Added info on declaring elements to contain a list of values (i.e., the list type); created a new example for showing the list type; added info on the include element, plus an example of how to use it; fixed and clarified a bunch of stuff from xml-schemas1.ppt
July 29: Modified Symbol Space and elementFormDefault info; added material on the block attribute; added material on abstract types; added material on using multiple schemas in an instance document; added examples 17 and 18.
July 15: Added xml-schemas2.ppt which contains a tutorial on scoping of element names, pros and cons of qualified vs unqualified for elementFormDefault, and type substitutability. Added two new examples, 15 and 16. Fixed some typos Made changes suggested by Francis Norton and Rick Jelliffe. (Thanks!)
July 9: Initial release of tutorial containing xml-schema1.ppt, 14 examples, 11 labs.