O'Reilly logo

Special Edition Using XML, Second Edition by - et al. David Gulbransen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Associating Schemas with XML Documents

There are a number of elements described by the XML Schemas: Structures Recommendation that are designed to link XML Schemas to the XML instance documents with which they are to be used in conjunction. Those elements have actually been given their own namespace:

http://www.w3.org/2001/XMLSchema-instance

The XML Instance namespace is a very important one, even though it does not contain many elements. It is how you associate an XML Schema with a document.

Let's look at a very simple schema and an XML document. This will simply be a document for storing a person's name and telephone number. Our schema might look something like this:

 <?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required