key Element

Defines fields and matching rules that Windows Media Center uses to locate the TV programs to record through the click-to-record feature.

Syntax

  <key
    field="
  URI
  "
    match="{contains | exact | startswith}"
>
</key>

Attributes

field

Specifies a URI that uniquely identifies the field to be matched against. The valid values for this attribute depend on the parent of the key element. For more information, see the Remarks section.

match

Defines the method by which string terms are matched. It must be one of the following values:

Value Description
contains The field must contain a word that matches or begins with the specified string. An occurrence of the specified string in the middle or at the end of a word is not considered to be a match.
exact The field and the specified string must be an exact match.
startswith The field must start with the specified string.

Remarks

This element must be nested inside the airing, program, or service elements. Each of these elements must contain one or more key elements. Windows Media Center interprets multiple key elements as logical ANDs—all of them must be satisfied to qualify as a match.

If the parent element is program, the field attribute must be one of the following values:

Value Description
urn:schemas-microsoft-com:ehome:epg:program#title A string containing the program title.
urn:schemas-microsoft-com:ehome:epg:program#episodetitle A string containing the episode title.
urn:schemas-microsoft-com:ehome:epg:program#releaseyear An int specifying the year that the program was released.

If the program element of a keyword recording request specifies a match on the program title field (urn:schemas-microsoft-com:ehome:epg:program#title), only the "contains" and "exact" match values are supported. The "startswith" match value is treated as "contains". For more information, see Types of Recording Requests.

Note that releaseyear must be combined with another value. For example, the following request is valid:

<program>
    <key field="urn:schemas-microsoft-com:ehome:epg:program#title">Azati</key>
    <key field="urn:schemas-microsoft-com:ehome:epg:program#releaseyear">1963</key>
</program>

However, this request is not:

<program>
    <key field="urn:schemas-microsoft-com:ehome:epg:program#releaseyear">1963</key>
</program>

If the parent element is service, the field attribute must be one of the following values:

Value Description
urn:schemas-microsoft-com:ehome:epg:service#name A string containing the name of the service.
urn:schemas-microsoft-com:ehome:epg:service#callsign A string containing the call sign of the service.
urn:schemas-microsoft-com:ehome:epg:service#affiliate A string containing the name of the service affiliate.
urn:schemas-microsoft-com:ehome:epg:service#mappedChannelNumber A string specifying the channel number. To specify an Advanced Television Systems Committee (ATSC) channel number, use the following format:
"major-minor"

where major and minor are integers separated by a hyphen.

Because channel positions vary greatly from one user to another, you should avoid using this key criterion, if possible.

urn:schemas-microsoft-com:ehome:epg:service#id A string that is displayed in the Electronic Program Guide page in Windows Media Center. In some countries or regions, the service name is displayed in this field rather than an official call sign, or the service name may be left blank.

If the parent element is airing, the field attribute must be one of the following values:

Value Description
urn:schemas-microsoft-com:ehome:epg:airing#starttime A value of the dateTime XML data type containing the date and starting time when the program will be broadcast.

A dateTime value represents a specific instance of time. The format for specifying the date and time is a follows.

CCYY-MM-DDThh:mm:ssTZD 

The following table describes the dateTime syntax:

Syntax Description
CC Two-digit century.
YY Two-digit year.
MM Two-digit month (01=January).
DD Two-digit day of month (01 through 31).
T A literal "T" to indicate the beginning of the time element.
hh Two-digit hour (00 through 23; A.M. and P.M. are not allowed).
mm Two-digit minute (00 through 59).
ss Two-digit second (00 through 59). Additional digits can be used to increase the precision of fractional seconds. For example, the format ss.ss... with any number of digits after the decimal point is supported.
TZD Time zone designator.

The following table shows values for the Time Zone Designator (TZD):

Syntax Description
Z Specifies coordinated Universal Time Coordinate (UTC). The Z must be uppercase.
+hh:mm Specifies that the time is hh hours and mm minutes ahead of UTC.
-hh:mm Specifies that the time is hh hours and mm minutes behind UTC.

If the Z is included, both hours and minutes must be specified. To designate exactly UTC, use Z+00:00.

Requirements

Platform: Windows XP Media Center Edition 2005 and later

See Also