[Search] [txt|pdfized|bibtex] [Tracker] [Email] [Nits]
Versions: 00 01 02 03 04 05                                             
SIMPLE WG                                                  J. Urpalainen
Internet-Draft                                     Nokia Research Center
Expires: January 16, 2006                                  July 15, 2005


              Combined Presence Schemas Utilizing RELAX NG
              draft-urpalainen-simple-presence-relaxng-00

Status of this Memo

   By submitting this Internet-Draft, each author represents that any
   applicable patent or other IPR claims of which he or she is aware
   have been or will be disclosed, and any of which he or she becomes
   aware will be disclosed, in accordance with Section 6 of BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt.

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on January 16, 2006.

Copyright Notice

   Copyright (C) The Internet Society (2005).

Abstract

   This memo describes a batch of Presence Information Data Format
   (PIDF) and its extension schemas written with the RELAX NG schema
   language.  With the current W3C XML Schema language it is impossible
   to write forward and backward compatible presence combination schemas
   because of lacking versioning support.  These RELAX NG combination
   schemas are stricter than the W3C Schemas and thus the instance
   documents that validate with these schemas follow the intended
   content model more closely.  Especially, these schemas are targeted
   to actual implementations in order to decrease interoperability



Urpalainen              Expires January 16, 2006                [Page 1]


Internet-Draft          Presence RELAX NG schemas              July 2005


   problems.

Table of Contents

   1.   Introduction . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.   Conventions  . . . . . . . . . . . . . . . . . . . . . . . .   3
   3.   Overview of the Presence RELAX NG Schemas  . . . . . . . . .   4
   4.   PIDF schema  . . . . . . . . . . . . . . . . . . . . . . . .   5
   5.   DataModel schema . . . . . . . . . . . . . . . . . . . . . .   8
   6.   RPID schema  . . . . . . . . . . . . . . . . . . . . . . . .  11
   7.   CIPID schema . . . . . . . . . . . . . . . . . . . . . . . .  29
   8.   Devcaps schema . . . . . . . . . . . . . . . . . . . . . . .  31
   9.   Servcaps schema  . . . . . . . . . . . . . . . . . . . . . .  34
   10.  An example instance document . . . . . . . . . . . . . . . .  44
   11.  Security considerations  . . . . . . . . . . . . . . . . . .  47
   12.  Acknowledgments  . . . . . . . . . . . . . . . . . . . . . .  47
   13.  References . . . . . . . . . . . . . . . . . . . . . . . . .  47
     13.1   Normative references . . . . . . . . . . . . . . . . . .  47
     13.2   Informative references . . . . . . . . . . . . . . . . .  48
        Author's Address . . . . . . . . . . . . . . . . . . . . . .  48
        Intellectual Property and Copyright Statements . . . . . . .  50






























Urpalainen              Expires January 16, 2006                [Page 2]


Internet-Draft          Presence RELAX NG schemas              July 2005


1.  Introduction

   Within a Common Presence Profile (CPP) [13] compatible presence
   system presence data is represented using the Extensible Markup
   Language (XML) [2] based Presence Information Data Format (PIDF) [8].
   The PIDF format describes the baseline of the instance documents and
   currently many extensions to it are being described: e.g.  DataModel
   [9], RPID [10], CIPID [11] and CAPS [12].

   The content model of these XML documents is described primarily by
   the W3C XML Schemas [5].  While the W3C XML Schema language has an
   extensive amount of impressive properties, for example the versioning
   support is still lacking.  That is, it is impossible write forward
   and backward compatible schemas because of the "Unique Particle
   Attribution" constraint described in Appendix H of the recommendation
   [5] and because wildcard definitions aren't flexible enough.
   Therefore, all the presence extension documents can not extend PIDF
   so that e.g. positions for the new elements could be defined within
   the extension schema so that wildcard definitions would still exist.
   The W3C XML Schema Working Group is going to fix this versioning
   issue in the upcoming 1.1 version.  Until that happens
   implementations can utilize RELAX NG [7] for validations of presence
   documents once relevant RELAX NG schemas exist.  This memo describes
   a batch of these schemas which try to be as compatible as possible
   with the current presence W3C XML schemas.  The set includes schemas
   for PIDF, DataModel, RPID, CIPID and CAPS.  As these schemas are more
   restrictive than the corresponding W3C XML Schemas, if instance
   documents validate according to these schemas they should also
   validate with the W3C XML Schemas too.

   While it might be tempting to start a dispute whether IETF/SIMPLE
   should adopt the RELAX NG schemas over the W3C XML Schemas, the
   purpose is just to produce a reasonable set of schemas which can be
   used in real implementations, i.e. to decrease interoperability
   problems.  Also full comparisons of these tools are out of the scope
   of this document.  Currently RELAX NG just fits better for this
   purpose where a reasonable combination of schemas is required, i.e.
   the positioning of extensions while retaining wildcard definitions
   can easily be done.

2.  Conventions

   In this document, the key words "MUST", "MUST NOT", "REQUIRED",
   "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
   and "OPTIONAL" are to be interpreted as described in RFC 2119 [1] and
   indicate requirement levels for compliant implementations.

   The following terms are used in this document:



Urpalainen              Expires January 16, 2006                [Page 3]


Internet-Draft          Presence RELAX NG schemas              July 2005


   Forward and backward compatible schema: Backwards compatibility means
      that existing instance documents can be used also by updated new
      consumers and forwards compatibility means that newer instance
      documents can also be used by existing consumers.

   Ambiguous schema: A schema is said to be ambiguous when a document
      may be valid when its contents match multiple different pattern
      alternatives.

   Deterministic schema: At each point, when matching an instance
      document against a schema, the schema processor has at most one
      possible choice.

   Wildcards in schemas: In W3C XML Schemas <any> and <anyAttribute>
      definitions are wildcards.  They can be used to provide
      extensibility to the XML instance documents.  RELAX NG provides a
      very versatile though somewhat verbose model for wildcards with
      <anyName> and <except> rules.


3.  Overview of the Presence RELAX NG Schemas

   All schemas written with the RELAX NG schema language are based on
   patterns.  The W3C Schema datatypes [6] are used to constrain the
   element and attribute content in these schemas.

   The model for these schemas is based on the chronological order of
   appearance of these schemas, i.e. the PIDF schema is the baseline
   schema and the DataModel schema includes it by adding some
   extensions.  Then the RPID schema includes the DataModel schema and
   defines all the extensions, etc.  When an implementation wants to
   validate an instance document it just has to provide a single schema
   e.g. a RPID reference to the validator as that schema will include
   all the others.  This ordering is somewhat arbitrary as many of these
   extensions are at this stage "work-in-progress".

   Extension points, i.e. where <any> wildcards are used in W3C XML
   Schemas, are described by adding two definitions to these schemas: an
   extension definition with <empty> content and a wildcard definition.
   The former is added because it is then easy to extend that point by
   using combine="interleave" rule.  The wildcard definition must be
   redefined in extension schemas if deterministic schemas are required.
   The schemas presented in this memo are deterministic and unambiguous
   although it is not a general requirement of the RELAX NG schema
   language.

   The ability to easily redefine extension points helps when an
   application does not have any extensions beyond e.g.  RPID and



Urpalainen              Expires January 16, 2006                [Page 4]


Internet-Draft          Presence RELAX NG schemas              July 2005


   DataModel:


   <?xml version="1.0"?>
   <grammar xmlns="http://relaxng.org/ns/structure/1.0">

     <include href="rpid.rng">

       <!-- rule out extensions -->
       <define name="anyRPID">
         <empty/>
       </define>

       <define name="anyOtherAttr">
         <empty/>
       </define>

     </include>
   </grammar>


   Without touching the PIDF, DataModel or RPID schemas all the wildcard
   extensions have been practically removed.  Similarly, if "rpid.rng"
   is replaced with "devcaps.rng" and "anyRPID" with "anyCaps" the
   combined schema will rule out all the wildcard extensions while
   retaining the other element and attribute definitions within the
   PIDF, DataModel, RPID, CIPID and CAPS schemas.  This would be a more
   important feature if wildcards in these RELAX NG schemas were
   strictly aligned with the W3C Schema versions, i.e. if they would
   fully follow the "##other" namespace rule.  However, it was not
   considered worth the effort to define all those different wildcard
   definitions but instead use this conservative and simple
   deterministic model where wildcard except rules are redefined by just
   adding new <nsName> namespace definitions onto the <except> list.

4.  PIDF schema

   The RELAX NG version of the PIDF [8] schema.  Hereafter it is called
   with "pidf.rng" as if it were represented as an equivalent filesystem
   object.


   <?xml version="1.0"?>
   <grammar xmlns="http://relaxng.org/ns/structure/1.0"
     ns="urn:ietf:params:xml:ns:pidf"
     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

     <start>



Urpalainen              Expires January 16, 2006                [Page 5]


Internet-Draft          Presence RELAX NG schemas              July 2005


       <element name="presence">
         <attribute name="entity">
           <data type="anyURI"/>
         </attribute>
         <zeroOrMore>
           <element name="tuple">
             <attribute name="id">
               <data type="ID"/>
             </attribute>

             <element name="status">
               <optional>
                 <element name="basic">
                   <choice>
                     <value type="string">open</value>
                     <value type="string">closed</value>
                   </choice>
                 </element>
               </optional>

               <zeroOrMore>
                 <ref name="StatusExtension"/>
               </zeroOrMore>

               <zeroOrMore>
                 <ref name="anyPIDF"/>
               </zeroOrMore>
             </element>

             <zeroOrMore>
               <ref name="TupleExtension"/>
             </zeroOrMore>

             <zeroOrMore>
               <ref name="anyPIDF"/>
             </zeroOrMore>

             <optional>
               <element name="contact">
                 <optional>
                   <attribute name="priority">
                     <data type="decimal">
                       <param name="pattern"
                        >0(.[0-9]{0,3})?|1(.0{0,3})?</param>
                     </data>
                   </attribute>
                 </optional>
                 <data type="anyURI"/>



Urpalainen              Expires January 16, 2006                [Page 6]


Internet-Draft          Presence RELAX NG schemas              July 2005


               </element>
             </optional>

             <zeroOrMore>
               <ref name="note"/>
             </zeroOrMore>

             <optional>
               <element name="timestamp">
                 <data type="dateTime"/>
               </element>
             </optional>
           </element>
         </zeroOrMore>

         <zeroOrMore>
           <ref name="note"/>
         </zeroOrMore>

         <zeroOrMore>
           <ref name="PresenceExtension"/>
         </zeroOrMore>

         <zeroOrMore>
           <ref name="anyPIDF"/>
         </zeroOrMore>
       </element>
     </start>

     <!-- extension point with interleave for presence -->
     <define name="PresenceExtension">
       <empty/>
     </define>

     <!-- extension point with interleave for status -->
     <define name="StatusExtension">
       <empty/>
     </define>

     <!-- extension point with interleave for tuple -->
     <define name="TupleExtension">
       <empty/>
     </define>

     <!-- wildcard for other than pidf namespace -->
     <define name="anyPIDF">
       <element>
         <anyName>



Urpalainen              Expires January 16, 2006                [Page 7]


Internet-Draft          Presence RELAX NG schemas              July 2005


           <except>
             <nsName ns="urn:ietf:params:xml:ns:pidf"/>
             <nsName ns=""/>
           </except>
         </anyName>
         <mixed>
           <zeroOrMore>
             <choice>
               <attribute>
                 <anyName/>
               </attribute>
               <ref name="anyPIDF"/>
             </choice>
           </zeroOrMore>
         </mixed>
       </element>
     </define>

     <!-- note -->
     <define name="note">
       <element name="note">
         <optional>
           <attribute>
             <name ns="http://www.w3.org/XML/1998/namespace">lang</name>
             <data type="language"/>
           </attribute>
         </optional>
         <data type="string"/>
       </element>
     </define>
   </grammar>


   This is the only schema that defines a document root element.  The
   "anyPIDF" wildcard definition rules out elements from the PIDF
   namespace and also elements that don't have any namespace attached.
   The "PresenceExtension", "StatusExtension" and "TupleExtension"
   definitions are empty extension points which can be used with
   combine="interleave" references within the extension schemas.

5.  DataModel schema

   The RELAX NG version of the DataModel [9] schema, "data-model.rng":


   <?xml version="1.0"?>
   <grammar xmlns="http://relaxng.org/ns/structure/1.0"
     ns="urn:ietf:params:xml:ns:pidf:data-model"



Urpalainen              Expires January 16, 2006                [Page 8]


Internet-Draft          Presence RELAX NG schemas              July 2005


     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

     <!-- include PIDF and redefine wildcard -->
     <include href="pidf.rng">

       <!-- rule out data-model+pidf namespace -->
       <define name="anyPIDF">
         <ref name="anyDataModel"/>
       </define>

     </include>

     <!-- presence extension definition -->
     <define name="PresenceExtension" combine="interleave">
       <interleave>
         <optional>
           <element name="device">
             <attribute name="id">
               <data type="ID"/>
             </attribute>

             <ref name="deviceIDDataModel"/>

             <optional>
               <ref name="noteDataModel"/>
             </optional>

             <optional>
               <ref name="timestampDataModel"/>
             </optional>

             <zeroOrMore>
               <ref name="DeviceExtension"/>
             </zeroOrMore>

             <zeroOrMore>
               <ref name="anyDataModel"/>
             </zeroOrMore>
           </element>
         </optional>

         <optional>
           <element name="person">
             <attribute name="id">
               <data type="ID"/>
             </attribute>

             <optional>



Urpalainen              Expires January 16, 2006                [Page 9]


Internet-Draft          Presence RELAX NG schemas              July 2005


               <ref name="noteDataModel"/>
             </optional>

             <optional>
               <ref name="timestampDataModel"/>
             </optional>

             <zeroOrMore>
               <ref name="PersonExtension"/>
             </zeroOrMore>

             <zeroOrMore>
               <ref name="anyDataModel"/>
             </zeroOrMore>
           </element>
         </optional>
       </interleave>
     </define>

     <!-- tuple extension definition -->
     <define name="TupleExtension" combine="interleave">
       <optional>
         <ref name="deviceIDDataModel"/>
       </optional>
     </define>

     <!-- extension point with interleave for person element -->
     <define name="PersonExtension">
       <empty/>
     </define>

     <!-- extension point with interleave for device element -->
     <define name="DeviceExtension">
       <empty/>
     </define>

     <!-- wildcarcd from other than
          pidf and data-model namespaces -->
     <define name="anyDataModel">
       <element>
         <anyName>
           <except>
             <nsName ns="urn:ietf:params:xml:ns:pidf:data-model"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf"/>
             <nsName ns=""/>
           </except>
         </anyName>
         <mixed>



Urpalainen              Expires January 16, 2006               [Page 10]


Internet-Draft          Presence RELAX NG schemas              July 2005


           <zeroOrMore>
             <choice>
               <attribute>
                 <anyName/>
               </attribute>
               <ref name="anyDataModel"/>
             </choice>
           </zeroOrMore>
         </mixed>
       </element>
     </define>

     <!-- note -->
     <define name="noteDataModel">
       <element name="note">
         <optional>
           <attribute>
             <name ns="http://www.w3.org/XML/1998/namespace">lang</name>
             <data type="language"/>
           </attribute>
         </optional>
         <data type="string"/>
       </element>
     </define>

     <!-- deviceID -->
     <define name="deviceIDDataModel">
       <element name="deviceID">
         <data type="anyURI"/>
       </element>
     </define>

     <!-- timestamp -->
     <define name="timestampDataModel">
       <element name="timestamp">
         <data type="dateTime"/>
       </element>
     </define>
   </grammar>

   The DataModel schema includes "pidf.rng" and the "anyPIDF" wildcard
   definition is redefined with "anyDataModel".  The "PersonExtension"
   and "DeviceExtension" definitions are empty extension points.

6.  RPID schema

   The RELAX NG version of the RPID [10] schema, "rpid.rng":




Urpalainen              Expires January 16, 2006               [Page 11]


Internet-Draft          Presence RELAX NG schemas              July 2005


   <?xml version="1.0"?>
   <grammar xmlns="http://relaxng.org/ns/structure/1.0"
     ns="urn:ietf:params:xml:ns:pidf:rpid"
     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

     <include href="data-model.rng">

       <!-- rule out data-model+pidf+rpid namespace -->
       <define name="anyDataModel">
         <ref name="anyRPID"/>
       </define>

     </include>

     <!-- person extension definition -->
     <define name="PersonExtension" combine="interleave">
       <ref name="PersonRPID"/>
     </define>

     <!-- device extension definition -->
     <define name="DeviceExtension" combine="interleave">
       <ref name="DeviceRPID"/>
     </define>

     <!-- tuple extension definition -->
     <define name="TupleExtension" combine="interleave">
       <ref name="TupleRPID"/>
     </define>

     <!-- wildcarcd from other than
          pidf, data-model and rpid namespace -->
     <define name="anyRPID">
       <element>
         <anyName>
           <except>
             <nsName ns="urn:ietf:params:xml:ns:pidf:rpid"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf:data-model"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf"/>
             <nsName ns=""/>
           </except>
         </anyName>
         <mixed>
           <zeroOrMore>
             <choice>
               <attribute>
                 <anyName/>
               </attribute>
               <ref name="anyRPID"/>



Urpalainen              Expires January 16, 2006               [Page 12]


Internet-Draft          Presence RELAX NG schemas              July 2005


             </choice>
           </zeroOrMore>
         </mixed>
       </element>
     </define>

     <!-- person extension -->
     <define name="PersonRPID">
       <interleave>
         <optional>
           <ref name="activities"/>
         </optional>
         <optional>
           <ref name="class"/>
         </optional>
         <optional>
           <ref name="mood"/>
         </optional>
         <optional>
           <ref name="place-is"/>
         </optional>
         <optional>
           <ref name="place-type"/>
         </optional>
         <optional>
           <ref name="privacy"/>
         </optional>
         <optional>
           <ref name="sphere"/>
         </optional>
         <optional>
           <ref name="status-icon"/>
         </optional>
         <optional>
           <ref name="time-offset"/>
         </optional>
         <optional>
           <ref name="user-input"/>
         </optional>
       </interleave>
     </define>

     <!-- tuple extension -->
     <define name="TupleRPID">
       <interleave>
         <optional>
           <ref name="class"/>
         </optional>



Urpalainen              Expires January 16, 2006               [Page 13]


Internet-Draft          Presence RELAX NG schemas              July 2005


         <optional>
           <ref name="privacy"/>
         </optional>
         <optional>
           <ref name="relationship"/>
         </optional>
         <optional>
           <ref name="service-class"/>
         </optional>
         <optional>
           <ref name="status-icon"/>
         </optional>
         <optional>
           <ref name="user-input"/>
         </optional>
       </interleave>
     </define>

     <!-- device extension -->
     <define name="DeviceRPID">
       <interleave>
         <optional>
           <ref name="class"/>
         </optional>
         <optional>
           <ref name="user-input"/>
         </optional>
       </interleave>
     </define>

     <!-- activities -->
     <define name="activities">
       <element name="activities">
         <optional>
           <element name="note">
             <ref name="noteRPID"/>
           </element>
         </optional>
         <choice>
           <element name="unknown">
             <ref name="anyType"/>
           </element>
           <group>
             <interleave>
               <optional>
                 <element name="appointment"><empty/></element>
               </optional>
               <optional>



Urpalainen              Expires January 16, 2006               [Page 14]


Internet-Draft          Presence RELAX NG schemas              July 2005


                 <element name="away"><empty/></element>
               </optional>
               <optional>
                 <element name="breakfast"><empty/></element>
               </optional>
               <optional>
                 <element name="busy"><empty/></element>
               </optional>
               <optional>
                 <element name="dinner"><empty/></element>
               </optional>
               <optional>
                 <element name="holiday"><empty/></element>
               </optional>
               <optional>
                 <element name="in-transit"><empty/></element>
               </optional>
               <optional>
                 <element name="meal"><empty/></element>
               </optional>
               <optional>
                 <element name="meeting"><empty/></element>
               </optional>
               <optional>
                 <element name="on-the-phone"><empty/></element>
               </optional>
               <optional>
                 <element name="performance"><empty/></element>
               </optional>
               <optional>
                 <element name="permanent-absence"><empty/></element>
               </optional>
               <optional>
                 <element name="playing"><empty/></element>
               </optional>
               <optional>
                 <element name="presentation"><empty/></element>
               </optional>
               <optional>
                 <element name="sleeping"><empty/></element>
               </optional>
               <optional>
                 <element name="spectator"><empty/></element>
               </optional>
               <optional>
                 <element name="steering"><empty/></element>
               </optional>
               <optional>



Urpalainen              Expires January 16, 2006               [Page 15]


Internet-Draft          Presence RELAX NG schemas              July 2005


                 <element name="travel"><empty/></element>
               </optional>
               <optional>
                 <element name="tv"><empty/></element>
               </optional>
               <optional>
                 <element name="vacation"><empty/></element>
               </optional>
               <optional>
                 <element name="working"><empty/></element>
               </optional>
               <optional>
                 <element name="other">
                   <ref name="noteRPID"/>
                 </element>
               </optional>
             </interleave>
             <zeroOrMore>
               <ref name="ActivitiesExtension"/>
             </zeroOrMore>
             <zeroOrMore>
               <ref name="anyRPID"/>
             </zeroOrMore>
           </group>
         </choice>

         <ref name="commonAttributes"/>

       </element>
     </define>

     <!-- defining common attributes in several elements -->
     <define name="commonAttributes">
       <ref name="fromUntil"/>

       <optional>
         <attribute name="id">
           <data type="ID"/>
         </attribute>
       </optional>

       <zeroOrMore>
         <ref name="anyOtherAttr"/>
       </zeroOrMore>
     </define>

     <!-- any attributes except already defined ones -->
     <define name="anyOtherAttr">



Urpalainen              Expires January 16, 2006               [Page 16]


Internet-Draft          Presence RELAX NG schemas              July 2005


       <attribute>
         <anyName>
         <except>
           <name ns="">from</name>
           <name ns="">until</name>
           <name ns="">id</name>
         </except>
         </anyName>
       </attribute>
     </define>

     <!-- activities extension point -->
     <define name="ActivitiesExtension">
       <empty/>
     </define>

     <!-- class -->
     <define name="class">
       <element name="class">
         <data type="token"/>
       </element>
     </define>

     <!-- mood -->
     <define name="mood">
       <element name="mood">
         <optional>
           <element name="note">
             <ref name="noteRPID"/>
           </element>
         </optional>
         <choice>
           <element name="unknown">
             <ref name="anyType"/>
           </element>
           <group>
             <interleave>
               <optional>
                 <element name="afraid"><empty/></element>
               </optional>
               <optional>
                 <element name="amazed"><empty/></element>
               </optional>
               <optional>
                 <element name="angry"><empty/></element>
               </optional>
               <optional>
                 <element name="annoyed"><empty/></element>



Urpalainen              Expires January 16, 2006               [Page 17]


Internet-Draft          Presence RELAX NG schemas              July 2005


               </optional>
               <optional>
                 <element name="anxious"><empty/></element>
               </optional>
               <optional>
                 <element name="ashamed"><empty/></element>
               </optional>
               <optional>
                 <element name="bored"><empty/></element>
               </optional>
               <optional>
                 <element name="brave"><empty/></element>
               </optional>
               <optional>
                 <element name="calm"><empty/></element>
               </optional>
               <optional>
                 <element name="cold"><empty/></element>
               </optional>
               <optional>
                 <element name="confused"><empty/></element>
               </optional>
               <optional>
                 <element name="contented"><empty/></element>
               </optional>
               <optional>
                 <element name="cranky"><empty/></element>
               </optional>
               <optional>
                 <element name="curious"><empty/></element>
               </optional>
               <optional>
                 <element name="depressed"><empty/></element>
               </optional>
               <optional>
                 <element name="disappointed"><empty/></element>
               </optional>
               <optional>
                 <element name="disgusted"><empty/></element>
               </optional>
               <optional>
                 <element name="distracted"><empty/></element>
               </optional>
               <optional>
                 <element name="embarrassed"><empty/></element>
               </optional>
               <optional>
                 <element name="excited"><empty/></element>



Urpalainen              Expires January 16, 2006               [Page 18]


Internet-Draft          Presence RELAX NG schemas              July 2005


               </optional>
               <optional>
                 <element name="flirtatious"><empty/></element>
               </optional>
               <optional>
                 <element name="frustrated"><empty/></element>
               </optional>
               <optional>
                 <element name="grumpy"><empty/></element>
               </optional>
               <optional>
                 <element name="guilty"><empty/></element>
               </optional>
               <optional>
                 <element name="happy"><empty/></element>
               </optional>
               <optional>
                 <element name="hot"><empty/></element>
               </optional>
               <optional>
                 <element name="humbled"><empty/></element>
               </optional>
               <optional>
                 <element name="humiliated"><empty/></element>
               </optional>
               <optional>
                 <element name="hungry"><empty/></element>
               </optional>
               <optional>
                 <element name="hurt"><empty/></element>
               </optional>
               <optional>
                 <element name="impressed"><empty/></element>
               </optional>
               <optional>
                 <element name="in_awe"><empty/></element>
               </optional>
               <optional>
                 <element name="in_love"><empty/></element>
               </optional>
               <optional>
                 <element name="indignant"><empty/></element>
               </optional>
               <optional>
                 <element name="interested"><empty/></element>
               </optional>
               <optional>
                 <element name="invincible"><empty/></element>



Urpalainen              Expires January 16, 2006               [Page 19]


Internet-Draft          Presence RELAX NG schemas              July 2005


               </optional>
               <optional>
                 <element name="jealous"><empty/></element>
               </optional>
               <optional>
                 <element name="lonely"><empty/></element>
               </optional>
               <optional>
                 <element name="mean"><empty/></element>
               </optional>
               <optional>
                 <element name="moody"><empty/></element>
               </optional>
               <optional>
                 <element name="nervous"><empty/></element>
               </optional>
               <optional>
                 <element name="neutral"><empty/></element>
               </optional>
               <optional>
                 <element name="offended"><empty/></element>
               </optional>
               <optional>
                 <element name="playful"><empty/></element>
               </optional>
               <optional>
                 <element name="proud"><empty/></element>
               </optional>
               <optional>
                 <element name="relieved"><empty/></element>
               </optional>
               <optional>
                 <element name="remorseful"><empty/></element>
               </optional>
               <optional>
                 <element name="sad"><empty/></element>
               </optional>
               <optional>
                 <element name="sarcastic"><empty/></element>
               </optional>
               <optional>
                 <element name="serious"><empty/></element>
               </optional>
               <optional>
                 <element name="shocked"><empty/></element>
               </optional>
               <optional>
                 <element name="shy"><empty/></element>



Urpalainen              Expires January 16, 2006               [Page 20]


Internet-Draft          Presence RELAX NG schemas              July 2005


               </optional>
               <optional>
                 <element name="sick"><empty/></element>
               </optional>
               <optional>
                 <element name="sleepy"><empty/></element>
               </optional>
               <optional>
                 <element name="stressed"><empty/></element>
               </optional>
               <optional>
                 <element name="surprised"><empty/></element>
               </optional>
               <optional>
                 <element name="thirsty"><empty/></element>
               </optional>
               <optional>
                 <element name="worried"><empty/></element>
               </optional>
               <optional>
                 <element name="other">
                   <ref name="noteRPID"/>
                 </element>
               </optional>

             </interleave>
             <zeroOrMore>
               <ref name="MoodExtension"/>
             </zeroOrMore>
             <zeroOrMore>
               <ref name="anyRPID"/>
             </zeroOrMore>
           </group>
         </choice>

         <ref name="commonAttributes"/>

       </element>
     </define>

     <!-- mood extension point -->
     <define name="MoodExtension">
       <empty/>
     </define>

     <!-- place-is -->
     <define name="place-is">
       <element name="place-is">



Urpalainen              Expires January 16, 2006               [Page 21]


Internet-Draft          Presence RELAX NG schemas              July 2005


         <optional>
           <element name="note">
             <ref name="noteRPID"/>
           </element>
         </optional>
         <optional>
           <element name="audio">
             <choice>
               <element name="noisy"><empty/></element>
               <element name="ok"><empty/></element>
               <element name="quiet"><empty/></element>
               <element name="unknown"><empty/></element>
             </choice>
           </element>
         </optional>
         <optional>
           <element name="video">
             <choice>
               <element name="toobright"><empty/></element>
               <element name="ok"><empty/></element>
               <element name="dark"><empty/></element>
               <element name="unknown"><empty/></element>
             </choice>
           </element>
         </optional>
         <optional>
           <element name="text">
             <choice>
               <element name="uncomfortable"><empty/></element>
               <element name="inappropriate"><empty/></element>
               <element name="ok"><empty/></element>
               <element name="unknown"><empty/></element>
             </choice>
           </element>
         </optional>

         <ref name="commonAttributes"/>

       </element>
     </define>

     <!-- place-type -->
     <define name="place-type">
       <element name="place-type">
         <optional>
           <element name="note">
             <ref name="noteRPID"/>
           </element>



Urpalainen              Expires January 16, 2006               [Page 22]


Internet-Draft          Presence RELAX NG schemas              July 2005


         </optional>
         <choice>
           <element name="aircraft"><empty/></element>
           <element name="airport"><empty/></element>
           <element name="bar"><empty/></element>
           <element name="club"><empty/></element>
           <element name="bus"><empty/></element>
           <element name="cafe"><empty/></element>
           <element name="car"><empty/></element>
           <element name="classroom"><empty/></element>
           <element name="convention_center"><empty/></element>
           <element name="cycle"><empty/></element>
           <element name="home"><empty/></element>
           <element name="hospital"><empty/></element>
           <element name="hotel"><empty/></element>
           <element name="industrial"><empty/></element>
           <element name="library"><empty/></element>
           <element name="mall"><empty/></element>
           <element name="office"><empty/></element>
           <element name="outdoors"><empty/></element>
           <element name="place-of-warship"><empty/></element>
           <element name="prison"><empty/></element>
           <element name="public"><empty/></element>
           <element name="public-transport"><empty/></element>
           <element name="restaurant"><empty/></element>
           <element name="school"><empty/></element>
           <element name="ship"><empty/></element>
           <element name="station"><empty/></element>
           <element name="street"><empty/></element>
           <element name="theater"><empty/></element>
           <element name="train"><empty/></element>
           <element name="truck"><empty/></element>
           <element name="underway"><empty/></element>
           <element name="unknown"><empty/></element>
           <element name="other">
             <ref name="noteRPID"/>
           </element>
           <oneOrMore>
             <ref name="PlaceTypeExtension"/>
           </oneOrMore>
           <oneOrMore>
             <ref name="anyRPID"/>
           </oneOrMore>
         </choice>

         <ref name="commonAttributes"/>

       </element>



Urpalainen              Expires January 16, 2006               [Page 23]


Internet-Draft          Presence RELAX NG schemas              July 2005


     </define>

     <!-- place-type extension point -->
     <define name="PlaceTypeExtension">
       <empty/>
     </define>

     <!-- privacy -->
     <define name="privacy">
       <element name="privacy">
         <optional>
           <element name="note">
             <ref name="noteRPID"/>
           </element>
         </optional>
         <choice>
           <element name="unknown">
             <ref name="anyType"/>
           </element>
           <group>
             <optional>
               <element name="audio"><empty/></element>
             </optional>
             <optional>
               <element name="text"><empty/></element>
             </optional>
             <optional>
               <element name="video"><empty/></element>
             </optional>
             <zeroOrMore>
               <ref name="PrivacyExtension"/>
             </zeroOrMore>
             <zeroOrMore>
               <ref name="anyRPID"/>
             </zeroOrMore>
           </group>
         </choice>

         <ref name="commonAttributes"/>

       </element>
     </define>

     <!-- privacy extension point -->
     <define name="PrivacyExtension">
       <empty/>
     </define>




Urpalainen              Expires January 16, 2006               [Page 24]


Internet-Draft          Presence RELAX NG schemas              July 2005


     <!-- relationship -->
     <define name="relationship">
       <element name="relationship">
         <optional>
           <element name="note">
             <ref name="noteRPID"/>
           </element>
         </optional>
         <choice>
           <element name="assistant"><empty/></element>
           <element name="associate"><empty/></element>
           <element name="family"><empty/></element>
           <element name="friend"><empty/></element>
           <element name="self"><empty/></element>
           <element name="supervisor"><empty/></element>
           <element name="unknown"><empty/></element>
           <oneOrMore>
             <ref name="RelationshipExtension"/>
           </oneOrMore>
           <oneOrMore>
             <ref name="anyRPID"/>
           </oneOrMore>
         </choice>
       </element>
     </define>

     <!-- relationship extension point -->
     <define name="RelationshipExtension">
       <empty/>
     </define>

     <!-- service-class -->
     <define name="service-class">
       <element name="service-class">
         <optional>
           <element name="note">
             <ref name="noteRPID"/>
           </element>
         </optional>
         <choice>
           <element name="delivery"><empty/></element>
           <element name="electronic"><empty/></element>
           <element name="in-person"><empty/></element>
           <element name="postal"><empty/></element>
           <element name="supervisor"><empty/></element>
           <element name="unknown"><empty/></element>
           <oneOrMore>
             <ref name="ServiceClassExtension"/>



Urpalainen              Expires January 16, 2006               [Page 25]


Internet-Draft          Presence RELAX NG schemas              July 2005


           </oneOrMore>
           <oneOrMore>
             <ref name="anyRPID"/>
           </oneOrMore>
         </choice>
       </element>
     </define>

     <!-- service-class extension point -->
     <define name="ServiceClassExtension">
       <empty/>
     </define>

     <!-- sphere -->
     <define name="sphere">
       <element name="sphere">
         <mixed>
           <optional>
             <choice>
               <element name="home"><empty/></element>
               <element name="work"><empty/></element>
               <element name="unknown"><empty/></element>
               <zeroOrMore>
                 <ref name="SphereExtension"/>
               </zeroOrMore>
               <zeroOrMore>
                 <ref name="anyRPID"/>
               </zeroOrMore>
             </choice>
           </optional>

           <ref name="commonAttributes"/>
         </mixed>
       </element>
     </define>

     <!-- sphere extension point -->
     <define name="SphereExtension">
       <empty/>
     </define>

     <!-- status-icon -->
     <define name="status-icon">
       <element name="status-icon">
         <data type="anyURI"/>

         <ref name="commonAttributes"/>
       </element>



Urpalainen              Expires January 16, 2006               [Page 26]


Internet-Draft          Presence RELAX NG schemas              July 2005


     </define>

     <!-- time-offset -->
     <define name="time-offset">
       <element name="time-offset">
         <data type="integer"/>

         <ref name="fromUntil"/>

         <optional>
           <attribute name="description"/>
         </optional>

         <optional>
           <attribute name="id">
             <data type="ID"/>
           </attribute>
         </optional>

         <zeroOrMore>
           <attribute>
             <anyName>
               <except>
                 <name ns="">description</name>
                 <name ns="">from</name>
                 <name ns="">until</name>
                 <name ns="">id</name>
               </except>
             </anyName>
           </attribute>
         </zeroOrMore>

       </element>
     </define>

     <!-- user-input -->
     <define name="user-input">
       <element name="user-input">
         <optional>
           <attribute name="idle-threshold">
             <data type="positiveInteger"/>
           </attribute>
         </optional>

         <optional>
           <attribute name="last-input">
             <data type="dateTime"/>
           </attribute>



Urpalainen              Expires January 16, 2006               [Page 27]


Internet-Draft          Presence RELAX NG schemas              July 2005


         </optional>

         <optional>
           <attribute name="id">
             <data type="ID"/>
           </attribute>
         </optional>

         <choice>
           <value type="string">active</value>
           <value type="string">idle</value>
         </choice>

         <zeroOrMore>
           <attribute>
             <anyName>
               <except>
                 <name ns="">idle-threshold</name>
                 <name ns="">last-input</name>
                 <name ns="">id</name>
               </except>
             </anyName>
           </attribute>
         </zeroOrMore>
       </element>
     </define>

     <!-- any type -->
     <define name="anyType">
       <zeroOrMore>
         <choice>
           <element>
             <anyName/>
             <ref name="anyType"/>
           </element>
           <attribute>
             <anyName/>
           </attribute>
           <text/>
         </choice>
       </zeroOrMore>
     </define>

     <!-- fromUntil attributes -->
     <define name="fromUntil">
       <optional>
         <attribute name="from">
           <data type="dateTime"/>



Urpalainen              Expires January 16, 2006               [Page 28]


Internet-Draft          Presence RELAX NG schemas              July 2005


         </attribute>
       </optional>
       <optional>
         <attribute name="until">
           <data type="dateTime"/>
         </attribute>
       </optional>
     </define>

     <!-- noteRPID element content -->
     <define name="noteRPID">
       <optional>
         <attribute>
           <name ns="http://www.w3.org/XML/1998/namespace">lang</name>
           <data type="language"/>
         </attribute>
       </optional>
       <data type="string"/>
     </define>
   </grammar>

   The RPID schema includes "data-model.rng" and the "anyDataModel"
   wildcard definition is redefined with "anyRPID".  There are many
   XXX"Extension" definitions.

7.  CIPID schema

   The RELAX NG version of the CIPID [11] schema, "cipid.rng":


   <?xml version="1.0"?>
   <grammar xmlns="http://relaxng.org/ns/structure/1.0"
     ns="urn:ietf:params:xml:ns:pidf:cipid"
     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

     <!-- include RPID and refine wildcard -->
     <include href="rpid.rng">

       <!-- rule out data-model+pidf+rpid+cipid namespace -->
       <define name="anyRPID">
         <ref name="anyCIPID"/>
       </define>

     </include>

     <!-- person extension definition -->
     <define name="PersonExtension" combine="interleave">
       <ref name="CIPID"/>



Urpalainen              Expires January 16, 2006               [Page 29]


Internet-Draft          Presence RELAX NG schemas              July 2005


     </define>

     <!-- tuple extension definition -->
     <define name="TupleExtension" combine="interleave">
       <ref name="CIPID"/>
     </define>

     <!-- wildcarcd from other than
          pidf, data-model, rpid and cipid namespaces -->
     <define name="anyCIPID">
       <element>
         <anyName>
           <except>
             <nsName ns="urn:ietf:params:xml:ns:pidf:cipid"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf:rpid"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf:data-model"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf"/>
             <nsName ns=""/>
           </except>
         </anyName>
         <mixed>
           <zeroOrMore>
             <choice>
               <attribute>
                 <anyName/>
               </attribute>
               <ref name="anyCIPID"/>
             </choice>
           </zeroOrMore>
         </mixed>
       </element>
     </define>

     <!-- CIPID extension -->
     <define name="CIPID">
       <interleave>
         <optional>
           <element name="card">
             <data type="anyURI"/>
           </element>
         </optional>
         <optional>
           <element name="display-name">
             <data type="string"/>
           </element>
         </optional>
         <optional>
           <element name="icon">



Urpalainen              Expires January 16, 2006               [Page 30]


Internet-Draft          Presence RELAX NG schemas              July 2005


             <data type="anyURI"/>
           </element>
         </optional>
         <optional>
           <element name="homepage">
             <data type="anyURI"/>
           </element>
         </optional>
         <optional>
           <element name="sound">
             <data type="anyURI"/>
           </element>
         </optional>
         <optional>
           <element name="map">
             <data type="anyURI"/>
           </element>
         </optional>
       </interleave>
     </define>

   </grammar>

   The CIPID schema includes "rpid.rng" and the "anyRPID" wildcard
   definition is redefined with "anyCIPID".

8.  Devcaps schema

   The RELAX NG version of the Devcaps [12] schema, "devcaps.rng":


   <?xml version="1.0"?>
   <grammar xmlns="http://relaxng.org/ns/structure/1.0"
     ns="urn:ietf:params:xml:ns:pidf:caps"
     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

     <!-- include CIPID and redefine wildcard -->
     <include href="cipid.rng">

       <!-- rule out data-model+pidf+rpid+cipid+caps namespace -->
       <define name="anyCIPID">
         <ref name="anyCaps"/>
       </define>

     </include>

     <!-- include also Servcaps definitions -->
     <include href="servcaps.rng"/>



Urpalainen              Expires January 16, 2006               [Page 31]


Internet-Draft          Presence RELAX NG schemas              July 2005


     <!-- person extension definition -->
     <define name="DeviceExtension" combine="interleave">
       <ref name="devcaps"/>
     </define>

     <!-- wildcarcd from other than
          pidf, data-model, rpid, cipid and caps namespaces -->
     <define name="anyCaps">
       <element>
         <anyName>
           <except>
             <nsName ns="urn:ietf:params:xml:ns:pidf:caps"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf:cipid"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf:rpid"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf:data-model"/>
             <nsName ns="urn:ietf:params:xml:ns:pidf"/>
             <nsName ns=""/>
           </except>
         </anyName>
         <mixed>
           <zeroOrMore>
             <choice>
               <attribute>
                 <anyName/>
               </attribute>
               <ref name="anyCaps"/>
             </choice>
           </zeroOrMore>
         </mixed>
       </element>
     </define>

     <!-- devcaps -->
     <define name="devcaps">
       <optional>
         <element name="devcaps">
           <optional>
             <element name="description">
               <data type="string"/>
             </element>
           </optional>
           <optional>
             <element name="mobility">
               <optional>
                 <element name="supported">
                   <ref name="mobilitytypes"/>
                 </element>
               </optional>



Urpalainen              Expires January 16, 2006               [Page 32]


Internet-Draft          Presence RELAX NG schemas              July 2005


               <optional>
                 <element name="notsupported">
                   <ref name="mobilitytypes"/>
                 </element>
               </optional>
             </element>
           </optional>
           <optional>
             <element name="priority">
               <optional>
                 <element name="supported">
                   <ref name="prioritytypes"/>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <ref name="prioritytypes"/>
                 </element>
               </optional>
             </element>
           </optional>
           <zeroOrMore>
             <ref name="anyCaps"/>
           </zeroOrMore>
         </element>
       </optional>
     </define>

     <!-- prioritytypes -->
     <define name="prioritytypes">
       <zeroOrMore>
         <element name="equals">
           <attribute name="value">
             <data type="integer"/>
           </attribute>
         </element>
       </zeroOrMore>

       <zeroOrMore>
         <element name="higherhan">
           <attribute name="minvalue">
             <data type="integer"/>
           </attribute>
         </element>
       </zeroOrMore>

       <zeroOrMore>
         <element name="lowerthan">



Urpalainen              Expires January 16, 2006               [Page 33]


Internet-Draft          Presence RELAX NG schemas              July 2005


           <attribute name="maxvalue">
             <data type="integer"/>
           </attribute>
         </element>
       </zeroOrMore>

       <zeroOrMore>
         <element name="range">
           <attribute name="maxvalue">
             <data type="integer"/>
           </attribute>
           <attribute name="minvalue">
             <data type="integer"/>
           </attribute>
         </element>
       </zeroOrMore>
       <zeroOrMore>
         <ref name="anyCaps"/>
       </zeroOrMore>
     </define>

     <!-- mobilitytypes -->
     <define name="mobilitytypes">
       <optional>
         <element name="fixed">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="mobile">
           <data type="string"/>
         </element>
       </optional>
       <zeroOrMore>
         <ref name="anyCaps"/>
       </zeroOrMore>
     </define>
   </grammar>

   The Devcaps schema includes "cipid.rng" and "servcaps.rng".  The
   "anyCIPID" wildcard definition is redefined with "anyCaps".

9.  Servcaps schema

   The RELAX NG version of the Servcaps [12] schema, "servcaps.rng":


   <?xml version="1.0"?>



Urpalainen              Expires January 16, 2006               [Page 34]


Internet-Draft          Presence RELAX NG schemas              July 2005


   <grammar xmlns="http://relaxng.org/ns/structure/1.0"
     ns="urn:ietf:params:xml:ns:pidf:caps"
     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

     <!-- person extension definition -->
     <define name="TupleExtension" combine="interleave">
       <ref name="servcaps"/>
     </define>

     <!-- servcaps -->
     <define name="servcaps">
       <optional>
         <element name="servcaps">
           <optional>
             <element name="actor">
               <optional>
                 <element name="supported">
                   <ref name="actortypes"/>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <ref name="actortypes"/>
                 </element>
               </optional>
             </element>
           </optional>
           <optional>
             <element name="application">
               <data type="boolean"/>
             </element>
           </optional>
           <optional>
             <element name="audio">
               <data type="boolean"/>
             </element>
           </optional>
           <optional>
             <element name="automata">
               <data type="boolean"/>
             </element>
           </optional>
           <optional>
             <element name="class">
               <optional>
                 <element name="supported">
                   <ref name="classtypes"/>
                 </element>



Urpalainen              Expires January 16, 2006               [Page 35]


Internet-Draft          Presence RELAX NG schemas              July 2005


               </optional>
               <optional>
                 <element name="notsupported">
                   <ref name="classtypes"/>
                 </element>
               </optional>
             </element>
           </optional>
           <optional>
             <element name="control">
               <data type="boolean"/>
             </element>
           </optional>
           <optional>
             <element name="data">
               <data type="boolean"/>
             </element>
           </optional>
           <optional>
             <element name="description">
               <data type="string"/>
             </element>
           </optional>
           <optional>
             <element name="duplex">
               <optional>
                 <element name="supported">
                   <ref name="duplextypes"/>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <ref name="duplextypes"/>
                 </element>
               </optional>
             </element>
           </optional>
           <optional>
             <element name="extensions">
               <optional>
                 <element name="supported">
                   <ref name="extensiontypes"/>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <ref name="extensiontypes"/>
                 </element>



Urpalainen              Expires January 16, 2006               [Page 36]


Internet-Draft          Presence RELAX NG schemas              July 2005


               </optional>
             </element>
           </optional>
           <optional>
             <element name="event-packages">
               <optional>
                 <element name="supported">
                   <ref name="eventtypes"/>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <ref name="eventtypes"/>
                 </element>
               </optional>
             </element>
           </optional>
           <optional>
             <element name="isfocus">
               <data type="boolean"/>
             </element>
           </optional>
           <optional>
             <element name="message">
               <data type="boolean"/>
             </element>
           </optional>
           <optional>
             <element name="methods">
               <optional>
                 <element name="supported">
                   <ref name="methodtypes"/>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <ref name="methodtypes"/>
                 </element>
               </optional>
             </element>
           </optional>
           <optional>
             <element name="languages">
               <optional>
                 <element name="supported">
                   <oneOrMore>
                     <element name="l">
                       <data type="string"/>



Urpalainen              Expires January 16, 2006               [Page 37]


Internet-Draft          Presence RELAX NG schemas              July 2005


                     </element>
                   </oneOrMore>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <oneOrMore>
                     <element name="l">
                       <data type="string"/>
                     </element>
                   </oneOrMore>
                 </element>
               </optional>
             </element>
           </optional>
           <optional>
             <element name="priority">
               <optional>
                 <element name="supported">
                   <ref name="prioritytypes"/>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <ref name="prioritytypes"/>
                 </element>
               </optional>
             </element>
           </optional>
           <optional>
             <element name="schemes">
               <optional>
                 <element name="supported">
                   <oneOrMore>
                     <element name="s">
                       <data type="string"/>
                     </element>
                   </oneOrMore>
                 </element>
               </optional>
               <optional>
                 <element name="notsupported">
                   <oneOrMore>
                     <element name="s">
                       <data type="string"/>
                     </element>
                   </oneOrMore>
                 </element>



Urpalainen              Expires January 16, 2006               [Page 38]


Internet-Draft          Presence RELAX NG schemas              July 2005


               </optional>
             </element>
           </optional>
           <optional>
             <element name="text">
               <data type="boolean"/>
             </element>
           </optional>
           <zeroOrMore>
             <element name="type">
               <data type="string"/>
             </element>
           </zeroOrMore>
           <optional>
             <element name="video">
               <data type="boolean"/>
             </element>
           </optional>
           <zeroOrMore>
             <ref name="anyCaps"/>
           </zeroOrMore>
         </element>
       </optional>
     </define>

     <!-- duplextypes -->
     <define name="duplextypes">
       <optional>
         <element name="full">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="half">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="receive-only">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="send-only">
           <data type="string"/>
         </element>
       </optional>
       <zeroOrMore>



Urpalainen              Expires January 16, 2006               [Page 39]


Internet-Draft          Presence RELAX NG schemas              July 2005


         <ref name="anyCaps"/>
       </zeroOrMore>
     </define>

     <!-- eventtypes -->
     <define name="eventtypes">
       <optional>
         <element name="message-summary">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="presence">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="refer">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="reg">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="Siemens-RTP-Stats">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="spirits-INDPs">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="spirits-user-prof">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="winfo">
           <data type="string"/>
         </element>
       </optional>
       <zeroOrMore>
         <ref name="anyCaps"/>



Urpalainen              Expires January 16, 2006               [Page 40]


Internet-Draft          Presence RELAX NG schemas              July 2005


       </zeroOrMore>
     </define>

     <!-- extensiontypes -->
     <define name="extensiontypes">
       <optional>
         <element name="rel100">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="join">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="path">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="precondition">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="pref">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="privacy">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="replaces">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="sec-agree">
           <data type="string"/>
         </element>
       </optional>
       <zeroOrMore>
         <ref name="anyCaps"/>
       </zeroOrMore>



Urpalainen              Expires January 16, 2006               [Page 41]


Internet-Draft          Presence RELAX NG schemas              July 2005


     </define>

     <!-- classtypes -->
     <define name="classtypes">
       <optional>
         <element name="business">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="personal">
           <data type="string"/>
         </element>
       </optional>
       <zeroOrMore>
         <ref name="anyCaps"/>
       </zeroOrMore>
     </define>

     <!-- actortypes -->
     <define name="actortypes">
       <optional>
         <element name="attendant">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="information">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="msg-taker">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="principal">
           <data type="string"/>
         </element>
       </optional>
       <zeroOrMore>
         <ref name="anyCaps"/>
       </zeroOrMore>
     </define>

     <!-- methodtypes -->
     <define name="methodtypes">



Urpalainen              Expires January 16, 2006               [Page 42]


Internet-Draft          Presence RELAX NG schemas              July 2005


       <optional>
         <element name="ACK">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="BYE">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="CANCEL">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="INFO">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="INVITE">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="MESSAGE">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="NOTIFY">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="OPTIONS">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="PRACK">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="PUBLISH">
           <data type="string"/>



Urpalainen              Expires January 16, 2006               [Page 43]


Internet-Draft          Presence RELAX NG schemas              July 2005


         </element>
       </optional>
       <optional>
         <element name="REFER">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="REGISTER">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="SUBSCRIBE">
           <data type="string"/>
         </element>
       </optional>
       <optional>
         <element name="UPDATE">
           <data type="string"/>
         </element>
       </optional>
       <zeroOrMore>
         <ref name="anyCaps"/>
       </zeroOrMore>
     </define>
   </grammar>

   This Servcaps schema was included by "devcaps.rng".

10.  An example instance document

   An example instance document:


   <?xml version="1.0" encoding="UTF-8"?>
   <presence xmlns="urn:ietf:params:xml:ns:pidf"
     xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model"
     xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid"
     xmlns:c="urn:ietf:params:xml:ns:pidf:cipid"
     xmlns:caps="urn:ietf:params:xml:ns:pidf:caps"
     entity="pres:someone@example.com">

     <tuple id="bs35r9">
       <status>
         <basic>open</basic>
       </status>
       <dm:deviceID>urn:device:0003ba4811e3</dm:deviceID>



Urpalainen              Expires January 16, 2006               [Page 44]


Internet-Draft          Presence RELAX NG schemas              July 2005


       <rpid:relationship><rpid:self/></rpid:relationship>
       <rpid:service-class><rpid:electronic/></rpid:service-class>
       <caps:servcaps>
         <caps:audio>true</caps:audio>
         <caps:description>
              Example service
         </caps:description>
         <caps:duplex>
           <caps:supported>
             <caps:full/>
           </caps:supported>
         </caps:duplex>
         <caps:message>true</caps:message>
         <caps:methods>
           <caps:supported>
             <caps:ACK/>
             <caps:BYE/>
             <caps:INVITE/>
           </caps:supported>
         </caps:methods>
         <caps:priority>
           <caps:supported>
             <caps:lowerthan maxvalue="10"/>
           </caps:supported>
         </caps:priority>
         <caps:schemes>
           <caps:supported>
             <caps:s>sip</caps:s>
           </caps:supported>
         </caps:schemes>
         <caps:video>false</caps:video>
       </caps:servcaps>
       <contact priority="0.8">im:someone@mobile.example.net</contact>
       <note xml:lang="en">Don't Disturb Please!</note>
       <note xml:lang="fr">Ne derangez pas, s'il vous plait</note>
       <timestamp>2001-10-27T16:49:29Z</timestamp>
     </tuple>

     <tuple id="ty4658">
       <status>
         <basic>open</basic>
       </status>
       <rpid:relationship><rpid:assistant/></rpid:relationship>
       <contact priority="1.0">mailto:secretary@example.com</contact>
     </tuple>

     <tuple id="eg92n8">
       <status>



Urpalainen              Expires January 16, 2006               [Page 45]


Internet-Draft          Presence RELAX NG schemas              July 2005


         <basic>open</basic>
       </status>
       <dm:deviceID>urn:x-mac:0003ba4811e3</dm:deviceID>
       <rpid:class>email</rpid:class>
       <rpid:service-class><rpid:electronic/></rpid:service-class>
       <rpid:status-icon
             >http://www.example.com/mailbox.png</rpid:status-icon>
       <contact priority="1.0">mailto:someone@example.com</contact>
     </tuple>

     <note>I'll be in Tokyo next week</note>

     <dm:device id="pc147">
       <dm:deviceID>urn:device:0003ba4811e3</dm:deviceID>
       <dm:note>PC</dm:note>
       <rpid:user-input idle-threshold="600"
         last-input="2004-10-21T13:20:00.000-05:00"
         >idle</rpid:user-input>
       <caps:devcaps>
         <caps:mobility>
           <caps:supported>
             <caps:mobile/>
           </caps:supported>
         </caps:mobility>
       </caps:devcaps>
     </dm:device>

     <dm:person id="p1">
       <dm:timestamp>2005-05-30T16:09:44+05:00</dm:timestamp>
       <rpid:activities
          from="2005-05-30T12:00:00+05:00"
          until="2005-05-30T17:00:00+05:00">
          <rpid:note>Far away</rpid:note>
          <rpid:away/>
       </rpid:activities>
       <rpid:class>calendar</rpid:class>
       <rpid:mood><rpid:angry/></rpid:mood>
       <rpid:place-is>
          <rpid:audio>
             <rpid:noisy/>
          </rpid:audio>
       </rpid:place-is>
       <rpid:place-type><rpid:home/></rpid:place-type>
       <rpid:privacy><rpid:unknown/></rpid:privacy>
       <rpid:sphere>bowling league</rpid:sphere>
       <rpid:status-icon
             >http://www.example.com/playing.gif</rpid:status-icon>
       <rpid:time-offset>-240</rpid:time-offset>



Urpalainen              Expires January 16, 2006               [Page 46]


Internet-Draft          Presence RELAX NG schemas              July 2005


       <c:card>http://example.com/~someone/card.vcd</c:card>
       <c:homepage>http://example.com/~someone</c:homepage>
       <c:icon>http://example.com/~someone/icon.gif</c:icon>
       <c:map>http://example.com/~someone/gml-map.xml</c:map>
       <c:sound>http://example.com/~someone/whoosh.wav</c:sound>

     </dm:person>
   </presence>

   This instance document can be validated with the described PIDF,
   PIDF+DataModel, PIDF+DataModel+RPID, PIDF+DataModel+RPID+CIPID or
   PIDF+DataModel+RPID+CIPID+CAPS schemas.  The wildcard definitions can
   be disabled when using the CAPS schema as there are no "private"
   extensions.  Likewise a simple basic PIDF instance document can be
   validated with all of these schema combinations.  This shows how
   forward and backward compatible schemas work in practice, only the
   level of scrutiny changes.

   It is worth noting that the ordering of the extension child elements
   of the <tuple> element can interchange.  This applies to the <person>
   element extensions as well.  The "interleave" definition allows
   unordered content.

11.  Security considerations

   Information transported within these documents can be highly
   sensitive.  All the security considerations described in PIDF and
   extension documents applies to this as well.

12.  Acknowledgments

   The author would like to thank Aki Niemi, Pekka Pessi and Eva-Maria
   Leppanen for their valuable comments.

13.  References

13.1  Normative references

   [1]   Bradner, S., "Key words for use in RFCs to Indicate Requirement
         Levels", BCP 14, RFC 2119, March 1997.

   [2]   "Extensible Markup Language (XML) 1.0 (Third Edition)", W3C
         Recommendation REC-xml-20040204 , February 2004.

   [3]   "Canonical XML 1.0", W3C Recommendation REC-xml-c14n-20010315 ,
         March 2001.

   [4]   "Namespaces in XML", W3C Recommendation REC-xml-names-



Urpalainen              Expires January 16, 2006               [Page 47]


Internet-Draft          Presence RELAX NG schemas              July 2005


         19990114 , January 1999.

   [5]   "XML Schema Part 1: Structures Second Edition", W3C
         Recommendation REC-xmlschema-1-20041028 , October 2004.

   [6]   "XML Schema Part 2: Datatypes Second Edition", W3C
         Recommendation REC-xmlschema-2-20041028 , October 2004.

   [7]   "RELAX NG Specification", Committee Specification 3 ,
         December 2001.

   [8]   Sugano, H., "CPIM presence information data format", RFC 3863,
         May 2003.

   [9]   Rosenberg, J., "A Data Model for Presence",
          draft-ietf-simple-presence-data-model-02 (work in progress),
         February 2005.

   [10]  Schulzrinne, H., Gurbani, V., Kyzivat, P., and J. Rosenberg,
         "RPID: Rich Presence Extensions to the Presence Information
         Data Format (PIDF)",  draft-ietf-simple-rpid-07 (work in
         progress), June 2005.

   [11]  Schulzrinne, H., "CIPID: Contact Information in Presence
         Information Data Format",  draft-ietf-simple-cipid-05 (work in
         progress), June 2005.

   [12]  Lonnfors, M. and K. Kiss, "User Agent Capability Extension to
         Presence Information Data Format (PIDF)",
          draft-ietf-simple-prescaps-ext-04 (work in progress),
         June 2005.

13.2  Informative references

   [13]  Peterson, J., "Common Profile for Presence (CPP)", RFC 3859,
         August 2004.















Urpalainen              Expires January 16, 2006               [Page 48]


Internet-Draft          Presence RELAX NG schemas              July 2005


Author's Address

   Jari Urpalainen
   Nokia Research Center
   Itamerenkatu 11-13
   Helsinki  00180
   Finland

   Phone: +358 7180 37686
   Email: jari.urpalainen@nokia.com









































Urpalainen              Expires January 16, 2006               [Page 49]


Internet-Draft          Presence RELAX NG schemas              July 2005


Intellectual Property Statement

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   ietf-ipr@ietf.org.


Disclaimer of Validity

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.


Copyright Statement

   Copyright (C) The Internet Society (2005).  This document is subject
   to the rights, licenses and restrictions contained in BCP 78, and
   except as set forth therein, the authors retain all their rights.


Acknowledgment

   Funding for the RFC Editor function is currently provided by the
   Internet Society.




Urpalainen              Expires January 16, 2006               [Page 50]