Download CD Content
In This Chapter
Viewing XML Schemas using the XMLSPY Schema Editor
Designing and building your first XML Schema
Understanding XML Schema syntax and language constructs
The XML Schema specification,with all its power and flexibility, is considerably more complicated in syntax than DTDs. The XML Schema specification takes up about 200 pages of documentation, and entire books have been written about the XML Schema. DTDs, on the other hand, don’t even have a dedicated specification. They are documented by a small section within the XML 1.0 specification. So although it may have been quite easy to write a DTD in Text view, in practice it is considerably more difficult to create any non-trivial XML Schema without the help of an XML Schema Editor. In this chapter, I walk you through using XMLSPY’s built-in XML Schema Editor. The Editor supports viewing and editing XML Schemas based on the W3C’s final recommendation of May 2, 2001.
This chapter begins by having you view an XML Schema in XMLSPY’s Schema Design view. You become familiar with navigating the user interface and also learn about the various controls and options. Then, you use the XML Schema Editor to create a sample XML Schema, which you can use to edit and validate XML documents. Finally, you turn your attention to the technical syntax of XML Schemas as I review the important XML Schema constructs and how to edit them by hand. (The discussion on XML Schema syntax continues in the next chapter on advanced XML Schema development.) By the end of this chapter, you should have a solid understanding of XML Schemas so that you can effectively create and work with ones that are fairly sophisticated and complex.