O'Reilly logo

Inside XML by Steven Holzner

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

W3C XML Schemas

Most of this chapter will center on an example document, book.xml, and its accompanying schema, book.xsd (.xsd is the extension that W3C uses by convention for schema files). This example is all about recording the books loaned by one person, Doug Glass, and borrowed by another, Britta Regensburg. I record the name and address of the borrower and lender, as well as data about the actual books borrowed, including their titles, publication date, replacement value, and maximum number of days that the book may be loaned for. Here's what book.xml looks like:

 <?xml version="1.0"?> <transaction borrowDate="2001-10-15"> <Lender phone="607.555.2222"> <name>Doug Glass</name> <street>416 Disk Drive</street> <city>Medfield</city> <state>MA</state> ...

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