7 Appendix B: XPIDF Presence Document Format

The XPIDF Presence Document always contains the top-level element "presence", which indicates that the remainder of the document contains presence information.

 <!ELEMENT presence (presentity, atom*, display?)>

The first subelement of the presence element is the "presentity" element, which identifies the presentity for whom the presence data is being reported.

 <!ELEMENT presentity (#PCDATA)>
 <!ATTLIST presentity uri CDATA #REQUIRED>

The presentity tag has a single mandatory attribute, uri, which gives the address of the presentity. The content of the presentity tag is parsed character data giving a human-readable name.

Following the presentity tag within the presence tag is a list of atoms.

Atoms are structured as a collection of addresses. These can either be communications addresses, represented by URLs, or a postal address.

 <!ELEMENT atom (postal?, address*)>
 <!ATTLIST atom atomid  CDATA #REQUIRED
            expires CDATA #IMPLIED>

The atom element has the mandatory attribute "id", the unique identifier for the group, and the optional attribute "expires", which indicates the time after which the presence data is considered invalid. The expiration time is expressed as an integral number of seconds since January 1, 1970, 00:00 UTC.

A postal address is indicated by the "postal" element, and consists of freeform text:

 <!ELEMENT postal (#PCDATA)>

It can contain XML markup from some external namespace, as described previously.

Communications addresses are described by the "address" element.

 <!ELEMENT address (status | class | duplex | feature | note |
    mobility | msnsubstatus )*>
    <!ATTLIST address uri      CDATA  #REQUIRED
                      priority CDATA  #IMPLIED>

The address element has a single mandatory attribute, uri, which gives the URI of the communications address being described. It also has an optional attribute priority. The priority tag contains an integer that indicates the relative preference of this address over other addresses. It is a floating-point value between 0 and 1, with 1 being the highest preference.

Within the address tag, several subtags are defined to specify characteristics of the communications address. These tags have the following meanings:

  • status

    An indicator meant for machine consumption that indicates the status of this communications address. Valid values are "open", which means communications can be attempted to this address, "closed", which means communications cannot be attempted, and "inuse", which means communications is currently being actively used with the entity receiving the Presence Document. For example, if an instant messaging URL is placed in the uri attribute of the address, and the status is "inuse", this means that the user sending the updated Presence Document is currently typing an instant message to the recipient of the Presence Document.

    This enables a recent feature on MSN, which allows the user to see when the recipient of the user's instant message is currently typing a reply to it.

     <!ELEMENT status EMPTY>
            <!ATTLIST status status (open|closed|inuse) #REQUIRED>
    
  • class

    This tag contains either the value "business" or "personal", indicating whether the address is for business or nonbusiness use. There can be only one class tag per address.

     <!ELEMENT class EMPTY>
                  <!ATTLIST class class   (business|personal) #REQUIRED>
    
  • duplex

    The duplex tag contains one of the values "full", "half", "send-only", or "receive-only". It indicates whether the address can be used for communications in one direction, the other direction, or both. For example, a page would be considered receive-only. There can only be one duplex tag per address.

       <!ELEMENT duplex EMPTY>
          <!ATTLIST duplex duplex 
              (full|half|send-only|receive-only) #REQUIRED>
    
  • feature

    The feature tag lists features specific to that communications means. For voice addresses, defined values include "voicemail" and "attendant". There can be more than one feature tag per address.

     <!ELEMENT feature EMPTY>
              <!ATTLIST feature feature (voicemail|attendant) #REQUIRED>
    
  •  mobility

    The mobility tag indicates whether the terminal with the given communications address is moving around ("mobile") or fixed ("fixed"). There can be only a single mobility tag per address.

       <!ELEMENT mobility EMPTY>
            <!ATTLIST mobility mobility (fixed|mobile) #REQUIRED>
    
  • note

    Contains freeform text meant for display to the user, indicating some kind of information about the communications address. There can only be one note tag per address. The note tag can contain XML data from a properly qualified external XML namespace.

     <!ELEMENT note (#PCDATA)>
    
  • msnsubstatus

    Provides supplementary status information. The following values are defined: "unknown", "away", "online", "idle", "busy", "berightback", "onthephone", "outtolunch".

     <!ELEMENT msnsubstatus EMPTY>
        <!ATTLIST msnsubstatus
         (unknown|away|online|idle|busy|berightback|onthephone|outtolunch)
          #REQUIRED>
    

A PIDF document that appears as a top-level XML document is identified with the formal public identifier "-//IETF//DTD RFCxxxx XPIDF 1.0//EN". If this document is published as an RFC, "xxxx" will be replaced by the RFC number. PIDF documents have the MIME type "application/xpidf+xml".

Note that the URIs specifying XML namespaces are only globally unique names; they do not have to reference any particular actual object. The URI of a canonical source of this specification meets the requirement of being globally unique, and is also useful to document the format.

 <!ELEMENT display EMPTY>
   <!ATTLIST display name CDATA #REQUIRED>

Following the atom tag within the presence tag, there can be a display tag. The display tag has a single required attribute to specify the display name.

The DTD of XPIDF is shown below:

  
  
    <?xml version="1.0" encoding="UTF-8" ?>
    <!ELEMENT presence (presentity, atom*, display?)>
  
    <!ELEMENT presentity (#PCDATA)>
    <!ATTLIST presentity uri CDATA #REQUIRED>
    <!ELEMENT atom (postal?, address*)>
    <!ATTLIST atom atomid  CDATA #REQUIRED
                   expires CDATA #IMPLIED>
    <!ELEMENT postal (#PCDATA)>
    <!ELEMENT address (status | class | duplex | feature | note | 
        mobility | msnsubstatus )*>
    <!ATTLIST address uri      CDATA  #REQUIRED
                      priority CDATA  #IMPLIED>
    <!ELEMENT status EMPTY>
    <!ATTLIST status status (open|closed|inuse) #REQUIRED>
    <!ELEMENT class EMPTY>
    <!ATTLIST class class   (business|personal) #REQUIRED>
    <!ELEMENT duplex EMPTY>
    <!ATTLIST duplex duplex 
             (full|half|send-only|receive-only) #REQUIRED>
    <!ELEMENT feature EMPTY>
    <!ATTLIST feature feature (voicemail|attendant) #REQUIRED>
    <!ELEMENT mobility EMPTY>
    <!ATTLIST mobility mobility (fixed|mobile) #REQUIRED>
    <!ELEMENT note (#PCDATA)>
     <!ELEMENT msnsubstatus EMPTY>
      <!ATTLIST msnsubstatus 
        (unknown|away|online|idle|busy|berightback|onthephone|outtolunch)
       #REQUIRED>
     <!ELEMENT display EMPTY>
    <!ATTLIST display name CDATA #REQUIRED>