home *** CD-ROM | disk | FTP | other *** search
/ XML Bible (2nd Edition) / XML_Bible_Second_Edition_Hungry_Minds_2001.iso / mac / source / 24 / 24-20.xsd < prev    next >
Extensible Markup Language  |  2001-04-14  |  2KB  |  68 lines

  1. <?xml version="1.0"?>
  2. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  3.  
  4.   <xsd:element name="SONG" type="SongType"/>
  5.  
  6.   <xsd:complexType name="PhotoType">
  7.     <xsd:attribute name="SRC"    type="xsd:anyURI"
  8.                    use="required" />
  9.     <xsd:attribute name="WIDTH"  type="xsd:positiveInteger"
  10.                    use="required" />
  11.     <xsd:attribute name="HEIGHT" type="xsd:positiveInteger"
  12.                    use="required" />
  13.     <xsd:attribute name="ALT"    type="xsd:string"
  14.                    use="required" />
  15.   </xsd:complexType>
  16.  
  17.   <xsd:complexType name="SongType">
  18.     <xsd:sequence>
  19.       <xsd:element name="TITLE"     type="xsd:string"/>
  20.       <xsd:element name="PHOTO"     type="PhotoType"/>
  21.       <xsd:element name="COMPOSER"  type="PersonType"
  22.                    maxOccurs="unbounded"/>
  23.       <xsd:element name="PRODUCER"  type="PersonType"
  24.                    minOccurs="0" maxOccurs="unbounded"/>
  25.       <xsd:element name="PUBLISHER" type="xsd:string"
  26.                    minOccurs="0"/>
  27.       <xsd:element name="LENGTH"    type="xsd:duration"/>
  28.       <xsd:element name="YEAR"      type="xsd:gYear"/>
  29.       <xsd:element name="ARTIST"    type="xsd:string"
  30.                    maxOccurs="unbounded"/>
  31.       <xsd:element name="PRICE" type="money"/>
  32.     </xsd:sequence>
  33.   </xsd:complexType>
  34.  
  35.   <xsd:simpleType name="money">
  36.     <xsd:restriction base="xsd:string">             
  37.       <xsd:pattern value="\p{Sc}\p{Nd}+(\.\p{Nd}\p{Nd})?"/>
  38.       <!--
  39.          Regular Expression:
  40.          \p{Sc}             Any Unicode currency indicator;
  41.                             e.g., $, ¥, £, &#A4, etc.
  42.          \p{Nd}             A Unicode decimal digit character
  43.          \p{Nd}+            One or more Unicode decimal digits
  44.          \.                 The period character
  45.          (\.\p{Nd}\p{Nd})
  46.          (\.\p{Nd}\p{Nd})?  Zero or one strings of the form .35
  47.   
  48.          This works for any decimalized currency.
  49.   
  50.       -->
  51.     </xsd:restriction>
  52.   </xsd:simpleType>
  53.  
  54.   <xsd:complexType name="PersonType">
  55.     <xsd:sequence>
  56.       <xsd:element name="NAME">
  57.         <xsd:complexType>
  58.           <xsd:all>
  59.             <xsd:element name="GIVEN"  type="xsd:string"/>
  60.             <xsd:element name="FAMILY" type="xsd:string"/>
  61.           </xsd:all>
  62.         </xsd:complexType>
  63.       </xsd:element>
  64.     </xsd:sequence>
  65.   </xsd:complexType>
  66.  
  67. </xsd:schema>
  68.