<?xml version="1.0" encoding="UTF-8"?>
<!--
            XDM - XDCP Document
	    version - 1.0
	    date    - 03 Apr 2012

     FILE INFORMATION

         OMA Permanent Document
	    File: OMA-SUP-XSD_xdm_xdcp-V1_0-20120403-A
	    Type: Text - Schema description

         Public Reachable Information
	    Path: http://www.openmobilealliance.org/tech/profiles
	    Name: xdm_xdcp-v1_0.xsd

     NORMATIVE INFORMATION

    Information about this file can be found in the latest revision of the specification
	OMA-TS-XDM_Core-V2_1 
    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,
  provided, however, that section (d) under "Documents - Terms 
  of Use" which states, "no modifications are made to such 
  Documents" does not apply to your use.
  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 2012 Open Mobile Alliance Ltd.  All Rights Reserved.
  Used with the permission of the Open Mobile Alliance Ltd. under the
  terms set forth above.

-->

<xs:schema targetNamespace="urn:oma:xml:xdm:xdcp"
	xmlns="urn:oma:xml:xdm:xdcp"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:xml="http://www.w3.org/XML/1998/namespace"
	xmlns:rls="urn:ietf:params:xml:ns:resource-lists"
	xmlns:filter="urn:ietf:params:xml:ns:simple-filter"
	elementFormDefault="qualified" attributeFormDefault="unqualified">
    
	<!-- This import brings in the XML language attribute xml:lang -->
	<xs:import namespace="http://www.w3.org/XML/1998/namespace"
		schemaLocation="http://www.w3.org/2001/xml.xsd"/>
        
	<!-- This import brings in the ietf defined "resource-lists" XML Schema-->
	<xs:import namespace="urn:ietf:params:xml:ns:resource-lists"
        schemaLocation="resource-lists.xsd"/>
    

	<!-- This import brings in the ietf defined "simple-filter" XML schema -->
	<xs:import  namespace="urn:ietf:params:xml:ns:simple-filter"
        schemaLocation="simple-filter.xsd"/>


	<!-- The root "xdcp-document" element -->

	
	<xs:element name="xdcp-document">
		<xs:complexType>
			<xs:choice>
				<xs:element name="request" type="requestType" />
				<xs:element name="response" type="responseType" />
			</xs:choice>
		</xs:complexType>
	</xs:element>

	<xs:complexType name="requestType">
		<xs:sequence>
			<xs:choice>
				<xs:element name="diff-read" type="diffReadType" />
				<xs:element name="diff-write" type="diffWriteType" />
				<xs:element name="forward" type="forwardType" />
				<xs:element name="forward-accept"
					type="forwardAcceptType" />
				<xs:element name="forward-delivery-report"
					type="forwardDeliveryReportType" />
				<xs:element name="forward-reject"
					type="forwardRejectType" />
				<xs:element name="forward-remote"
					type="forwardRemoteType" />
				<xs:element name="remove-doc-ref"
					type="removeDocRefType" />
				<xs:element name="restore" type="restoreType" />
				<xs:element name="retrieve-doc-ref"
					type="retrieveDocRefType" />
				<xs:element name="set-doc-ref" type="docRefType" />
				<xs:element name="subscribe" type="subscribeType" />
				<xs:any namespace="##other" processContents="lax" />
			</xs:choice>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="diffReadType">
		<xs:sequence>
			<xs:element name="etag" type="xs:string" minOccurs="0"
				maxOccurs="1" />
			<xs:element ref="filter:filter-set" minOccurs="0"
				maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="diffWriteType">
		<xs:sequence>
			<xs:element ref="filter:filter-set" minOccurs="0"
				maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="docRefType">
		<xs:sequence>
			<xs:element name="reference" type="xs:anyURI" />
			<xs:element name="display-name" type="xs:string"
				minOccurs="0" maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="removeDocRefType"></xs:complexType>

	<xs:complexType name="restoreType">
		<xs:sequence>
			<xs:element name="back-to-etag" type="xs:string" />
			<xs:element name="current-etag" type="xs:string"
				minOccurs="0" maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="retrieveDocRefType"></xs:complexType>

	<xs:complexType name="forwardType">
		<xs:sequence>
			<xs:element name="recipients-list" type="rls:listType" />
			<xs:element name="note" type="xs:string" minOccurs="0"
				maxOccurs="1" />
			<xs:element name="expiration-time" type="xs:duration"
				minOccurs="0" maxOccurs="1" />
			<xs:element ref="filter:filter-set" minOccurs="0"
				maxOccurs="1" />
			<xs:element name="display-name" type="xs:string"
				minOccurs="0" maxOccurs="1" />
			<xs:element name="delivery-report" type="xs:boolean"
				minOccurs="0" maxOccurs="1" />
			<xs:element name="request-id" type="xs:string" minOccurs="0"
				maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="forwardRemoteType">
		<xs:sequence>
			<xs:element name="document-uri" type="xs:anyURI" />
			<xs:element name="note" type="xs:string" minOccurs="0"
				maxOccurs="1" />
			<xs:element name="size" type="xs:integer" minOccurs="0"
				maxOccurs="1" />
			<xs:element name="sender-identity" type="xs:anyURI" />
			<xs:element name="display-name" type="xs:string"
				minOccurs="0" maxOccurs="1" />
			<xs:element name="expiration-time" type="xs:duration"
				minOccurs="0" maxOccurs="1" />
			<xs:element name="content-type" type="xs:string" />
			<xs:element name="recipients-list" type="rls:listType" />
			<xs:element name="delivery-report" type="xs:boolean"
				minOccurs="0" maxOccurs="1" />
			<xs:element name="request-id" type="xs:string" minOccurs="0"
				maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="forwardAcceptType">
		<xs:sequence>
			<xs:element name="document-uri" type="xs:anyURI" />
			<xs:choice minOccurs="0" maxOccurs="1">
				<xs:element name="do-not-store" type="emptyType" />
				<xs:element name="store">
					<xs:complexType>
						<xs:attribute name="udds" type="xs:anyURI" />
					</xs:complexType>
				</xs:element>
				<xs:any namespace="##other" processContents="lax"
					minOccurs="0" maxOccurs="unbounded" />
			</xs:choice>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="forwardDeliveryReportType">
		<xs:sequence>
			<xs:element name="request-id" type="xs:string" />
			<xs:element name="recipient-uri" type="xs:anyURI" />
			<xs:element name="status">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="delivered" />
						<xs:enumeration value="rejected" />
						<xs:enumeration value="expired" />
						<xs:enumeration value="value"></xs:enumeration>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="forwardRejectType">
		<xs:sequence>
			<xs:element name="document-uri" type="xs:anyURI" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="subscribeType">
		<xs:sequence>
			<xs:element name="subscription">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="target-documents"
							type="targetDocumentsType" />
						<xs:element name="duration" type="xs:integer" />
						<xs:any namespace="##other"
							processContents="lax" minOccurs="0" maxOccurs="unbounded" />
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="notification">
				<xs:complexType>
					<xs:choice>
						<xs:element name="push">
							<xs:complexType>
								<xs:sequence>
									<xs:element name="push-address"
										type="xs:string" />
									<xs:element
										name="wap-application-id" type="xs:string" />
									<xs:element
										name="user-interaction-level" type="xs:string" />
									<xs:element
										name="preferred-notification-type" type="xs:string" />
									<xs:element name="gzip"
										type="emptyType" minOccurs="0" maxOccurs="1" />
									<xs:any namespace="##other"
										processContents="lax" minOccurs="0" maxOccurs="unbounded" />
								</xs:sequence>
							</xs:complexType>
						</xs:element>
						<xs:any namespace="##other"
							processContents="lax" />
					</xs:choice>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="targetDocumentsType">
		<xs:sequence minOccurs="1" maxOccurs="unbounded">
			<xs:choice>
				<xs:element name="resource-uri" type="listUriType" />
				<xs:element name="resource-list"
					type="resourceListType" />
				<xs:element name="list-uri" type="listUriType" />
			</xs:choice>

		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="listUriType">
		<xs:sequence>
			<xs:element name="uri" type="xs:anyURI" minOccurs="1"
				maxOccurs="unbounded" />
			<xs:element ref="filter:filter-set" minOccurs="0"
				maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="resourceListType">
		<xs:sequence>
			<xs:element name="list" type="rls:listType" minOccurs="1"
				maxOccurs="unbounded" />
			<xs:element ref="filter:filter-set" minOccurs="0"
				maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="responseType">
		<xs:sequence>
			<xs:choice>
				<!-- Successful responses -->
				<xs:element name="done" type="emptyType" />
				<xs:element name="done-new-etag" type="emptyType" />
				<xs:element name="forward-result"
					type="forwardResultType" />
				<xs:element name="new-etag-value" type="xs:string" />
				<xs:element name="remote-forward-result"
					type="forwardResultType" />
				<xs:element name="retrieve-doc-ref-result"
					type="docRefType" />

				<!-- Failure responses -->
				<xs:element name="application-usage-defined-conflict"
					type="applicationUsageDefinedConflictType" />
				<xs:element name="constraint-failure" type="emptyType" />
				<xs:element name="doc-ref-active" type="emptyType" />
				<xs:element name="etag-missing" type="emptyType" />
				<xs:element name="filter-set-not-allowed"
					type="emptyType" />
				<xs:element name="invalid-recipient" type="emptyType" />
				<xs:element name="invalid-request" type="emptyType" />
				<xs:element name="no-diff-document" type="emptyType" />
				<xs:element name="not-found" type="emptyType" />
				<xs:element name="not-latest-etag-value"
					type="emptyType" />
				<xs:element name="not-supported-request"
					type="emptyType" />
				<xs:element name="restore-version-not-found"
					type="emptyType" />
				<xs:element name="unknown-etag-value" type="emptyType" />
				<xs:element name="diff-write-conflict"
					type="diffWriteConflictType" />
				<xs:element name="xcdp-document-structure-not-ok"
					type="emptyType" />
				<xs:element name="other-conflict"
					type="otherConflictType" />
				<xs:any namespace="##other" processContents="lax" />
			</xs:choice>
			<xs:element name="display-text" type="xs:string"
				minOccurs="0" maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="applicationUsageDefinedConflictType">
		<xs:sequence>
			<xs:any namespace="##other" processContents="lax"
				minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
		<xs:attribute name="phrase" type="xs:string" />
	</xs:complexType>


	<xs:complexType name="diffWriteConflictType">
		<xs:choice>
			<xs:any namespace="##other" processContents="lax" />
			<!-- The element <patch-ops-error> from the namespace "urn:ietf:params:xml:ns:patch-ops-error",
				<xcap-error> element from the namespace"urn:ietf:params:xml:ns:xcap-error" or
				any other element from another namespace may be inserted here -->
		</xs:choice>
	</xs:complexType>

	<xs:complexType name="emptyType"></xs:complexType>


	<xs:complexType name="forwardResultType">
		<xs:sequence>
			<xs:element name="not-found-recipients-list"
				type="rls:listType" minOccurs="0" maxOccurs="1" />
			<xs:element name="not-authorized-recipients-list"
				type="rls:listType" minOccurs="0" maxOccurs="1" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="otherConflictType">
		<xs:sequence>
			<xs:any namespace="##other" processContents="lax"
				minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>
</xs:schema>