<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:cablelabs:md:xsd:offer:3.0"
	xmlns:core="urn:cablelabs:md:xsd:core:3.0" targetNamespace="urn:cablelabs:md:xsd:offer:3.0"
	elementFormDefault="qualified" attributeFormDefault="unqualified" version="1">
	<xsd:import namespace="urn:cablelabs:md:xsd:core:3.0" schemaLocation="MD-SP-CORE-C01.xsd"/>
	<!-- Import for xml:lang and xml:space -->
	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
		schemaLocation="http://www.w3.org/2001/xml.xsd"/>
	<xsd:simpleType name="ProviderContentTierType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">Value used to determine target market and/or systems.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="core:NonEmptyStringType">
			<xsd:maxLength value="256"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="BillingIdType">
		<xsd:annotation>
			<xsd:documentation>Typically a 5-character alphanumeric string used by billing systems.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="core:NonEmptyStringType">
			<xsd:pattern value="[0-9A-Za-z]{5}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="CategoryPathType">
		<xsd:annotation>
			<xsd:documentation>Value denoting a path in the target catalog (may be localized to a target language).</xsd:documentation>
		</xsd:annotation>
		<xsd:simpleContent>
			<xsd:extension base="core:NonEmptyStringType">
				<xsd:attribute ref="xml:lang" use="optional"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>
	<xsd:complexType name="CategoryType">
		<xsd:annotation>
			<xsd:documentation>An asset type used to group one or more category paths.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="core:AssetType">
				<xsd:sequence>
					<xsd:element name="CategoryPath" type="CategoryPathType" minOccurs="0" maxOccurs="unbounded">
						<xsd:annotation>
							<xsd:documentation>A localizable path of category values that are used by the end system to put an offer or title into the catalog.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
				<xsd:attribute name="typeOfCategoryPath" type="core:NonEmptyStringType">
					<xsd:annotation>
						<xsd:documentation>Option type of the category path, either regular (detault if omitted) or "Service_Category" or "Guide_Category".</xsd:documentation>
					</xsd:annotation>
				</xsd:attribute>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:complexType name="DeliveryTiersType">
		<xsd:annotation>
			<xsd:documentation>Delivery Tier Type is used to control when and where the content can be delivred.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="DeliveryTier" minOccurs="0" maxOccurs="unbounded">
				<xsd:annotation>
					<xsd:documentation>One or more Delivery Tier elemets may be supplied to mangaed the delivery of the  content.</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="Locales" minOccurs="0">
							<xsd:annotation>
								<xsd:documentation>Optional list of locales. Can be constrained to specific MVPDs and/or regions. If omitted or empty, no constraints exist for distribution.</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType>
								<xsd:sequence>
									<xsd:element name="MVPD" minOccurs="0" maxOccurs="unbounded">
										<xsd:annotation>
											<xsd:documentation>Optiional list of MVPDs. MVPD controls are typically used between a programmer/content provider and an expert agent that be used to distribute content to MVPDs.</xsd:documentation>
										</xsd:annotation>
										<xsd:complexType>
											<xsd:sequence>
												<xsd:element name="Regions" type="RegionsType"
												minOccurs="0">
												<xsd:annotation>
												<xsd:documentation>Specific regions within the MVPD footprint. (ZIP:, DMA:, OTHER:)</xsd:documentation>
												</xsd:annotation>
												</xsd:element>
											</xsd:sequence>
											<xsd:attribute name="name" type="core:URIIdType"
												use="required">
												<xsd:annotation>
												<xsd:documentation>URI for the MVPD.</xsd:documentation>
												</xsd:annotation>
											</xsd:attribute>
										</xsd:complexType>
									</xsd:element>
									<xsd:element name="Regions" type="RegionsType" minOccurs="0">
										<xsd:annotation>
											<xsd:documentation>Optional list of regions to deliver to. (ZIP:, DMA:, OTHER:)</xsd:documentation>
										</xsd:annotation>
									</xsd:element>
									<xsd:element name="Ext" type="core:ExtType" minOccurs="0"/>
								</xsd:sequence>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="Formats" minOccurs="0">
							<xsd:annotation>
								<xsd:documentation>Optional list of formats to deliver. If omitteed, delivery all available formats.</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType>
								<xsd:sequence>
									<xsd:element name="Format" maxOccurs="unbounded">
										<xsd:annotation>
											<xsd:documentation>Describes the asset format should be used for this offer. (HD, SD, 3D, OTHER:)</xsd:documentation>
										</xsd:annotation>
										<xsd:complexType>
											<xsd:sequence>
												<xsd:element name="Resolution"
												type="core:ResolutionType" minOccurs="0">
												<xsd:annotation>
												<xsd:documentation>480i|720p|1080i|1080p|private:.+</xsd:documentation>
												</xsd:annotation>
												</xsd:element>
												<xsd:element name="ThreeDMode"
												type="core:ThreeDModeType" minOccurs="0">
												<xsd:annotation>
												<xsd:documentation>See description in CORE</xsd:documentation>
												</xsd:annotation>
												</xsd:element>
												<xsd:element name="Ext" type="core:ExtType"
												minOccurs="0"/>
											</xsd:sequence>
											<xsd:anyAttribute namespace="##any"
												processContents="lax">
												<xsd:annotation>
												<xsd:documentation>In addition to the attributes defined, an asset may include additional, custom attributes as needed by the application.</xsd:documentation>
												</xsd:annotation>
											</xsd:anyAttribute>
										</xsd:complexType>
									</xsd:element>
								</xsd:sequence>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="Platforms" minOccurs="0">
							<xsd:annotation>
								<xsd:documentation>Describes which platforms content may appear on STB for QAM, XTV/ISO/ Andrioid/XFV for IP. If omitteed, all platforms are eligible to receive the content.</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType>
								<xsd:sequence>
									<xsd:element name="Platform" maxOccurs="unbounded">
										<xsd:complexType>
											<xsd:sequence>
												<xsd:element name="PlatformClass">
												<xsd:annotation>
												<xsd:documentation>Describes what platform class the delivery tier applies to. (TITLE VI, WEB, MOBILE, private:)</xsd:documentation>
												</xsd:annotation>
												<xsd:simpleType>
												<xsd:restriction base="xsd:string">
												<xsd:pattern value="TITLEVI|WEB|MOBILE|private:.+"
												/>
												</xsd:restriction>
												</xsd:simpleType>
												</xsd:element>
												<xsd:element name="PlatformSubClass" minOccurs="0"
												maxOccurs="unbounded">
												<xsd:annotation>
												<xsd:documentation>Describes which platform subslass content may appear on. IOS or Android . </xsd:documentation>
												</xsd:annotation>
												<xsd:simpleType>
												<xsd:restriction base="xsd:string">
												<xsd:pattern value="IOS|ANDROID|DL2GO|private:.+"
												/>
												</xsd:restriction>
												</xsd:simpleType>
												</xsd:element>
											</xsd:sequence>
										</xsd:complexType>
									</xsd:element>
								</xsd:sequence>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="Ext" type="core:ExtType" minOccurs="0"/>
					</xsd:sequence>
					<xsd:attribute name="name" type="core:NonEmptyStringType">
						<xsd:annotation>
							<xsd:documentation>A name to assign to the delivery tier. The value should be unique within the offer.</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="description" type="core:NonEmptyStringType">
						<xsd:annotation>
							<xsd:documentation>An optional decription of the delivery tier.  </xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attributeGroup ref="core:EffectiveDatesDayTimeAttributeGroup"/>
					<xsd:anyAttribute namespace="##any" processContents="lax">
						<xsd:annotation>
							<xsd:documentation>In addition to the attributes defined, an asset may include additional, custom attributes as needed by the application.</xsd:documentation>
						</xsd:annotation>
					</xsd:anyAttribute>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="Ext" type="core:ExtType" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="PresentationType">
		<xsd:annotation>
			<xsd:documentation>Provides presentation instructions specific to the VOD offer used to determine menu layout and corresponding UI items.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="CategoryRef" type="core:AssetRefType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Reference to a categorypath set.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="DisplayAsNew" type="xsd:duration" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>The duration of time after the startDateTime that this offer should be presented as "New" or similar.  This element MUST be explicitly provided if the presentation originated as V3.0.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="DisplayAsLastChance" type="xsd:duration" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>The duration of time before the endDateTime that this offer should be presented as "Last Chance" or similar.  This element MUST be explicitly provided if the presentation originated as V3.0.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="Priority" type="PresentationPriorityType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>An integer from 1 (high) to  10 (low) that can be used to determine the presentation priority within a category</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="Ext" type="core:ExtType" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="RegionsType">
		<xsd:sequence>
			<xsd:element name="Region" maxOccurs="unbounded">
				<xsd:complexType>
					<xsd:simpleContent>
						<xsd:extension base="core:NonEmptyStringType">
							<xsd:attribute name="regionType">
								<xsd:annotation>
									<xsd:documentation>The type of the region. DMA, ZIP, private:</xsd:documentation>
								</xsd:annotation>
								<xsd:simpleType>
									<xsd:restriction base="core:NonEmptyStringType">
										<xsd:pattern value="DMA|ZIP|private:.+"/>
									</xsd:restriction>
								</xsd:simpleType>
							</xsd:attribute>
						</xsd:extension>
					</xsd:simpleContent>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="Ext" type="core:ExtType" minOccurs="0"/>
		</xsd:sequence>
		<xsd:attribute name="inclusive" type="xsd:boolean">
			<xsd:annotation>
				<xsd:documentation>Set to TRUE to only distriubte to the list of regions. Set to FALSE to distirbute to all regions except those listed.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:anyAttribute namespace="##any" processContents="lax">
			<xsd:annotation>
				<xsd:documentation>In addition to the attributes defined, an asset may include additional, custom attributes as needed by the application.</xsd:documentation>
			</xsd:annotation>
		</xsd:anyAttribute>
	</xsd:complexType>
	<xsd:complexType name="ContentGroupType">
		<xsd:annotation>
			<xsd:documentation>An asset type used to group a title with one or more media assets.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="core:AssetType">
				<xsd:sequence>
					<xsd:element name="TitleRef" type="core:AssetRefType" minOccurs="0"/>
					<xsd:choice minOccurs="0" maxOccurs="unbounded">
						<xsd:element name="MovieRef" type="core:AssetRefType"/>
						<xsd:element name="PreviewRef" type="core:AssetRefType"/>
						<xsd:element name="PosterRef" type="core:AssetRefType"/>
						<xsd:element name="BoxCoverRef" type="core:AssetRefType"/>
						<xsd:element name="ThumbnailRef" type="core:AssetRefType"/>
						<xsd:element name="BarkerRef" type="core:AssetRefType"/>
						<xsd:element name="ContentRef" type="core:AssetRefBaseType"/>
					</xsd:choice>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:complexType name="OfferType">
		<xsd:annotation>
			<xsd:documentation>An asset type combining all of the components needed to display and deliver a VOD product; including presentation, terms and content.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="core:AssetType">
				<xsd:sequence>
					<xsd:element name="Presentation" type="PresentationType" minOccurs="0" maxOccurs="unbounded">
						<xsd:annotation>
							<xsd:documentation>Presentation options for this offer.  Note that an offer is not required to have a presentation; that is it may not be presented in the catalog.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="PromotionalContentGroupRef" type="core:AssetRefType" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>A content group used for promotional purposes only.  This may represent a title for a movie trilogy, TV series or some other promotional package.  It is expected that this group will contain a title, still images and previews, but may not contain the movies themselves.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="ProviderContentTier" type="ProviderContentTierType" minOccurs="0" maxOccurs="unbounded">
						<xsd:annotation>
							<xsd:documentation>Used by the distribution system to determine the target market and/or systems for this particular offer.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="DeliveryTiers" type="DeliveryTiersType" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Used by the distribution system to control delivery for this particular offer.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="ProviderLibraryModel" type="core:NonEmptyStringType"
						minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Used by the distribution system to control delivery for this particular offer. This typically links to some agreement between the provider and the distributor. The definition of a specific value is out of scope of this specification.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="SourceMetadataSpecVersion" type="core:DeprecatedStringType" minOccurs="0"/>
					<xsd:element name="BillingId" type="BillingIdType" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>A billing ID used for this offer (in ADI1.1 this was a 5-character alphanumeric string).</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="TermsRef" type="core:AssetRefType" minOccurs="0" maxOccurs="unbounded">
						<xsd:annotation>
							<xsd:documentation>A reference to terms for this offer.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="ContentGroupRef" type="core:AssetRefType" minOccurs="0" maxOccurs="unbounded">
						<xsd:annotation>
							<xsd:documentation>A reference to one or more content groups for this offer.</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:simpleType name="PresentationPriorityType">
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="1"/>
			<xsd:maxInclusive value="10"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:element name="Category" type="CategoryType"/>
	<xsd:element name="ContentGroup" type="ContentGroupType"/>
	<xsd:element name="DeliveryTiers" type="DeliveryTiersType"/>
	<xsd:element name="Offer" type="OfferType"/>
</xsd:schema>
