XML Schemas

Web Development 2 WEBD-2006

Jody Gillis & Kyle Geske

Red River College

Introduction

Metapizza

When creating or using markup it is important to ensure that our documents are valid.

With HTML we use the W3C validator to validate our markup. With XML we can validate our markup using an XML Schema Definition or XSD.

An XSD describes the structure of a specific XML document along with the data types of the document elements.

XML Schema Definitions are themselves written in XML. Such meta!

Objectives

Upon completion of this module, you should be able to:

Schema Syntax

Schemas are XML files that typically have an .xsd file name extension.

The root element of a schema typically looks like this.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

Alternative to XSD