Examples from Chapter 24 of The XML Bible, 2nd Edition: Schemas
Listing 24-1: greeting.xsd
Listing 24-2: valid_greeting.xml
Listing 24-3: invalid_greeting.xml
Listing 24-4: yesiam.xml
Listing 24-5: song.xsd
Listing 24-6: hotcop.xml
Listing 24-7: minOccurs and maxOccurs
Listing 24-8: Taking advantage of the default values of minOccurs and maxOccurs
Listing 24-9: A deeper hierarchy
Listing 24-10: Defining separate ComposerType and ProducerType types
Listing 24-11: Using a single PersonType for both COMPOSER and PRODUCER
Listing 24-12: Anonymous types
Listing 24-13: Mixed content
Listing 24-14: Declaring mixed content in a schema
Listing 24-15: A song document that places the elements in a different order
Listing 24-16: A schema with simple data types
Listing 24-17: fixed hotcop.xml
Listing 24-18: A schema that defines a custom money type
Listing 24-19: The PHOTO element has several attributes of different types
Listing 24-20: A SONG schema that declares attributes
Listing 24-20: A SONG document in the http://ibiblio.org/xml/namespace/song namespace
Listing 24-22: A schema for SONG documents in the http://ibiblio.org/xml/namespace/song namespace
Listing 24-23: A SONG document in the http://ibiblio.org/xml/namespace/song namespace with prefixes
Listing 24-24: A SONG document that uses XLink to embed photos
Listing 24-25: An XLink schema
Listing 24-26: A SONG schema that imports the XLink schema
Copyright 1999, 2001
Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified March 10, 2001