<?xml version="1.0"?>

<!--
FILE INFORMATION

Description
   This schema describes the XDM PAL Profile document for the PAL enabler

Version: 1.0  
Date:    20 March 2012

OMA Permanent Document
   File: OMA-SUP-XSD_xdm_palProfile-V1_0-20120320-A
   Type: Text

Public Reachable Information
   Path: http://www.openmobilealliance.org/tech/profiles
   Name: xdm_palProfile-v1_0.xsd

NORMATIVE INFORMATION

Information about this file can be found in the latest revision of the specification
OMA-TS-PAL_XDM-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,
  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 2010 Open Mobile Alliance Ltd.  All Rights Reserved.
  Used with the permission of the Open Mobile Alliance Ltd. under the
  terms set forth above.
-->

<xsd:schema targetNamespace="urn:oma:xml:xdm:pal-profile:1.0"
            xmlns:pp="urn:oma:xml:xdm:pal-profile:1.0"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified" attributeFormDefault="unqualified">

    <xsd:complexType name="palBaseType" abstract="true">
	    <xsd:annotation>
		    <xsd:documentation xml:lang="en">
			    A PAL base type.  Most PAL entities derive from this type.
				A PAL entity consists of an identifier along with an optional name element.
			</xsd:documentation>
		</xsd:annotation>

		<xsd:attribute name="name" type="xsd:token" use="optional"/>
		<xsd:attribute name="id"   type="xsd:anyURI" use="required"/>
	</xsd:complexType>

    <xsd:complexType name="palRuleType">
	    <xsd:annotation>
		    <xsd:documentation xml:lang="en">
			    A PAL rule data type.  PAL Rule is-a palBaseType including
				a choice between a self-contained code-snippet which represents the underlying rule or
				a reference (URI Reference) to the rule itself.
			</xsd:documentation>
		</xsd:annotation>

        <xsd:complexContent>
		    <xsd:extension base="pp:palBaseType">
			    <xsd:sequence>
				    <xsd:element name="rule-name" type="xsd:QName"/>
					<xsd:choice>
					    <xsd:element name="code-snippet" type="xsd:string"/>
						<xsd:element name="code-ref"     type="xsd:anyURI"/>
					</xsd:choice>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

    <xsd:complexType name="palPresenceAspectType">
	    <xsd:annotation>
		    <xsd:documentation xml:lang="en">
			    A PAL Presence Aspect data type.  PAL Presence Aspect is-a palBaseType including
				a Presence Aspect value data type, and a URI reference to the rule
				which may be resolved for the associated PAL Presence Aspect.
			</xsd:documentation>
		</xsd:annotation>

        <xsd:complexContent>
		    <xsd:extension base="pp:palBaseType">
			    <xsd:sequence>
		            <xsd:element name="value-type" type="xsd:QName"/>
					<xsd:element name="pa-rule-ref" type="xsd:anyURI"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

    <xsd:complexType name="palPresenceTriggerType">
	    <xsd:annotation>
		    <xsd:documentation xml:lang="en">
			    A PAL Presence Trigger data type.  PAL Presence Trigger is-a palBaseType including
				a URI reference to the associated pre-defined action and the underlying 
				Presence Trigger rule for the underlying PAL Presence Aspect being monitored.
			</xsd:documentation>
		</xsd:annotation>

        <xsd:complexContent>
		    <xsd:extension base="pp:palBaseType">
			    <xsd:sequence>
		            <xsd:element name="predef-action-ref" type="xsd:anyURI"/>
					<xsd:element name="pt-rule-ref" type="xsd:anyURI"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>


    <xsd:complexType name="palRuleSet">
	    <xsd:annotation>
		    <xsd:documentation xml:lang="en">
			    A PAL Rule-Set data type.  PAL rule-set consists of 1 or more pal rules
				with a mandatory rule-set identifier attribute.
			</xsd:documentation>
		</xsd:annotation>

        <xsd:complexContent>
		    <xsd:extension base="pp:palBaseType">
			    <xsd:sequence>
					<xsd:element name="rule" type="pp:palRuleType" minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

    <xsd:complexType name="palAspects">
	    <xsd:annotation>
		    <xsd:documentation xml:lang="en">
			    A PAL Aspects data type.  Aspects consists of 1 or more pal aspects
				with an optional aspects identifier attribute.
			</xsd:documentation>
		</xsd:annotation>

        <xsd:complexContent>
		    <xsd:extension base="pp:palBaseType">
			    <xsd:sequence>
					<xsd:element name="aspect" type="pp:palPresenceAspectType" maxOccurs="unbounded"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

    <xsd:complexType name="palTriggers">
	    <xsd:annotation>
		    <xsd:documentation xml:lang="en">
			    A PAL Triggers data type.  Triggers consist of 1 or more pal triggers
				with an optional triggers identifier attribute.
			</xsd:documentation>
		</xsd:annotation>

		<xsd:complexContent>
		    <xsd:extension base="pp:palBaseType">
			    <xsd:sequence>
					<xsd:element name="trigger" type="pp:palPresenceTriggerType" maxOccurs="unbounded"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

    <xsd:complexType name="palProfileType">
	    <xsd:annotation>
		    <xsd:documentation xml:lang="en">
			    PAL Profile type.  Note that items from other namespace may include
				policy type definitions.
			</xsd:documentation>
		</xsd:annotation>

		<xsd:complexContent>
	    	<xsd:extension base="pp:palBaseType">
    			<xsd:sequence>
       				<xsd:element name="rule-set"     type="pp:palRuleSet"/>
       				<xsd:element name="aspects"      type="pp:palAspects"/>
       				<xsd:element name="triggers"     type="pp:palTriggers" minOccurs="0"/>
       				<xsd:any     namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    			</xsd:sequence>
				<xsd:anyAttribute processContents="lax"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

    <xsd:element name="service-profile">
	    <xsd:annotation>
		<xsd:documentation xml:lang="en">
		    PAL Profile document structure.  
		</xsd:documentation>
	    </xsd:annotation>

		<xsd:complexType>
	    	    <xsd:sequence>
	       		<xsd:element name="pal-presence-params" type="pp:palProfileType"/>
	    	    </xsd:sequence>
		    <xsd:attribute name="uri"   type="xsd:anyURI" use="required"/>
		    <xsd:anyAttribute processContents="lax"/>
		</xsd:complexType>
	</xsd:element>

</xsd:schema>
