Hour7.Using XML Schema


Hour 7. Using XML Schema

Any good strategy will seem ridiculous by the time it is implemented.

Scott Adams (cartoonist, creator of Dilbert)

Back in Hour 3, "Defining Data with DTD Schemas," you learned how to describe a custom markup language using a DTD. Although DTDs can certainly get the job done, a more modern alternative is available for describing XML-based markup languages. This alternative is called XML Schema, and schemas developed using XML Schema are known as XSDs. Getting back to the Scott Adams quote, some XML developers have argued that maybe there is a shred of Dilbert ridiculousness to XML Schema given the complexity of the resulting code involved in creating an XSD. The W3C (World Wide Web Consortium) initially set out to improve upon DTDs by developing a schema technology that was based on XML. The end result is known as the XML Schema Definition Language, or XSD, which is now an official W3C standard. XSD schemas are used similarly to DTDs in that they provide a means of defining a custom markup language and validating XML documents. However, XSDs are considerably more powerful than DTDs and give you much finer control over the design of markup languages. As with many technologies, power and flexibility adds complexity, so you'll find that XSD schemas are generally a bit larger and more complex than DTDs. This hour introduces you to XML Schema and shows you how to create XSD schemas that can be used to validate your own documents.

In this hour, you'll learn

  • The basics of XML Schema

  • How to use elements and attributes in XSD schemas

  • How to work with simple and complex data types

  • How to build a complete XSD schema and use it to validate a document




Sams Teach Yourself XML in 24 Hours
Sams Teach Yourself XML in 24 Hours, Complete Starter Kit (3rd Edition)
ISBN: 067232797X
EAN: 2147483647
Year: 2005
Pages: 266

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net