XML Schema defines the allowable content of a class of XML documents. In other words,
A schema specifies the elements that can be used in XML documents along with the structure that these elements must follow in order to be valid for that specific schema.
Schemas are XML files that typically have an .xsd file name extension.
Tip: Chapter 3 (Schemas in MSXML) in the book XML Application Development with MSXML 4.0 covers MSXML Schemas features in great details. Be sure to check out this book to learn about XDR/XSD validation using DOM and SAX.
When XML 1.0 became
a W3C specification, it contained a mechanism for constraining the allowable content of a
class of XML document through Document Type Definitions (DTDs). Very soon it was realized that
DTDs are not well suited for validating XML documents, because of reasons such as
the lack of datatypes, non-XML syntax, not very extensible, etc.
Tip: XDR or XML Data Reduced is an interim schema language offered by Microsoft to developers while the W3C worked on a draft implementation.
The W3C XML Schema Working Group was formed and was given a complex task of creating a schema
specification that would satisfy a broad range of users and permit future growth and extensibility. In
May 2001, W3C published the XML Schema Definition Language (XSD) recommended standard.
Tip: MSXML 4.0 supports both XML Schema (XSD) and XDR schema.
Today, Schemas are being used for many other purposes in addition to just validating (and restricting)
XML documents. For instance, smart editors use it for auto completion (intellisense), for serialization,
etc.
Check out XML Developer's Reference Guide for an example of XSD Validation using DOM.
MSXML Schemas Resources Around the Web
MSXML 3.0 Supports XPath 1.0, XSLT 1.0, XDR, and SAX2
XSD for Visual Basic Developers
MSXML Schema KB Articles
|