<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by John Cosnowski (MusicNet Inc.) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:annotation>
		<xs:documentation>Schema for MusicnetComponents</xs:documentation>
	</xs:annotation>
	<xs:annotation>
		<xs:documentation>The following simple type constraints are generated from database content</xs:documentation>
	</xs:annotation>
	<xs:include schemaLocation="CorpCode.xsd"/>
	<xs:include schemaLocation="RetailerCode.xsd"/>
	<xs:include schemaLocation="MetadataTypes.xsd"/>
	<xs:include schemaLocation="ArtistTypes.xsd"/>
	<xs:include schemaLocation="TerritoryCodes.xsd"/>
	<xs:include schemaLocation="CurrencyCodes.xsd"/>
	<xs:annotation>
		<xs:documentation>These includes introduce new complex types</xs:documentation>
	</xs:annotation>
	<xs:include schemaLocation="PriceType.xsd"/>
	<xs:include schemaLocation="RightsType.xsd"/>
	<xs:annotation>
		<xs:documentation>The complex type MusicnetComponent is main type that is present in MusicNet XML files.  The type MusicnetComponentBase describes all the possible content that can appear in any MusicNet component.
			(A union if you will.)  MusicnetComponent, MusicnetComponentParent and MusicnetComponentTrack are concrete types that restrict the base for specific component types.</xs:documentation>
	</xs:annotation>
	<xs:complexType name="MusicnetComponentBase" abstract="true">
		<xs:annotation>
			<xs:documentation>MUSICNET COMPONENT CODE root</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="MUSICNET_COMPONENT_CODE" type="MusicnetComponentCodeBase"/>
			<xs:element name="COMPONENT_TYPE" type="ComponentTypeBase"/>
			<xs:element name="COMPONENT_SUBTYPE" type="ComponentSubtypeBase" minOccurs="0"/>
			<xs:element name="CORP_CODE" type="CorpCode"/>
			<xs:element name="LABEL_CODE" type="xs:string"/>
			<xs:element name="RELATED_COMP_ID" type="xs:unsignedLong" minOccurs="0"/>
			<xs:element name="XML_FILE_NAME" type="xs:string" minOccurs="0"/>
			<xs:element name="EXCLUSIVE_RTLR_LIST" type="xs:string" minOccurs="0"/>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="STREAM_RIGHT" type="RightsType"/>
				<xs:element name="DOWNLOAD_RIGHT" type="RightsType"/>
				<xs:element name="CD_BURN_RIGHT" type="RightsType"/>
				<xs:element name="TRANSFER2PD_RIGHT" type="RightsType"/>
				<xs:element name="FREE_STREAM_RIGHT" type="RightsType"/>
				<xs:element name="DIGITAL_AVAILABILITY" type="DigitalAvailabilityType"/>
				<xs:element name="BUNDLE_RESTRICTION" type="RightsType"/>
				<xs:element name="LABEL_APPR_IND" type="ApprovalType"/>
				<xs:element name="PUBLISHER_APPR_IND" type="ApprovalType"/>
				<xs:element name="PUBLISHER_OVERRIDE_CODE" type="ApprovalOverrideType"/>
				<xs:element name="PUBLISH_OVERRIDE_CODE" type="ApprovalOverrideType"/>
				<xs:element name="NON_DRM_PURCHASE" type="RightsType"/>
				<xs:element name="NON_DRM_STREAM" type="RightsType"/>
			</xs:choice>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="METADATA" type="Metadata"/>
				<xs:element name="ARTIST" type="Artist"/>
			</xs:choice>
			<xs:element name="PRICE" type="Price" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="URL" type="Url" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="RENAME" type="Rename" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="MEMBER_OF" type="CollectionComponent" minOccurs="0" maxOccurs="unbounded"/>
			<xs:choice>
				<xs:element name="MUSICNET_COMPONENT" type="MusicnetComponentBase" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="COLLECTION_COMPONENT" type="CollectionComponent" minOccurs="0" maxOccurs="unbounded"/>
			</xs:choice>
			<!-- since label_code matching is case insensitive, validation is in precheck -->
		</xs:sequence>
		<xs:attribute name="action" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="MusicnetComponentParent">
		<xs:annotation>
			<xs:documentation>Parent compoent (i.e. component with zero or more children)</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:restriction base="MusicnetComponentBase">
				<xs:sequence>
					<xs:element name="MUSICNET_COMPONENT_CODE" type="MusicnetComponentCodeParent"/>
					<xs:element name="COMPONENT_TYPE" type="ComponentTypeParent"/>
					<xs:element name="COMPONENT_SUBTYPE" type="ComponentSubtypeBase" minOccurs="0"/>
					<xs:element name="CORP_CODE" type="CorpCode"/>
					<xs:element name="LABEL_CODE" type="xs:string"/>
					<xs:element name="XML_FILE_NAME" type="xs:string" minOccurs="0"/>
					<xs:element name="EXCLUSIVE_RTLR_LIST" type="xs:string" minOccurs="0"/>
					<xs:choice minOccurs="0" maxOccurs="unbounded">
						<xs:element name="STREAM_RIGHT" type="RightsType"/>
						<xs:element name="DOWNLOAD_RIGHT" type="RightsType"/>
						<xs:element name="CD_BURN_RIGHT" type="RightsType"/>
						<xs:element name="TRANSFER2PD_RIGHT" type="RightsType"/>
						<xs:element name="FREE_STREAM_RIGHT" type="RightsType"/>
						<xs:element name="DIGITAL_AVAILABILITY" type="DigitalAvailabilityType"/>
						<xs:element name="BUNDLE_RESTRICTION" type="RightsType"/>
						<xs:element name="LABEL_APPR_IND" type="ApprovalType"/>
						<xs:element name="PUBLISHER_APPR_IND" type="ApprovalType"/>
						<xs:element name="PUBLISHER_OVERRIDE_CODE" type="ApprovalOverrideType"/>
				        <xs:element name="PUBLISH_OVERRIDE_CODE" type="ApprovalOverrideType"/>
                        <xs:element name="NON_DRM_PURCHASE" type="RightsType"/>
                        <xs:element name="NON_DRM_STREAM" type="RightsType"/>
					</xs:choice>
					<xs:choice minOccurs="0" maxOccurs="unbounded">
						<xs:element name="METADATA" type="Metadata"/>
						<xs:element name="ARTIST" type="Artist"/>
					</xs:choice>
					<xs:element name="PRICE" type="Price" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="URL" type="Url" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="RENAME" type="Rename" minOccurs="0" maxOccurs="unbounded"/>
					<xs:choice>
						<xs:element name="MUSICNET_COMPONENT" type="MusicnetComponentTrack" minOccurs="0" maxOccurs="unbounded"/>
						<xs:element name="COLLECTION_COMPONENT" type="CollectionComponent" minOccurs="0" maxOccurs="unbounded"/>
					</xs:choice>
					<!-- since label_code matching is case insensitive, validation is in precheck -->
				</xs:sequence>
				<xs:attribute name="action" type="xs:string"/>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="MusicnetComponentTrack">
		<xs:annotation>
			<xs:documentation>Child component that is a TRACK</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:restriction base="MusicnetComponentBase">
				<xs:sequence>
					<xs:element name="MUSICNET_COMPONENT_CODE" type="MusicnetComponentCodeTrack"/>
					<xs:element name="COMPONENT_TYPE" type="ComponentTypeBase" fixed="TRACK"/>
					<xs:element name="COMPONENT_SUBTYPE" type="ComponentSubtypeBase" minOccurs="0"/>
					<xs:element name="CORP_CODE" type="CorpCode"/>
					<xs:element name="LABEL_CODE" type="xs:string"/>
					<xs:element name="XML_FILE_NAME" type="xs:string" minOccurs="0"/>
					<xs:element name="EXCLUSIVE_RTLR_LIST" type="xs:string" minOccurs="0"/>
					<xs:choice minOccurs="0" maxOccurs="unbounded">
						<xs:element name="STREAM_RIGHT" type="RightsType"/>
						<xs:element name="DOWNLOAD_RIGHT" type="RightsType"/>
						<xs:element name="CD_BURN_RIGHT" type="RightsType"/>
						<xs:element name="TRANSFER2PD_RIGHT" type="RightsType"/>
						<xs:element name="FREE_STREAM_RIGHT" type="RightsType"/>
						<xs:element name="DIGITAL_AVAILABILITY" type="DigitalAvailabilityType"/>
						<xs:element name="LABEL_APPR_IND" type="ApprovalType"/>
						<xs:element name="PUBLISHER_APPR_IND" type="ApprovalType"/>
						<xs:element name="PUBLISHER_OVERRIDE_CODE" type="ApprovalOverrideType"/>
				        <xs:element name="PUBLISH_OVERRIDE_CODE" type="ApprovalOverrideType"/>
                        <xs:element name="NON_DRM_PURCHASE" type="RightsType"/>
                        <xs:element name="NON_DRM_STREAM" type="RightsType"/>
					</xs:choice>
					<xs:choice minOccurs="0" maxOccurs="unbounded">
						<xs:element name="METADATA" type="Metadata"/>
						<xs:element name="ARTIST" type="Artist"/>
					</xs:choice>
					<xs:element name="PRICE" type="Price" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="URL" type="Url" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="RENAME" type="Rename" minOccurs="0" maxOccurs="unbounded"/>
			        <xs:element name="MEMBER_OF" type="CollectionComponent" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="MusicnetComponent">
		<xs:annotation>
			<xs:documentation>Components without children (i.e single component)</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:restriction base="MusicnetComponentBase">
				<xs:sequence>
					<xs:element name="MUSICNET_COMPONENT_CODE" type="MusicnetComponentCode"/>
					<xs:element name="COMPONENT_TYPE" type="ComponentType"/>
					<xs:element name="COMPONENT_SUBTYPE" type="ComponentSubtypeBase" minOccurs="0"/>
					<xs:element name="CORP_CODE" type="CorpCode"/>
					<xs:element name="LABEL_CODE" type="xs:string"/>
					<xs:element name="RELATED_COMP_ID" type="xs:unsignedLong" minOccurs="0"/>
					<xs:element name="XML_FILE_NAME" type="xs:string" minOccurs="0"/>
					<xs:element name="EXCLUSIVE_RTLR_LIST" type="xs:string" minOccurs="0"/>
					<xs:choice minOccurs="0" maxOccurs="unbounded">
						<xs:element name="STREAM_RIGHT" type="RightsType"/>
						<xs:element name="DOWNLOAD_RIGHT" type="RightsType"/>
						<xs:element name="CD_BURN_RIGHT" type="RightsType"/>
						<xs:element name="TRANSFER2PD_RIGHT" type="RightsType"/>
						<xs:element name="FREE_STREAM_RIGHT" type="RightsType"/>
						<xs:element name="DIGITAL_AVAILABILITY" type="DigitalAvailabilityType"/>
						<xs:element name="LABEL_APPR_IND" type="ApprovalType"/>
						<xs:element name="PUBLISHER_APPR_IND" type="ApprovalType"/>
						<xs:element name="PUBLISHER_OVERRIDE_CODE" type="ApprovalOverrideType"/>
        				<xs:element name="PUBLISH_OVERRIDE_CODE" type="ApprovalOverrideType"/>
                        <xs:element name="NON_DRM_PURCHASE" type="RightsType"/>
                        <xs:element name="NON_DRM_STREAM" type="RightsType"/>
					</xs:choice>
					<xs:choice minOccurs="0" maxOccurs="unbounded">
						<xs:element name="METADATA" type="Metadata"/>
						<xs:element name="ARTIST" type="Artist"/>
					</xs:choice>
					<xs:element name="PRICE" type="Price" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="URL" type="Url" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="RENAME" type="Rename" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
				<xs:attribute name="action" type="xs:string"/>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<xs:simpleType name="ComponentTypeBase">
		<xs:annotation>
			<xs:documentation>All of the possible component types</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="TRACK"/>
			<xs:enumeration value="ALBUM"/>
			<xs:enumeration value="MUSIC_VIDEO"/>
			<xs:enumeration value="TV_SERIES"/>
			<xs:enumeration value="TV_SHOW"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ComponentTypeParent">
		<xs:annotation>
			<xs:documentation>Component types that can be parent components (MusicnetComponentParent)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="ComponentTypeBase">
			<xs:enumeration value="ALBUM"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ComponentType">
		<xs:annotation>
			<xs:documentation>Component types the can single components (MusicnetComponent)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="ComponentTypeBase">
			<xs:enumeration value="MUSIC_VIDEO"/>
			<xs:enumeration value="TV_SHOW"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ComponentSubtypeBase">
		<xs:annotation>
			<xs:documentation>Sub types are ignored.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
	<xs:simpleType name="MusicnetComponentCodeBase">
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
	<xs:simpleType name="MusicnetComponentCode">
		<xs:restriction base="MusicnetComponentCodeBase">
			<xs:pattern value="([A-Z]|\d){6,18}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="MusicnetComponentCodeParent">
		<xs:restriction base="MusicnetComponentCodeBase">
			<xs:pattern value="([A-Z]|\d){12,24}|([A-Z]|\d){12,24}_\d{2}_\d{2}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="MusicnetComponentCodeTrack">
		<xs:restriction base="MusicnetComponentCodeBase">
			<xs:pattern value="([A-Z]|\d){12,24}_\d{2}_\d{2}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:annotation>
		<xs:documentation>Complex types used in the definition of a component.  Prices and rights are defined in their own xsd files</xs:documentation>
	</xs:annotation>
	<xs:complexType name="CollectionComponent">
		<xs:annotation>
			<xs:documentation>Describes a relationship with another component</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:choice minOccurs="1">
				<xs:element name="COMP_ID" type="xs:unsignedLong"/>
				<xs:element name="COMPONENT_CODE" type="xs:string"/>
			    <xs:element name="PROVIDER_COMP_ID" type="xs:string"/>
			</xs:choice>
			<xs:element name="SEQ_NBR" type="xs:unsignedLong"  minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="action" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="Metadata">
		<xs:sequence>
			<xs:element name="TYPE" type="MetadataType"/>
			<xs:element name="VALUE" type="xs:string"/>
			<xs:element name="TERRITORY_CODE" type="TerritoryCode" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="action" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="Artist">
		<xs:all>
			<xs:element name="TYPE" type="ArtistType"/>
			<xs:element name="AMG_ID" type="xs:string" minOccurs="0"/>
			<xs:element name="VALUE" type="xs:string"/>
		</xs:all>
		<xs:attribute name="action" type="xs:string"/>
	</xs:complexType>
	<xs:complexType name="Url">
		<xs:sequence>
			<xs:element name="TYPE" type="UrlType"/>
			<xs:element name="VALUE" type="xs:string"/>
		</xs:sequence>
		<xs:attribute name="action" type="xs:string"/>
	</xs:complexType>
	<xs:simpleType name="UrlType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="ARTIST"/>
			<xs:enumeration value="DISTRIBUTOR"/>
			<xs:enumeration value="LABEL"/>
			<xs:enumeration value="MISC"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="Rename">
		<xs:sequence>
			<xs:element name="OLD" type="xs:string"/>
			<xs:element name="NEW" type="xs:string"/>
		</xs:sequence>
		<xs:attribute name="repository" type="xs:string"/>
		<xs:attribute name="starting_directory" type="xs:string"/>
		<xs:attribute name="command_type" type="xs:string"/>
	</xs:complexType>
</xs:schema>
