Record Attribute Schema

Records can have application-specific attributes that are a sequence of name or value pairs represented as an XML string in the pszAttributes member of the PEER_RECORD structure. The attributes are used to filter a record search initiated by calls to PeerGroupSearchRecords, which takes an XML search filter specified in Record Search Query Format as a parameter.

A record attribute can be one of the following three types:

  • int is an integer value.
  • date is a datetime value represented as one of the standard formats described at
  • string is a Unicode string value.

The following list identifies the specific attribute names that are reserved by the Peer Infrastructure:

  • peerlastmodifiedby
  • peercreatorid
  • peerlastmodificationtime
  • peerrecordid
  • peerrecordtype
  • peercreationtime
  • peerlastmodificationtime

Example of Defining Record Attributes

The following schema example shows you how to define record attributes:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="">
   <xs:simpleType name="alphanum">
       <xs:restriction base="xs:string">
          <xs:pattern value="\c+" />
   <xs:complexType name="attributeType">
          <xs:extension base="xs:string">
                <xs:attribute name="name" type="alphanum" />
                <xs:attribute name="type">
                        <xs:restriction base="alphanum">
                           <xs:enumeration value="string"/>
                           <xs:enumeration value="date"/>
                           <xs:enumeration value="int"/>
    <xs:element name="attributes">
                <xs:element name="attribute" type="attributeType" minOccurs="0" maxOccurs="unbounded" />

Note  Attribute names must be sequences of alphanumeric characters. Special characters like hyphens ("-") and underscores ("_") are not allowed in an attribute name.

The following example of an XML attribute sequence contains the custom AuthenticationType and AuthExpires attributes that appear in the pszAttributes member of PEER_RECORD.

  <attribute name="AuthenticationType" type="string">Kerberos</attribute><attribute name="AuthExpires" type="date">2002-01-31</attribute>



Community Additions