30.07.2013 Views

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 18 Extensible Markup Language (XML) 865<br />

Fig. 18.15 XML Valida<strong>to</strong>r displaying an error message.<br />

18.5.2 Microsoft XML Schemas<br />

In this section, we introduce an alternative <strong>to</strong> DTDs—called Schemas—for defining XML<br />

document structures. Many developers in the XML community feel that DTDs are not flexible<br />

enough <strong>to</strong> meet <strong>to</strong>day’s programming needs. For example, DTDs cannot be manipulated<br />

(e.g., searched, programmatically modified, etc.) in the same manner that XML<br />

documents can, because DTDs are not XML documents.<br />

Unlike DTDs, Schemas do not use Extended Backus-Naur Form (EBNF) grammar.<br />

Instead, Schemas are XML documents that can be manipulated (e.g., elements can be added<br />

or removed, etc.) like any other XML document. As with DTDs, Schemas require validating<br />

parsers.<br />

In this section, we focus on Microsoft’s XML Schema vocabulary. 2 Figure 18.16 presents<br />

an XML document that conforms <strong>to</strong> the Microsoft Schema document shown in<br />

Figure 18.17. By convention, Microsoft XML Schema documents use the file extension<br />

.xdr. Line 6 (Fig. 18.16) references the Schema document book.xdr.<br />

1 <br />

2<br />

3 <br />

4 <br />

5<br />

6 <br />

7 <br />

8 C# <strong>How</strong> <strong>to</strong> <strong>Program</strong><br />

9 <br />

10<br />

11 <br />

12 Java <strong>How</strong> <strong>to</strong> <strong>Program</strong>, 4/e<br />

13 <br />

Fig. 18.16 XML document that conforms <strong>to</strong> a Microsoft Schema document (part 1 of 2).<br />

2. For those readers who are interested in W3C Schema, we provide such examples on our Web site,<br />

www.deitel.com. We also provide a detailed treatment of W3C Schema in XML <strong>How</strong> <strong>to</strong> <strong>Program</strong>,<br />

2/e.

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

Saved successfully!

Ooh no, something went wrong!