As feature registration is expected to be an ongoing process, it is
generally not possible for a user agent to know the meaning of all
feature tags it can possibly encounter in a variant description. A
user agent SHOULD treat all features tags unknown to it as absent
from its feature set.
A user agent may change the contents of its feature set depending on
the type of request, and may also update it to reflect changing
conditions, for example a change in the window size. Therefore, when
considering feature negotiation, one usually talks about `the feature
set of the current request'.
6.3 Feature predicates
Feature predicates are predicates on the contents of feature sets.
They appear in the features attribute of a variant description.
fpred = [ "!" ] ftag
| ftag ( "=" | "!=" ) tag-value
| ftag "=" "[" numeric-range "]"
numeric-range = [ number ] "-" [ number ]
Feature predicates are used in features attributes (section 6.4),
which are used in variant descriptions (section 5). Variant
descriptions can be transmitted in Alternates headers (section 8.3).
RFC 2295 Transparent Content Negotiation March 1998
Examples of feature predicates are
blebber, !blebber, paper=a4, colordepth=5, blex!=54,
dpi=[300-599], colordepth=[24-]
Using the feature set of the current request, a user agent SHOULD
compute the truth value of the different feature predicates as
follows.
ftag true if the feature is present, false otherwise
!ftag true if the feature is absent, false otherwise
ftag=V true if the feature is present with the value V,
false otherwise,
ftag!=V true if the feature is not present with the value V,
false otherwise,
ftag=[N-M] true if the feature is present with at least one
numeric value, while the highest value with which it
is present in the range N-M, false otherwise. If N
is missing, the lower bound is 0. If M is missing,
the upper bound is infinity.
As an example, with the feature set
{ ( "blex" , { } ),
( "colordepth" , { "5" } ),
( "UA-media" , { "stationary" } ),
( "paper" , { "A4", "A3" } ) ,
( "x-version" , { "104", "200" } )
}
the following predicates are true:
blex, colordepth=[4-], colordepth!=6, colordepth, !screenwidth, UA-
media=stationary, UA-media!=screen, paper=A4, paper =!A0,
colordepth=[ 4 - 6 ], x-version=[100-300], x-version=[200-300]
and the following predicates are false:
!blex, blebber, colordepth=6, colordepth=foo, !colordepth,
screenwidth, screenwidth=640, screenwidth!=640, x-version=99, UA-
media=screen, paper=A0, paper=a4, x-version=[100-199], wuxta
RFC 2295 Transparent Content Negotiation March 1998
6.4 Features attribute
The features attribute, for which section 5.1 defines the syntax
"{" "features" feature-list "}"
is used in a variant description to specify how the presence or
=13= |