home *** CD-ROM | disk | FTP | other *** search
/ XML Bible (2nd Edition) / XML_Bible_Second_Edition_Hungry_Minds_2001.iso / mac / source / 24 / 24-18.xsd < prev    next >
Extensible Markup Language  |  2001-04-14  |  2KB  |  56 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:simpleType name="money">
  7.     <xsd:restriction base="xsd:string">             
  8.       <xsd:pattern value="\p{Sc}\p{Nd}+(\.\p{Nd}\p{Nd})?"/>
  9.       <!--
  10.          Regular Expression:
  11.          \p{Sc}             Any Unicode currency indicator;
  12.                             e.g., $, ¥, £, &#A4, etc.
  13.          \p{Nd}             A Unicode decimal digit character
  14.          \p{Nd}+            One or more Unicode decimal digits
  15.          \.                 The period character
  16.          (\.\p{Nd}\p{Nd})
  17.          (\.\p{Nd}\p{Nd})?  Zero or one strings of the form .35
  18.   
  19.          This works for any decimalized currency.
  20.   
  21.       -->
  22.     </xsd:restriction>
  23.   </xsd:simpleType>
  24.  
  25.   <xsd:complexType name="SongType">
  26.     <xsd:sequence>
  27.       <xsd:element name="TITLE"     type="xsd:string"/>
  28.       <xsd:element name="COMPOSER"  type="PersonType"
  29.                    maxOccurs="unbounded"/>
  30.       <xsd:element name="PRODUCER"  type="PersonType"
  31.                    minOccurs="0" maxOccurs="unbounded"/>
  32.       <xsd:element name="PUBLISHER" type="xsd:string"
  33.                    minOccurs="0"/>
  34.       <xsd:element name="LENGTH"    type="xsd:duration"/>
  35.       <xsd:element name="YEAR"      type="xsd:gYear"/>
  36.       <xsd:element name="ARTIST"    type="xsd:string"
  37.                    maxOccurs="unbounded"/>
  38.       <xsd:element name="PRICE" type="money" maxOccurs="1"/>
  39.     </xsd:sequence>
  40.   </xsd:complexType>
  41.  
  42.   <xsd:complexType name="PersonType">
  43.     <xsd:sequence>
  44.       <xsd:element name="NAME">
  45.         <xsd:complexType>
  46.           <xsd:all>
  47.             <xsd:element name="GIVEN"  type="xsd:string"/>
  48.             <xsd:element name="FAMILY" type="xsd:string"/>
  49.           </xsd:all>
  50.         </xsd:complexType>
  51.       </xsd:element>
  52.     </xsd:sequence>
  53.   </xsd:complexType>
  54.  
  55. </xsd:schema>
  56.