Sams Teach Yourself XML in 21 Days
- Table of Contents
- About the Author
- Acknowledgments
- We Want to Hear from You!
- Introduction
- Part I: At a Glance
- Day 1. Welcome to XML
- Day 2. Creating XML Documents
- Day 3. Creating Well-Formed XML Documents
- Day 4. Creating Valid XML Documents: DTDs
- Declaring Attributes in DTDs
- Day 6. Creating Valid XML Documents: XML Schemas
- Day 7. Creating Types in XML Schemas
- Restricting Simple Types by Using XML Schema Facets
- Creating XML Schema Choices
- Using Anonymous Type Definitions
- Declaring Empty Elements
- Declaring Mixed-Content Elements
- Grouping Elements Together
- Grouping Attributes Together
- Declaring all Groups
- Handling Namespaces in Schemas
- Annotating an XML Schema
- Summary
- Q&A
- Workshop
- Part I. In Review
- Day 8. Formatting XML by Using Cascading Style Sheets
- Day 9. Formatting XML by Using XSLT
- Day 10. Working with XSL Formatting Objects
- Part II. In Review
- Part III: At a Glance
- Day 11. Extending HTML with XHTML
- Day 12. Putting XHTML to Work
- Day 13. Creating Graphics and Multimedia: SVG and SMIL
- Day 14. Handling XLinks, XPointers, and XForms
- Part III. In Review
- Part IV: At a Glance
- Day 15. Using JavaScript and XML
- Day 16. Using Java and .NET: DOM
- Day 17. Using Java and .NET: SAX
- Day 18. Working with SOAP and RDF
- Part IV. In Review
- Part V: At a Glance
- Day 19. Handling XML Data Binding
- Day 20. Working with XML and Databases
- Day 21. Handling XML in .NET
- Part V. In Review
- Appendix A. Quiz Answers
Day 7. Creating Types in XML Schemas
Yesterday you got started with XML schemas and heard about some of the basics. Today, you're going to continue with XML schemas, getting a true working knowledge of the subject. Here's an overview of the topics covered today:
- Creating restrictions
- Creating simple types by using facets
- Using anonymous types
- Declaring empty elements
- Declaring mixed-content elements
- Declaring choices
- Grouping elements
- Grouping attributes
- Declaring all groups
- Using namespaces in schemas
- Annotating schemas
As you're going to see today, XML schemas give you many options that DTDs don't. Some of what you're going to see was designed for convenience, such as declaring element and attribute groups so you can use such groups throughout a schema; some of the things we'll talk about, such as empty elements and choices, have analogs in DTDs; and things we'll talk about today, such as anonymous types and facets, give you functionality you don't find in DTDs.
Restricting Simple Types by Using XML Schema Facets | Next Section

Account Sign In
View your cart