2.2.3.5 Record Attributes

Each record can contain a set of attributes, which are name/value pairs encoded in XML. These attributes allow record searching at the application level.

The XML schema for the attributes is as follows.

  
 <?xml version="1.0" encoding="utf-8"?>                                                          
 <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">                                                          
   <xs:element name="attributes">                                                          
     <xs:complexType>                                                          
       <xs:sequence>                                                          
         <xs:element maxOccurs="unbounded" name="attribute">                                                          
           <xs:complexType>                                                          
             <xs:simpleContent>                                                          
               <xs:extension base="xs:string">                                                          
                 <xs:attribute name="name" type="xs:string" use="required"/>                                                          
                 <xs:attribute name="type" use="required">                                                          
                   <xs:simpleType>                                                          
                     <xs:restriction base="xs:string">                                                          
                       <xs:enumeration value="string"/>                                                          
                       <xs:enumeration value="int"/>                                                          
                       <xs:enumeration value="date"/>                                                          
                     </xs:restriction>                                                          
                   </xs:simpleType>                                                          
                 </xs:attribute>                                                           
               </xs:extension>                                                          
             </xs:simpleContent>                                                          
           </xs:complexType>                                                          
         </xs:element>                                                          
       </xs:sequence>                                                          
     </xs:complexType>                                                          
   </xs:element>                                                          
 </xs:schema>

attribute/name: The name of the name/value pair. This is a sequence of no more than 40 alphanumeric characters defined as the set of the numbers 0 to 9, the letters a to z and the letters A to Z; no other characters are allowed.

The following list identifies the specific attribute names that are reserved by the Peer Infrastructure. These attributes MUST NOT be present in any application-defined record:

  • peerlastmodifiedby

  • peercreatorid

  • peerlastmodificationtime

  • peerrecordid

  • peerrecordtype

  • peercreationtime

  • peerlastmodificationtime

The name of an attribute need not be unique inside a record. For example, there can be multiple name/value pairs with the name "keyword" in the same record.

attribute/type: The type of the name/value pair. The only allowed values are the strings "int", "string", and "date". If this value is "int", the attribute value MUST be all digits. If this is "string", the value can be any string. If this is "date", the value MUST be a valid date string formatted as specified in [ISO-8601].

attribute: The body of the attribute tag contains the value of the name/value pair.

An example of the expected format of the attributes string is as follows.

  
 <attributes>                                                          
    <attribute name="Owner" type="string">Scott</attribute>                                                          
    <attribute name="Birthday" type="date">1972-04-04</attribute>                                                          
    <attribute name="Priority" type="int">1</attribute>                                                          
 </attributes>