<?xml version="1.0" encoding="UTF-8"?>
<!-- 
	Mobile Broadcast - Service Guide Delivery Descriptor
		version 	- 1.0
		date    	- 25 April 2007

    FILE INFORMATION

	OMA Permanent Document
	   File: OMA-SUP-XSD_bcast_sg_sgdd-V1_0-20070425-D 
	   Type: Text - Schema Description

	Public Reachable Information
	   Path: http://www.openmobilealliance.org/tech/profiles
	   Name: bcast_sg_sgdd-v1_0.xsd

    NORMATIVE INFORMATION

	Information about this file can be found in the specification
	    OMA-TS-BCAST_ServiceGuide-V1_0
	available at http://www.openmobilealliance.org/

	Send comments to technical-comments@mail.openmobilealliance.org

    LEGAL DISCLAIMER

	Use of this document is subject to all of the terms and conditions
	of the Use Agreement located at
		http://www.openmobilealliance.org/UseAgreement.html

	You may use this document or any part of the document for internal
	or educational purposes only, provided you do not modify, edit or
	take out of context the information in this document in any manner.
	Information contained in this document may be used, at your sole
	risk, for any purposes.

	You may not use this document in any other manner without the prior
	written permission of the Open Mobile Alliance.  The Open Mobile
	Alliance authorizes you to copy this document, provided that you
	retain all copyright and other proprietary notices contained in the
	original materials on any copies of the materials and that you
	comply strictly with these terms.  This copyright permission does
	not constitute an endorsement of the products or services.  The
	Open Mobile Alliance assumes no responsibility for errors or
	omissions in this document.

	Each Open Mobile Alliance member has agreed to use reasonable
	endeavors to inform the Open Mobile Alliance in a timely manner of
	Essential IPR as it becomes aware that the Essential IPR is related
	to the prepared or published specification.  However, the members
	do not have an obligation to conduct IPR searches.  The declared
	Essential IPR is publicly available to members and non-members of
	the Open Mobile Alliance and may be found on the "OMA IPR
	Declarations" list at http://www.openmobilealliance.org/ipr.html.
	The Open Mobile Alliance has not conducted an independent IPR review
	of this document and the information contained herein, and makes no
	representations or warranties regarding third party IPR, including
	without limitation patents, copyrights or trade secret rights.  This
	document may contain inventions for which you must obtain licenses
	from third parties before making, using or selling the inventions.
	Defined terms above are set forth in the schedule to the Open Mobile
	Alliance Application Form.

	NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
	MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
	OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE "OMA
	IPR DECLARATIONS" LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
	COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR
	NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.

	THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
	DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
	EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
	DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.

	Copyright 2007 Open Mobile Alliance Ltd.  All Rights Reserved.
	Used with the permission of the Open Mobile Alliance Ltd. under the
	terms set forth above.
-->
<!-- 
	CHANGE HISTORY
	
	20060807 	File created
	20061222	OMA-BCAST-2006-1081R02 implemented
	20070125	CR OMA-BCAST-2007-0121-CR_Updates_to_SGDD_XML_Schema implemented
						- made consistent with OMA-TS-BCAST_Service_Guide-V1_0_0-20070104-D
						- added range check to the type of BSMFilterCode
	20070404 	made consistent with OMA-TS-BCAST_Service_Guide-V1_0_0-20070329-D
	20070410 	CR BCAST-2007-0440 implemented 
					to make consistent with OMA-TS-BCAST_Service_Guide-V1_0_0-20070405-D after followup consistency review. 
	20070417 	CR BCAST-2007-0362R01 implemented 
	20070423 	CR BCAST-2007-0440R01 implemented to make consistent with OMA-TS-BCAST_Service_Guide-V1_0_0-20070421-D. 
	20070425	Version to enter Candidate approval. 
					Clerical: made naming consistent with OMNA rules
					Consistent with OMA-TS-BCAST_Service_Guide-V1_0-20070421-D
-->
<xs:schema xmlns="urn:oma:xml:bcast:sg:sgdd:1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:roam="urn:oma:xml:bcast:roaming:frontend:1.0" targetNamespace="urn:oma:xml:bcast:sg:sgdd:1.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- Importing xml default declarations (like xml:lang and xml:space) -->
	<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
	<xs:import namespace="urn:oma:xml:bcast:roaming:frontend:1.0" schemaLocation="http://www.openmobilealliance.org/tech/profiles/bcast_roaming_frontend-V1_0.xsd"/>
	<!--
	======================================
	Service Guide Delivery Descriptor 
	=======================================
	-->
	<xs:element name="ServiceGuideDeliveryDescriptor" type="ServiceGuideDeliveryDescriptorType"/>
	<xs:complexType name="ServiceGuideDeliveryDescriptorType">
		<xs:sequence>
			<xs:element name="NotificationReception" type="NotificationReceptionType" minOccurs="0"/>
			<xs:element name="BSMList" minOccurs="0">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="BSMSelector" type="BSMSelectorType" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="DescriptorEntry" type="DescriptorEntryType" maxOccurs="unbounded"/>
			<xs:element name="PrivateExt" type="PrivateExtType" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:anyURI" use="optional"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<xs:complexType name="PrivateExtType">
		<xs:sequence>
			<xs:annotation>
				<xs:documentation>
					This container provides the place for proprietary and application-specific extensions. 
					Extensions SHALL use a different namespace.
				</xs:documentation>
			</xs:annotation>
			<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<!--
	======================================
	NotificationReception sub-type
	=======================================
	-->
	<xs:complexType name="NotificationReceptionType">
		<!-- 
			this construct implements the constraint: 
			"at least one of the elements <IPBroadcastDelivery>, <RequestURL>, or <PollURL> SHALL be present." 
		-->
		<xs:choice>
			<xs:sequence>
				<xs:element name="IPBroadcastDelivery">
					<xs:complexType>
						<xs:attribute name="port" type="xs:unsignedInt" use="required"/>
						<xs:attribute name="address" type="xs:string" use="required"/>
					</xs:complexType>
				</xs:element>
				<xs:element name="RequestURL" type="xs:anyURI" minOccurs="0"/>
				<xs:element name="PollURL" type="xs:anyURI" minOccurs="0"/>
			</xs:sequence>
			<xs:sequence>
				<xs:element name="RequestURL" type="xs:anyURI"/>
				<xs:element name="PollURL" type="xs:anyURI" minOccurs="0"/>
			</xs:sequence>
			<xs:sequence>
				<xs:element name="PollURL" type="xs:anyURI"/>
			</xs:sequence>
		</xs:choice>
	</xs:complexType>
	<!--
	======================================
	BSMSelector sub-type
	=======================================
	-->
	<!--
		The type of bsmFilterCode. 
		1 – BSMCode (Smart Card Code) 
		This is used if the determination is made based on the country and operator code in the (U)SIM/(R-)UIM/CSIM
		2 – BSMCode (Non Smart Card Code):
		This is used if the determination is made based on the country and operator code in the terminal
		Other values are reserved.
	-->
	<xs:simpleType name="BFCRangeType">
		<xs:restriction base="xs:unsignedByte">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="2"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="BSMSelectorType">
		<xs:sequence>
			<xs:element name="BSMFilterCode" minOccurs="0">
				<xs:complexType>
					<xs:attribute name="type" type="BFCRangeType" use="required"/>
					<xs:attribute name="mobileCountryCode" type="xs:integer" use="optional"/>
					<xs:attribute name="mobileNetworkCode" type="xs:integer" use="optional"/>
					<xs:attribute name="networkSubsetCode" type="xs:integer" use="optional"/>
					<xs:attribute name="networkSubsetCodeRangeStart" type="xs:integer" use="optional"/>
					<xs:attribute name="networkSubsetCodeRangeEnd" type="xs:integer" use="optional"/>
					<xs:attribute name="serviceProviderCode" type="xs:byte" use="optional"/>
					<xs:attribute name="corporateCode" type="xs:byte" use="optional"/>
					<xs:attribute name="nonSmartCardCode" type="xs:string" use="optional"/>
				</xs:complexType>
			</xs:element>
			<xs:element name="Name" type="LanguageString" maxOccurs="unbounded"/>
			<xs:element name="RoamingRule" type="roam:RoamingRuleType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:anyURI" use="required"/>
		<xs:attribute name="roamingRuleRequestAddress" type="xs:anyURI" use="optional"/>
	</xs:complexType>
	<xs:complexType name="LanguageString">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute ref="xml:lang" use="optional"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<!--
	======================================
	DescriptorEntry sub-type
	=======================================
	-->
	<xs:complexType name="DescriptorEntryType">
		<xs:sequence>
			<xs:element name="GroupingCriteria" type="GroupingCriteriaType" minOccurs="0"/>
			<xs:element name="Transport" type="TransportType" minOccurs="0"/>
			<xs:element name="AlternativeAccessURL" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ServiceGuideDeliveryUnit" type="ServiceGuideDeliveryUnitType" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="GroupingCriteriaType">
		<xs:sequence>
			<xs:element name="TimeGroupingCriteria" type="TimeGroupingCriteriaType" minOccurs="0"/>
			<xs:element name="GenreGroupingCriteria" type="GenreType" minOccurs="0">
			</xs:element>
			<xs:element name="BSMSelector" type="BSMSelectorIDRefType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ServiceCriteria" type="xs:anyURI" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="TimeGroupingCriteriaType">
		<xs:attribute name="startTime" type="xs:unsignedInt" use="required"/>
		<xs:attribute name="endTime" type="xs:unsignedInt" use="required"/>
	</xs:complexType>
	<xs:complexType name="BSMSelectorIDRefType">
		<xs:attribute name="idRef" type="xs:anyURI" use="required"/>
	</xs:complexType>
	<!-- Genre -->
	<xs:simpleType name="GenreTypeType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="main"/>
			<xs:enumeration value="secondary"/>
			<xs:enumeration value="other"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="GenreType">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="type" type="GenreTypeType" use="optional"/>
				<xs:attribute name="href" type="xs:anyURI" use="optional"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="TransportType">
		<xs:attribute name="ipAddress" type="xs:string" use="required"/>
		<xs:attribute name="port" type="xs:unsignedShort" use="required"/>
		<xs:attribute name="srcIpAddress" type="xs:string" use="optional"/>
		<xs:attribute name="transmissionSessionID" type="xs:unsignedShort" use="required"/>
		<xs:attribute name="versionIDLength" type="xs:unsignedLong" use="optional"/>
		<xs:attribute name="hasFDT" type="xs:boolean" default="true" use="optional"/>
	</xs:complexType>
	<xs:complexType name="ServiceGuideDeliveryUnitType">
		<xs:sequence>
			<xs:element name="Fragment" type="FragmentType" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="transportObjectID" type="xs:unsignedInt" use="required"/>
		<xs:attribute name="contentLocation" type="xs:anyURI" use="required"/>
		<xs:attribute name="validFrom" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="validTo" type="xs:unsignedInt" use="optional"/>
	</xs:complexType>
	<xs:complexType name="FragmentType">
		<xs:sequence>
			<xs:element name="GroupingCriteria" minOccurs="0">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="TimeGroupingCriteria" type="TimeGroupingCriteriaType" minOccurs="0"/>
						<xs:element name="BSMSelector" type="BSMSelectorIDRefType" minOccurs="0" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="transportID" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="id" type="xs:anyURI" use="required"/>
		<xs:attribute name="version" type="xs:unsignedInt" use="required"/>
		<xs:attribute name="validFrom" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="validTo" type="xs:unsignedInt" use="optional"/>
		<xs:attribute name="fragmentEncoding" type="FragmentEncodingType" use="required"/>
		<xs:attribute name="fragmentType" type="FragmentTypeType" use="optional"/>
	</xs:complexType>
	<!--
	Encoding of a Service Guide fragment
	0 – XML encoded OMA BCAST Service Guide fragment
	1 – SDP fragment 
	2 –  MBMS User Service Description as specified in [26.346] (see 5.1.2.4, SessionDescriptionReference)
	3 – XML encoded Associated Delivery Procedure as specified in [BCAST10-Distribution] section 5.3.4.
	4-127 – reserved for future BCAST extensions
	128-255 – available for proprietary extensions
	-->
	<xs:simpleType name="FragmentEncodingType">
		<xs:union memberTypes="FragmentEncodingLRType ReservedProprietaryExtByteRangeType"/>
	</xs:simpleType>
	<xs:simpleType name="FragmentEncodingLRType">
		<xs:restriction base="xs:unsignedByte">
			<xs:minInclusive value="0"/>
			<xs:maxExclusive value="3"/>
		</xs:restriction>
	</xs:simpleType>
	<!--
	Type of an XML encoded BCAST Service Guide fragment
	0 – unspecified
	1 – ‘Service’ Fragment
	2 – ‘Content’ fragment
	3 – ‘Schedule’ Fragment
	4 – ‘Access’ Fragment
	5 – ‘PurchaseItem’ Fragment
	6 – ‘PurchaseData’ Fragment
	7– ‘PurchaseChannel’ Fragment
	8 – ‘PreviewData’ Fragment
	9 – ‘InteractivityData’ Fragment
	10-127 – reserved for BCAST extensions 
	128-255 – available for proprietary extensions
	-->
	<xs:simpleType name="FragmentTypeType">
		<xs:union memberTypes="FragmentTypeLRType ReservedProprietaryExtByteRangeType"/>
	</xs:simpleType>
	<xs:simpleType name="FragmentTypeLRType">
		<xs:restriction base="xs:unsignedByte">
			<xs:minInclusive value="0"/>
			<xs:maxExclusive value="9"/>
		</xs:restriction>
	</xs:simpleType>
	<!--
	======================================
	SGResponse for interactive SGDD delivery
	=======================================
	-->
	<xs:element name="SGResponse" type="SGResponseType"/>
	<xs:complexType name="SGResponseType">
		<xs:sequence>
			<xs:element name="ServiceGuideDeliveryDescriptor" type="ServiceGuideDeliveryDescriptorType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="PrivateExt" type="PrivateExtType" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="status" type="SGResponseStatusType" use="required"/>
	</xs:complexType>
	<xs:simpleType name="ReservedProprietaryExtByteRangeType">
		<xs:restriction base="xs:unsignedByte">
			<xs:minInclusive value="128"/>
			<xs:maxInclusive value="255"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- allowed status codes -->
	<xs:simpleType name="SGResponseStatusCodesType">
		<xs:restriction base="xs:unsignedByte">
			<xs:enumeration value="0"/>
			<xs:enumeration value="7"/>
			<xs:enumeration value="8"/>
			<xs:enumeration value="17"/>
			<xs:enumeration value="18"/>
			<xs:enumeration value="20"/>
			<xs:enumeration value="21"/>
			<xs:enumeration value="23"/>
			<xs:enumeration value="28"/>
			<xs:enumeration value="29"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SGResponseStatusType">
		<xs:union memberTypes="SGResponseStatusCodesType ReservedProprietaryExtByteRangeType"/>
	</xs:simpleType>
</xs:schema>
