<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:isan="http://www.isan.org/ISAN/isan"
    xmlns:common="http://www.isan.org/schema/v1.1/common/common"
    xmlns:title="http://www.isan.org/schema/v1.1/common/title" 
    xmlns:language="http://www.isan.org/schema/v1.1/common/language" 
    xmlns:participant="http://www.isan.org/schema/v1.1/common/participant" 
    xmlns:country="http://www.isan.org/schema/v1.1/common/country"
    xmlns:externalid="http://www.isan.org/schema/v1.1/common/externalid"
    xmlns:serial="http://www.isan.org/schema/v1.1/common/serial" 
    xmlns="http://www.isan.org/schema/v1.1/mlISANEpisodeWork" 
    targetNamespace="http://www.isan.org/schema/v1.1/mlISANEpisodeWork" 
    elementFormDefault="qualified">
    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/XML.xsd"/>
    <xs:import namespace="http://www.isan.org/ISAN/isan" schemaLocation="http://www.isan.org/ISAN/isan.xsd"/>
    <xs:import namespace="http://www.isan.org/schema/v1.1/common/title" schemaLocation="http://www.isan.org/schema/v1.1/common/title.xsd"/>   
    <xs:import namespace="http://www.isan.org/schema/v1.1/common/language" schemaLocation="http://www.isan.org/schema/v1.1/common/language.xsd"/>
    <xs:import namespace="http://www.isan.org/schema/v1.1/common/country" schemaLocation="http://www.isan.org/schema/v1.1/common/country.xsd"/>
    <xs:import namespace="http://www.isan.org/schema/v1.1/common/common" schemaLocation="http://www.isan.org/schema/v1.1/common/common.xsd"/>
    <xs:import namespace="http://www.isan.org/schema/v1.1/common/externalid" schemaLocation="http://www.isan.org/schema/v1.1/common/externalid.xsd"/>
    <xs:import namespace="http://www.isan.org/schema/v1.1/common/participant" schemaLocation="http://www.isan.org/schema/v1.1/common/participant.xsd"/>
    
    <xs:import namespace="http://www.isan.org/schema/v1.1/common/serial" schemaLocation="http://www.isan.org/schema/v1.1/common/serial.xsd"/>
    <xs:annotation>
        <xs:appinfo>ISAN Episode Work XML Schema V 1.0</xs:appinfo>
        <xs:documentation>
            Copyright © 2003-2008 ISAN International Agency
            Date: 2008-01-30
            Last Update: 2008-03-06
            Based on  ISAN Work registration Web Services WSDL, to use  for massive load of ISAN Episode Work</xs:documentation>
    </xs:annotation>
    <xs:element name="ISANWorkCatalogue" type="ISANWorkCatalogueType"/>
    <xs:complexType name="ISANWorkCatalogueType">
        
        <xs:annotation>
            <xs:documentation>
                ISANWorkCatalogue is a sequence of two elements : RegistrantLogin and WorkMetadataList
                RegistrantLogin: the registrant login name
                WorkMetadataList: list of work metadata
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="RegistrantLogin" type="RegistrantLoginType"/>
            <xs:element name="WorkMetadataList" type="WorkMetadataListType"/>
        </xs:sequence>
        
    </xs:complexType>
    <xs:simpleType name="RegistrantLoginType">
        <xs:restriction base="xs:string">
            <xs:maxLength value="10"/>
           <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="WorkMetadataListType">
        <xs:sequence>
            <xs:annotation>
                
                <xs:documentation>
                    The WorkMetadata element contains all the metadata to define an ISAN episode work, relevant for ISAN registration or presentation
                </xs:documentation>
            </xs:annotation>
            <xs:element name="WorkMetadata" type="WorkMetadataType" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="WorkMetadataType">
        <xs:sequence>
            
            <xs:element name="ISAN"  minOccurs="0"  type="isan:isanType"/>
            <xs:element name="Type" type="WorkTypeType"/>
            <xs:element name="Kind" type="WorkKindType" />
            <xs:element name="ExternalIdList" type="externalid:ExternalIdListType"  />
            <xs:element name="TitleList" type="title:TitleListType"/>
            <xs:element name="YearOfReference" type="common:YearType"/>
            <xs:element name="YearOfFirstPublication" minOccurs="0" type="common:YearType"/>
            <xs:element name="Duration" type="common:DurationType"  />
            <xs:element name="ColorKind" type="common:ColorType" />
            <xs:element name="OriginalLanguageList" type="OriginalLanguageListType" />
            <xs:element name="ReferenceCountryList" minOccurs="0" type="ReferenceCountryListType"/>
            <xs:element name="ParticipantList" type="participant:ParticipantListType"/>
            <xs:element name="CompanyList" minOccurs="0" type="CompanyListType"/>
            <xs:element name="EpisodeDetails" type="serial:EpisodeDetailType"/>
            <xs:element name="CompositeList" minOccurs="0" type="CompositeListType"/>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="WorkTypeType">
        
        <xs:annotation>
            <xs:documentation xml:lang="EN">
                AD : Commercials / Advertising film / Trailers | Works which promotes a product, service, idea, person or company, including promotional material for consumer products, services shown in theaters and infomercials.Also concerns trailers (promotional advertising for a film or television production).
                CO : Compilation | 1 - A single featured work packaged with several related works (e.g. the traditional DVD with bonus features)- each work in the compilation would have its own Work record. | 2 - A Boxed Set made of two or more featured works in a single package- South Park Season One, Indiana Jones Trilogy, etc… - each work in the Boxed Set Should have its own Work Record
                DO : Documentary | A moving image production providing a factual archive or report depicting persons, animals, vegetables and plants, events or industrial processes.
                ED : Educational | Works restricted to traditional training, coursework, classroom or distance learning. Such works are primarily intended to educate rather than entertain.
                FF : Feature Film | Work, usually originally released theatrically or direct to video.
                GA : Video Game | Game composed of a computer-controlled virtual universe that players may interact with in order to achieve a goal.
                LV : Live Event | All non fiction works recording live events except related to sport or performances which have their own types. Examples include extensive coverage of political conventions, talk shows, live recordings of political debates, elections, space coverage, marriage, funerals, etc…
                MM : Multimedia | Audiovisual work with interactivity.
                NE : News | An audio visual production which reports on topics of current interest. Non fiction programming, reporting and commentary on current events, usually organized into reports from various correspondents.
                PF : Performance | Works documenting a performance including concerts, dance, music, opera, stage production, recitation, magic, circus, stand-up comedy, burlesque, vaudeville or other variety stage act. Performance is a subset of live event (LV).
                SE : Dramatic and Comedy Series, Serials, "Soaps" | A set of fiction works often with the same main actors or on related subjects and open-ended television drama or comedy where the story continues from episode to episode.
                SH : Short | Fiction work, usually originally released theatrically or direct to video, with an original length less than feature film. This includes short animated works.
                SP : Sporting Event, Sports Related Program | Non fiction productions reporting on sporting events. Sport is a subset of live event (LV).
                TE : Other Television entertainment | Programming intended for airing on television including reality programs, magazines, variety, game shows, except where otherwise categorized.
                TF : TV movie or Telefilm | A work intended for television broadcast.
                VC : Music Video Clip. | Short audiovisual non live production which shows images related to a specific sound recording.
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:enumeration value="AD"/>
            <xs:enumeration value="CO"/>
            <xs:enumeration value="DO"/>
            
            <xs:enumeration value="ED"/>
            <xs:enumeration value="FF"/>
            <xs:enumeration value="GA"/>
            <xs:enumeration value="LV"/>
            <xs:enumeration value="MM"/>
            <xs:enumeration value="NE"/>
            <xs:enumeration value="PF"/>
            <xs:enumeration value="SE"/>
            <xs:enumeration value="SH"/>
            
            <xs:enumeration value="SP"/>
            <xs:enumeration value="TE"/>
            <xs:enumeration value="TF"/>
            <xs:enumeration value="VC"/>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="WorkKindType">
        <xs:annotation>
            <xs:documentation xml:lang="EN">
                
                A : Animation | Refers to sequence of 2D or 3D artwork images that create an illusion of movement. The artwork can be of any kind, from the traditionally animated hand-drawings to the newest 3D animation realized with computers. 
                L : Live Action | Refers to works that are acted out by human and / or where the scenery is real. 
                LA : Live Action and Animation | Refers to works where both animated characters or elements and real actors coexist. For example: Mary Poppins, 1964 directed by Robert Stevenson or Who Framed Roger Rabbit ,1988 directed by Rober t Zemeckis (live action) and Richard Williams (animation) 
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:enumeration value="A"/>
            <xs:enumeration value="L"/>             
            <xs:enumeration value="LA"/>           
        </xs:restriction>
    </xs:simpleType>
    
    <xs:complexType name="OriginalLanguageListType">
        
        <xs:sequence>
            <xs:element name="OriginalLanguage" type="language:LanguageType" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="ReferenceCountryListType">
        <xs:sequence>
            <xs:element name="ReferenceCountry"  maxOccurs="unbounded"  type="ReferenceCountryType"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="ReferenceCountryType">
        <xs:sequence>
            <xs:element name="Country" type="country:CountryType" />
            <xs:element name="RelatedAction"  type="RelatedActionCodeType"/>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="RelatedActionCodeType">
        <xs:restriction base="xs:string">
            <xs:annotation>
                
                <xs:documentation xml:lang="EN">
                    PRO : Production Location
                    PUB : Publication Location
                    SHO : Shooting Location
                </xs:documentation>
            </xs:annotation>
            <xs:enumeration value="PRO"/>          
            <xs:enumeration value="PUB"/>         
            <xs:enumeration value="SHO"/>           
        </xs:restriction>
    </xs:simpleType>
    
    <xs:complexType name="CompanyListType">
        <xs:sequence>
            
            <xs:element name="Company" maxOccurs="unbounded" type="CompanyType"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="CompanyType">
        <xs:choice>
            <xs:sequence>
                <xs:element name="CompanyKind" type="CompanyRoleCodeType"/>
                <xs:element name="CompanyName" type="CompanyNameType"/>
            </xs:sequence>
            
            <xs:sequence>
                <xs:element name="CompanyId" type="common:IdType" />
                <xs:element name="CompanyKind" minOccurs="0" type="CompanyRoleCodeType"/>
                <xs:element name="CompanyName" minOccurs="0" type="CompanyNameType"/>
            </xs:sequence>
        </xs:choice>
    </xs:complexType>
    <xs:simpleType name="CompanyRoleCodeType">
        <xs:restriction base="xs:string">
            
            <xs:annotation>
                <xs:documentation xml:lang="EN">
                    PRO : Production Company
                    PUB : Publication Company
                </xs:documentation>
            </xs:annotation>
            <xs:enumeration value="PRO"/>
            <xs:enumeration value="PUB"/>
        </xs:restriction>
    </xs:simpleType>
    
    
    <xs:simpleType name="CompanyNameType">
        <xs:restriction base="xs:string">
            <xs:maxLength value="100"/>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:complexType name="CompositeListType">
        <xs:sequence>
            <xs:element name="ISAN" type="isan:isanType"  maxOccurs="unbounded"/>
        </xs:sequence>
        
    </xs:complexType>
    
</xs:schema>
