本項は歴史的事項を説明しています。本項の内容の一部または全部は、現在の状況とは異なるかもしれません。
(なお本項の内容の一部または全部は、互換性または歴史的連続性のために現在も有効な場合もあります。しかし新たに利用することは避けるべきです。)
[5] 特徴述語は、特徴タグか、特徴タグの前に !
を置いたものか、特徴タグと値を =
または !=
で結んだものか、特徴タグと範囲を =
で結んだものです。 >>1
[6] 範囲は、数値2つを -
で連結し、四角括弧で括ったものです。
ただし数値は省略できます。 >>1
[7] 数値の構文は明記されていません。例示は非負整数のASCII数字列となっています。
[8] 仕様書の時代的背景から構文上空白が明示されていませんが、特徴タグや値や数値の前後に OWS を挿入できるものと推測されます。数値の前後に空白を挿入した例は示されています >>1。
[9] 利用者エージェントは特徴集合に対して特徴述語を次のように評価するべきです >>1。
[2] RFC 2295 (HTTP 透過内容折衝) 6.3 Feature predicates
Feature predicates are predicates on the contents of feature sets. They appear in the features attribute of a variant description.
特徴述語は、特徴集合の内容の述語です。
特徴述語は変種記述の feature
属性に出現します。
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).
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