<?xml version="1.0" encoding="UTF-8"?>

<!-- 
	XDM - 2.1 Extensions
	    version - 1.0
	    date    - 03 Apr 2012

    FILE INFORMATION

	OMA Permanent Document
	   File: OMA-SUP-XSD_xdm_2_1_extensions-V1_0-20120403-A
	   Type: Text - Schema Description

	Public Reachable Information
	   Path: http://www.openmobilealliance.org/tech/profiles
	   Name: xdm_2_1_extensions-V1_0.xsd

    NORMATIVE INFORMATION
    
    Information about this file can be found in 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/Use_Agreement.aspx
    
    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/AboutOMA/IPR.aspx 
    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:2.1extensions"
    xmlns="urn:oma:xml:xdm:2.1extensions"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:cp="urn:ietf:params:xml:ns:common-policy"
    xmlns:ext="urn:oma:xml:xdm:extensions"
    xmlns:geo="urn:ietf:params:xml:ns:pidf:geopriv10"
    xmlns:geoca="urn:ietf:params:xml:ns:pidf:geopriv10:civicAddr"
    elementFormDefault="qualified" attributeFormDefault="unqualified">

    <!-- This import brings in common policy namespace from RFC 4745 -->
    <xs:import namespace="urn:ietf:params:xml:ns:common-policy"
    schemaLocation="common-policy.xsd"/>

<!-- This import brings in geopriv10 namespace from RFC 4119 -->
    <xs:import namespace="urn:ietf:params:xml:ns:pidf:geopriv10"
    schemaLocation="geopriv10.xsd"/>
    
<!-- This import brings in geopriv10 Civiladdress namespace from RFC 5139 -->
    <xs:import namespace="urn:ietf:params:xml:ns:pidf:geopriv10:civicAddr"
    schemaLocation="civicAddr.xsd"/>

    
<!-- This import brings in xdm extensions namespace -->
    <xs:import namespace="urn:oma:xml:xdm:extensions"
    schemaLocation="http://www.openmobilealliance.org/tech/profiles/xdm_extensions-v1_0.xsd"/>

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- OMA specific XDM version 2.1 extensions to "common Policy" RFC 4745 -->
<!-- OMA specific "conditions" child elements -->

<xs:element name="upp-list" type="uppListType"/>

    <xs:element name="invited-identities" type="cp:identityType"/>


    <xs:element name="qoe-list">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="qoe" type="ext:qoeType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="country-region-list">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="civicAddress" type="restrictedCivicAddressType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="location-list">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="location-info" type="geo:locInfoType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="restrictedCivicAddressType">        
<!-- Only the types from the namespace "geoca:" for the "country", "A1" and "A2" element are reused. -->
        <xs:sequence>
            <xs:element name="country" type="geoca:iso3166a2" minOccurs="0"/>
            <xs:element name="A1" type="geoca:caType" minOccurs="0"/>
            <xs:element name="A2" type="geoca:caType" minOccurs="0"/>
        </xs:sequence>
            <xs:anyAttribute namespace="##any" processContents="lax"/>
    </xs:complexType>

    <xs:complexType name="uppListType">
        <xs:choice>
            <xs:sequence>
                <xs:element ref="upp" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:element name="all-upp-except">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element ref="upp" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>   
                </xs:complexType>
            </xs:element>
        </xs:choice>
    </xs:complexType>

    <xs:element name="upp">
        <xs:complexType>
            <xs:attribute name="upp-id" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="deferred-messages" type="extType"/>

    <xs:element name="expired" type="extType"/>
<!-- XDM version 2.1 add also the element <activities> element from the "urn:ietf:params:xml:ns:pidf:rpid" namespace as a possible child element-->


<!-- OMA specific "actions" child elements -->

    <xs:element name="allow-defer" type="xs:boolean"/>
    <xs:element name="allow-deliver-and-interwork">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="methods-list" type="methodsList"/>
                <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="execute" type="xs:boolean" use="required"/>
            <xs:anyAttribute namespace="##any" processContents="lax"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="allow-deliver-reference-media" type="xs:boolean"/>
    <xs:element name="allow-do-not-disturb" type="xs:boolean"/>
    <xs:element name="allow-forward">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="forward-to" type="xs:anyURI"/>
                <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                
            </xs:sequence>
            <xs:attribute name="execute" type="xs:boolean" use="required"/>
            <xs:anyAttribute namespace="##any" processContents="lax"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="allow-interwork">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="methods-list" type="methodsList"/>
                <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="execute" type="xs:boolean" use="required"/>
            <xs:anyAttribute namespace="##any" processContents="lax"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="allow-pull" type="xs:boolean"/> 
    <xs:element name="allow-push" type="xs:boolean"/> 
    <xs:element name="allow-store" type="xs:boolean"/>
    <xs:complexType name="methodsList">
        <xs:sequence>
            <xs:element name="method" minOccurs="1" maxOccurs="unbounded">
				<xs:complexType>
                <xs:simpleContent>
                    <xs:extension base="xs:string">
                        <xs:attribute name="priority" type="qvalue"/>
                    </xs:extension>
                </xs:simpleContent>
				</xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="qvalue">
       <xs:restriction base="xs:decimal">
         <xs:pattern value="0(.[0-9]{0,3})?"/>
         <xs:pattern value="1(.0{0,3})?"/>
       </xs:restriction>
     </xs:simpleType>

<!-- OMA specific "transformations" child elements -->
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- OMA specific XDM version 2.1 extensions to the XDM Capabilities Document -->
    <xs:element name="xdm-caps" type="xdmCapsType"/>

    <xs:complexType name="xdmCapsType">
        <xs:sequence>
            <xs:element name="au" type="auType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="subscribe" type="subscribeType" minOccurs="0"/>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="auType">
        <xs:sequence>
            <xs:element name="requests" type="requestsType" minOccurs="0"/>         
            <xs:element name="docs" type="docsType" minOccurs="0"/>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="auid" type="xs:token" use="required"/>
        <xs:anyAttribute processContents="lax"/>
    </xs:complexType>

    <xs:complexType name="requestsType">
        <xs:sequence>
            <xs:element name="diff-read" type="extType" minOccurs="0"/>
            <xs:element name="diff-write" type="extType" minOccurs="0"/> 
            <xs:element name="reference" type="extType" minOccurs="0"/> 
            <xs:element name="forward" type="extType" minOccurs="0"/>
            <xs:element name="restore" type="extType" minOccurs="0"/> 
            <xs:element name="search" type="extType" minOccurs="0"/> 
            <xs:element name="subscribe" type="extType" minOccurs="0"/> 
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="docsType">
        <xs:sequence>
            <xs:element name="apd" type="extType" minOccurs="0"/>
            <xs:element name="mod-hist" type="extType" minOccurs="0"/> 
            <xs:element name="prefs" type="extType" minOccurs="0"/> 
            <xs:element name="request-hist" type="extType" minOccurs="0"/>
            <xs:element name="restore" type="extType" minOccurs="0"/> 
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="subscribeType">
        <xs:sequence>
            <xs:element name="sip" type="extType" minOccurs="0"/> 
            <xs:element name="xdcp" type="extType" minOccurs="0"/>     
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="extType">
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence> 
        <xs:anyAttribute processContents="lax"/>
    </xs:complexType>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- OMA specific XDM version 2.1 extensions to "XDM Directory Document -->
    <xs:attribute name="reference" type="xs:anyURI"/>
    <xs:attribute name="reference-display-name" type="xs:string"/>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- OMA specific XDM version 2.1 extensions to "Extended Group Advertisement Document -->
    <xs:element name="group-doc-uri" type="xs:anyURI"/>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!-- OMA specific XDM version 2.1 extensions to the <mediaListType> and the <allMediaExceptType> element
defined in the namespace "urn:oma:xml:xdm:extensions"-->
    <xs:element name="standalone-message" type="ext:extensionType"/>

</xs:schema>
