Schema for Songs


<xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema">

  <xsd:annotation>
   <xsd:documentation>
    Song schema for XML and Java Example at SD2000 West
    Copyright 2000 Elliotte Rusty Harold. 
   </xsd:documentation>
  </xsd:annotation>
 
  <xsd:element name="SONG" type="songType"/>
 
  <xsd:complexType name="songType">
   <xsd:element name="TITLE" type="xsd:string"/>
   <xsd:element name="PHOTO" type="photoType" minOccurs="0" maxOccurs="1"/>
   <xsd:element name="COMPOSER" type="xsd:string" minOccurs="1" maxOccurs="*"/>
   <xsd:element name="PRODUCER" type="xsd:string" minOccurs="0" maxOccurs="*"/>
   <xsd:element name="PUBLISHER" type="publisherType" minOccurs="0" maxOccurs="1"/>
   <xsd:element name="LENGTH" type="xsd:string"/>
   <xsd:element name="YEAR" type="xsd:string"/>
   <xsd:element name="ARTIST" type="xsd:string" minOccurs="1" maxOccurs="*"/>
   <xsd:attribute name="xmlns" type="xsd:NMTOKEN" fixed="http://metalab.unc.edu/xml/namespace/song"/>
   <xsd:attribute name="xmlns:xlink" type="xsd:NMTOKEN" fixed="http://www.w3.org/1999/xlink"/>
  </xsd:complexType>
 
  <xsd:complexType name="photoType" content="empty">
   <xsd:attribute name="xlink:type" type="xsd:NMTOKEN" fixed="simple"/>
   <xsd:attribute name="xlink:show" type="xsd:NMTOKEN" fixed="embed"/>
   <xsd:attribute name="xlink:href" type="xsd:uri-reference" fixed="simple"/>
   <xsd:attribute name="ALT" type="xsd:string"/>
   <xsd:attribute name="WIDTH" type="xsd:positive-integer"/>
   <xsd:attribute name="HEIGHT" type="xsd:positive-integer"/>
  </xsd:complexType>
 
  <xsd:element name="publisher">
    <xsd:complexType base='xsd:string' derivedBy='extension'>
      <xsd:attribute name="xlink:type" type="xsd:NMTOKEN" fixed="simple"/>
      <xsd:attribute name="xlink:href" type="xsd:uri-reference" />
    </xsd:complexType>
  </xsd:element>
 
</xsd:schema>

Previous | Next | Top | Cafe con Leche

Copyright 2000 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified February 26, 2000