02.06.2013 Views

XML Demystified

XML Demystified

XML Demystified

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER<br />

4<br />

<strong>XML</strong> Schema<br />

As we discussed in Chapter 3, a parser is software you use to extract data from an<br />

<strong>XML</strong> document. However, before it does this, the parser must learn about the <strong>XML</strong><br />

tags used to describe data in the document.<br />

The parser has no way of knowing the <strong>XML</strong> tags unless you tell it what they are<br />

by creating a document type definition (DTD), which you learned how to do in<br />

Chapter 3. A DTD describes the structure of the <strong>XML</strong> document by defining <strong>XML</strong><br />

tags used in the document and relationships among these tags.<br />

However, there is another way you can describe the structure of an <strong>XML</strong><br />

document: You can create an <strong>XML</strong> schema. An <strong>XML</strong> schema does everything a<br />

DTD does and more, which is why many developers have switched to using it. In<br />

this chapter, you’ll learn how to take advantage of an <strong>XML</strong> schema in your<br />

application.<br />

Copyright © 2005 by The McGraw-Hill Companies. Click here for terms of use.<br />

51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!