| 1 |
apache |
1.2 |
#pattern
|
| 2 |
|
|
<span class=secno>* </span>URLs
|
| 3 |
|
|
#ja
|
| 4 |
|
|
<span class=secno>$1 </span>URL
|
| 5 |
|
|
|
| 6 |
|
|
#en
|
| 7 |
|
|
This specification defines the term <a href="#url">URL</a>, and defines
|
| 8 |
|
|
various algorithms for dealing with URLs, because for historical reasons
|
| 9 |
|
|
the rules defined by the URI and IRI specifications are not a complete
|
| 10 |
|
|
description of what HTML user agents need to implement to be compatible
|
| 11 |
|
|
with Web content.
|
| 12 |
|
|
#ja
|
| 13 |
|
|
この仕様書は、用語 <a href="#url">URL</a> を定義し、 URL
|
| 14 |
|
|
を処理する各種算法を定義します。というのは、歴史的理由により、 URI や IRI
|
| 15 |
|
|
の仕様書で定義されている規則は Web 内容との互換性のために HTML
|
| 16 |
|
|
利用者エージェントが実装する必要があるものの完全な説明となっていないからです。
|
| 17 |
|
|
|
| 18 |
|
|
#en
|
| 19 |
|
|
A <dfn id=url>URL</dfn> is a string used to identify a resource. <span
|
| 20 |
|
|
id=urldoc>A <a href="#url">URL</a> is always associated with a
|
| 21 |
|
|
<code>Document</code>, either explicitly when the URL is created or
|
| 22 |
|
|
defined; or through a DOM node, in which case the associated
|
| 23 |
|
|
<code>Document</code> is the node's <code>Document</code>; or through a
|
| 24 |
|
|
script, in which case the associated <code>Document</code> is the script's
|
| 25 |
|
|
<a href="#script4">script document context</a>.</span>
|
| 26 |
|
|
#ja
|
| 27 |
|
|
<dfn id=url>URL</dfn> は資源を識別するために使われる文字列です。<span
|
| 28 |
|
|
id=urldoc><a href="#url">URL</a> は常に <code>Document</code>
|
| 29 |
|
|
と関連付けられています。この関連付けは URL が作成されるか定義される時に明示的になされるか、
|
| 30 |
|
|
または DOM 節点を通じてなされる (この場合、関連付けられた <code>Document</code>
|
| 31 |
|
|
は節点の <code>Document</code> です。) か、スクリプトを通じてなされます
|
| 32 |
|
|
(この場合、関連付けられた <code>Document</code>
|
| 33 |
|
|
はスクリプトの<a href="#script4">スクリプト文書文脈</a>です。)。</span>
|
| 34 |
|
|
|
| 35 |
|
|
#en
|
| 36 |
|
|
A <a href="#url">URL</a> is a <dfn id=valid>valid URL</dfn> if at least
|
| 37 |
|
|
one of the following conditions holds:
|
| 38 |
|
|
#ja
|
| 39 |
|
|
<a href="#url">URL</a> は、次の条件の最低1つが満たされる場合、
|
| 40 |
|
|
<dfn id=valid>妥当な URL</dfn> です。
|
| 41 |
|
|
|
| 42 |
|
|
#en
|
| 43 |
|
|
The <a href="#url">URL</a> is a valid URI reference <a
|
| 44 |
|
|
href="#refsRFC3986">[RFC3986]</a>.
|
| 45 |
|
|
#ja
|
| 46 |
|
|
<a href="#url">URL</a> は妥当な URI 参照 <a
|
| 47 |
|
|
href="#refsRFC3986">[RFC3986]</a> である。
|
| 48 |
|
|
|
| 49 |
|
|
#en
|
| 50 |
|
|
The <a href="#url">URL</a> is a valid IRI reference and it has no
|
| 51 |
|
|
query component. <a href="#refsRFC3987">[RFC3987]</a>
|
| 52 |
|
|
#ja
|
| 53 |
|
|
<a href="#url">URL</a> は妥当な IRI 参照であり、照会部品を持たない。 <a href="#refsRFC3987">[RFC3987]</a>
|
| 54 |
|
|
|
| 55 |
|
|
#en
|
| 56 |
|
|
The <a href="#url">URL</a> is a valid IRI reference and its query
|
| 57 |
|
|
component contains no unescaped non-ASCII characters. <a
|
| 58 |
|
|
href="#refsRFC3987">[RFC3987]</a>
|
| 59 |
|
|
#ja
|
| 60 |
|
|
<a href="#url">URL</a> は妥当な IRI 参照であり、照会部品は逃避されていない非
|
| 61 |
|
|
ASCII 文字を含まない。 <a
|
| 62 |
|
|
href="#refsRFC3987">[RFC3987]</a>
|
| 63 |
|
|
|
| 64 |
|
|
#en
|
| 65 |
|
|
The <a href="#url">URL</a> is a valid IRI reference and the <a
|
| 66 |
|
|
href="#character3" title="document's character encoding">character
|
| 67 |
|
|
encoding</a> of the URL's <code>Document</code> is UTF-8 or UTF-16. <a
|
| 68 |
|
|
href="#refsRFC3987">[RFC3987]</a>
|
| 69 |
|
|
#ja
|
| 70 |
|
|
<a href="#url">URL</a> は妥当な IRI 参照であり、 URL の <code>Document</code> の<a
|
| 71 |
|
|
href="#character3" title="document's character encoding">文字符号化</a>は
|
| 72 |
|
|
UTF-8 か UTF-16 である。 <a
|
| 73 |
|
|
href="#refsRFC3987">[RFC3987]</a>
|
| 74 |
|
|
|
| 75 |
|
|
#en
|
| 76 |
|
|
The term "URL" in this specification is used in a manner
|
| 77 |
|
|
distinct from the precise technical meaning it is given in RFC 3986.
|
| 78 |
|
|
Readers familiar with that RFC will find it easier to read <em>this</em>
|
| 79 |
|
|
specification if they pretend the term "URL" as used herein is really
|
| 80 |
|
|
called something else altogether.
|
| 81 |
|
|
#ja
|
| 82 |
|
|
この仕様書中の用語「URL」は、 RFC 3986 で与えられている正確な技術的な意味と異なった形で使われています。
|
| 83 |
|
|
RFC 3986 に精通した読者にとっては、ここでの用語「URL」が何か全く別の呼ばれ方をしたものであると思った方が<em>この</em>仕様書を読むのが楽になるでしょう。
|
| 84 |
|
|
|
| 85 |
|
|
#pattern
|
| 86 |
|
|
<span class=secno>* </span>Parsing URLs
|
| 87 |
|
|
#ja
|
| 88 |
|
|
<span class=secno>$1 </span>URL の構文解析
|
| 89 |
|
|
|
| 90 |
|
|
#en
|
| 91 |
|
|
To <dfn id=parse0>parse a URL</dfn> <var title="">url</var> into its
|
| 92 |
|
|
component parts, the user agent must use the following steps:
|
| 93 |
|
|
#ja
|
| 94 |
|
|
利用者エージェントは、 <var title="">url</var> という
|
| 95 |
|
|
<dfn id=parse0>URL を構文解析</dfn>して各部品部分に分ける際に、
|
| 96 |
|
|
次の段階を使わなければ[[MUST:なりません]]。
|
| 97 |
|
|
|
| 98 |
|
|
#en
|
| 99 |
|
|
Strip leading and trailing <a href="#space" title="space
|
| 100 |
|
|
character">space characters</a> from <var title="">url</var>.
|
| 101 |
|
|
#ja
|
| 102 |
|
|
<var title="">url</var> から先頭と末尾の<a href="#space" title="space
|
| 103 |
|
|
character">間隔文字</a>を除去します。
|
| 104 |
|
|
|
| 105 |
|
|
#en
|
| 106 |
|
|
Parse <var title="">url</var> in the manner defined by RFC 3986, with
|
| 107 |
|
|
the following exceptions:
|
| 108 |
|
|
#ja
|
| 109 |
|
|
<var title="">url</var> を RFC 3986 で定義された方法で構文解析します。
|
| 110 |
|
|
ただし、次の例外に従います。
|
| 111 |
|
|
|
| 112 |
|
|
#en
|
| 113 |
|
|
Add all characters with codepoints less than or equal to U+0020 or
|
| 114 |
|
|
greater than or equal to U+007F to the <unreserved> production.
|
| 115 |
|
|
#ja
|
| 116 |
|
|
符号位置が U+0020 以下の文字や U+007F 以上の文字をすべて <unreserved>
|
| 117 |
|
|
生成規則に追加します。
|
| 118 |
|
|
|
| 119 |
|
|
#en
|
| 120 |
|
|
Add the characters U+0022, U+003C, U+003E, U+005B .. U+005E, U+0060,
|
| 121 |
|
|
and U+007B .. U+007D to the <unreserved> production. <!--
|
| 122 |
|
|
0022 QUOTATION MARK
|
| 123 |
|
|
003C LESS-THAN SIGN
|
| 124 |
|
|
003E GREATER-THAN SIGN
|
| 125 |
|
|
005B LEFT SQUARE BRACKET
|
| 126 |
|
|
005C REVERSE SOLIDUS
|
| 127 |
|
|
005D RIGHT SQUARE BRACKET
|
| 128 |
|
|
005E CIRCUMFLEX ACCENT
|
| 129 |
|
|
0060 GRAVE ACCENT
|
| 130 |
|
|
007B LEFT CURLY BRACKET
|
| 131 |
|
|
007C VERTICAL LINE
|
| 132 |
|
|
007D RIGHT CURLY BRACKET
|
| 133 |
|
|
-->
|
| 134 |
|
|
#ja
|
| 135 |
|
|
文字 U+0022、U+003C、U+003E、U+005B ~ U+005E、U+0060、
|
| 136 |
|
|
U+007B ~ U+007D を <unreserved> 生成規則に追加します。 <!--
|
| 137 |
|
|
0022 QUOTATION MARK
|
| 138 |
|
|
003C LESS-THAN SIGN
|
| 139 |
|
|
003E GREATER-THAN SIGN
|
| 140 |
|
|
005B LEFT SQUARE BRACKET
|
| 141 |
|
|
005C REVERSE SOLIDUS
|
| 142 |
|
|
005D RIGHT SQUARE BRACKET
|
| 143 |
|
|
005E CIRCUMFLEX ACCENT
|
| 144 |
|
|
0060 GRAVE ACCENT
|
| 145 |
|
|
007B LEFT CURLY BRACKET
|
| 146 |
|
|
007C VERTICAL LINE
|
| 147 |
|
|
007D RIGHT CURLY BRACKET
|
| 148 |
|
|
-->
|
| 149 |
|
|
|
| 150 |
|
|
#en
|
| 151 |
|
|
Add a single U+0025 PERCENT SIGN character as a second alternative
|
| 152 |
|
|
way of matching the <pct-encoded> production, except when the
|
| 153 |
|
|
<pct-encoded> is used in the <reg-name> production.
|
| 154 |
|
|
#ja
|
| 155 |
|
|
単一の U+0025 PERCENT SIGN 文字を <pct-encoded>
|
| 156 |
|
|
生成規則に一致する2つ目の方法として追加します。ただし、 <pct-encoded>
|
| 157 |
|
|
が <reg-name> 生成規則で使われる時を除きます。
|
| 158 |
|
|
|
| 159 |
|
|
#en
|
| 160 |
|
|
Add the U+0023 NUMBER SIGN character to the characters allowed in
|
| 161 |
|
|
the <fragment> production.
|
| 162 |
|
|
#ja
|
| 163 |
|
|
U+0023 NUMBER SIGN 文字を <fragment> 生成規則で認められる文字に追加します。
|
| 164 |
|
|
|
| 165 |
|
|
#en
|
| 166 |
|
|
If <var title="">url</var> doesn't match the <URI-reference>
|
| 167 |
|
|
production, even after the above changes are made to the ABNF
|
| 168 |
|
|
definitions, then parsing the URL fails with an error. <a
|
| 169 |
|
|
href="#refsRFC3986">[RFC3986]</a>
|
| 170 |
|
|
#ja
|
| 171 |
|
|
ABNF 定義に前述の変更を加えた後であっても
|
| 172 |
|
|
<var title="">url</var> が <URI-reference> 生成規則に一致しない場合は、
|
| 173 |
|
|
URL の構文解析は誤りにより失敗とします。 <a
|
| 174 |
|
|
href="#refsRFC3986">[RFC3986]</a>
|
| 175 |
|
|
|
| 176 |
|
|
#en
|
| 177 |
|
|
Otherwise, parsing <var title="">url</var> was successful; the
|
| 178 |
|
|
components of the URL are substrings of <var title="">url</var> defined
|
| 179 |
|
|
as follows:
|
| 180 |
|
|
#ja
|
| 181 |
|
|
そうでない場合、 <var title="">url</var> の構文解析は成功です。 URL
|
| 182 |
|
|
の部品は次の通り定義される <var title="">url</var> の各部分文字列です。
|
| 183 |
|
|
|
| 184 |
|
|
#en
|
| 185 |
|
|
The substring matched by the <scheme> production, if any.
|
| 186 |
|
|
#ja
|
| 187 |
|
|
<scheme> 生成規則に一致する部分文字列 (あれば)。
|
| 188 |
|
|
|
| 189 |
|
|
#en
|
| 190 |
|
|
The substring matched by the <host> production, if any.
|
| 191 |
|
|
#ja
|
| 192 |
|
|
<host> 生成規則に一致する部分文字列 (あれば)。
|
| 193 |
|
|
|
| 194 |
|
|
#en
|
| 195 |
|
|
The substring matched by the <port> production, if any.
|
| 196 |
|
|
#ja
|
| 197 |
|
|
<port> 生成規則に一致する部分文字列 (あれば)。
|
| 198 |
|
|
|
| 199 |
|
|
#en
|
| 200 |
|
|
If there is a <scheme> component and a <port> component
|
| 201 |
|
|
and the port given by the <port> component is different than the
|
| 202 |
|
|
default port defined for the protocol given by the <scheme>
|
| 203 |
|
|
component, then <hostport> is the substring that starts with the
|
| 204 |
|
|
substring matched by the <host> production and ends with the
|
| 205 |
|
|
substring matched by the <port> production, and includes the
|
| 206 |
|
|
colon in between the two. Otherwise, it is the same as the
|
| 207 |
|
|
<host> component.
|
| 208 |
|
|
#ja
|
| 209 |
|
|
<scheme> 部品と <port> 部品があり、 <port>
|
| 210 |
|
|
部品により与えられるポートが <scheme> 部品により与えられるプロトコルに対して定義された既定のポートと異なる場合、
|
| 211 |
|
|
<hostport> は <host> 生成規則に一致する部分文字列で始まり、
|
| 212 |
|
|
<port> 生成規則に一致する部分文字列で終わり、両者の間のコロンを含む部分文字列です。
|
| 213 |
|
|
そうでない場合、 <host> 部品と同じです。
|
| 214 |
|
|
|
| 215 |
|
|
#en
|
| 216 |
|
|
The substring matched by one of the following productions, if one of
|
| 217 |
|
|
them was matched:
|
| 218 |
|
|
#ja
|
| 219 |
|
|
次の生成規則のいずれかに一致する部分文字列 (いずれかが一致する場合)。
|
| 220 |
|
|
|
| 221 |
|
|
#en
|
| 222 |
|
|
The substring matched by the <query> production, if any.
|
| 223 |
|
|
#ja
|
| 224 |
|
|
<query> 生成規則に一致する部分文字列 (あれば)。
|
| 225 |
|
|
|
| 226 |
|
|
#en
|
| 227 |
|
|
The substring matched by the <fragment> production, if any.
|
| 228 |
|
|
#ja
|
| 229 |
|
|
<fragment> 生成規則に一致する部分文字列 (あれば)。
|
| 230 |
|
|
|