[3] [[URL]] を生成する元となる構文を一般に[DFN[URL[RUBYB[雛形]@en[template]]]]といいます。
文脈などによっていくつかの構文が存在します。一応の標準規格はいくつかありますが、プロトコルやサービスによってそれぞれ少しずつ異なる構文を採用していて、
互換性はそれほど高くないようです。

* [CODE(URI)[%s]]

[26] [CODE(DOMm)@en[[[registerProtocolHandler]]]] や [CODE(DOMm)@en[[[registerContentHandler]]]]
では、 [[URL]] を生成する際に [DFN[[CODE(URI)[%s][%s (URL)]]]] の置換が行われます [SRC[>>5]]。

[28] この [CODE(URI)[%s][%s (URL)]] が含まれ得る[[絶対URL]]のことを[DFN[[[proto-URL]]]]といいます
[SRC[>>27]]。

[30] なおこの形式の値は通常の [[URL]] と同じように [[URLの解決]]が適用されます。

[REFS[
- [5]
[CITE[Web Applications 1.0]] <http://www.whatwg.org/specs/web-apps/current-work/#custom-handlers>
-- [27] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-01-16 08:47:54 +09:00]] 版) <https://html.spec.whatwg.org/#proto-url>
]REFS]

* OpenSearch URL template 

[23] [[OpenSearch]] は、[DFN[OpenSearch URL template]] を規定しています。

[REFS[
- [1]
[CITE[Specifications/OpenSearch/1.1/Draft 3 - OpenSearch]] <http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_URL_template_syntax>
- [2]
[CITE[A9.com > OpenSearch > OpenSearch Query Syntax 1.0]] <http://opensearch.a9.com/spec/opensearchquerysyntax/1.0/>
]REFS]

* URI Template

[3] [[URI Template]] 参照。

* 歴史

** [CODE(URI)[%%][%% (URL)]]

[25] [[HTML]] の[[フォームの提出]]では、 [CODE(URI)@en[[[data:]]]]
[[URL]] を生成する際に [DFN[[CODE(URI)[%%][%% (URL)]]]] の置換が行われます [SRC[>>24]]。

[29] なおこの形式の値は通常の [[URL]] と同じように [[URLの解決]]が適用されます。

[77] [[Web Forms 2.0]] で導入され、 [[HTML5]] にも引き継がれましたが、
実装されず用途も乏しいとして[TIME[2016年5月][2016-05]]に削除されました。

[REFS[
- [24] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-01-16 08:47:54 +09:00]] 版) <https://html.spec.whatwg.org/#submit-data-post>
-- [4] 旧版:
[CITE[Web Forms 2.0]] <http://www.whatwg.org/specs/web-forms/current-work/#for-data>
- [76] [CITE@en[Fix form submission for the data URL scheme]]
( ([[annevk]]著, [TIME[2016-05-27 17:47:54 +09:00]]))
<https://github.com/whatwg/html/commit/e2d80d9285976c6c38bda188c59e97456006d0a3>
]REFS]

* その他

[REFS[
- [10]
[CITE[Scholarly Link Specification Framework (S-Link-S)]] <http://www.openly.com/SLinkS/SLinkS-20060711.html>
]REFS]

[31] >>10 は [[XML]] によって[[雛形]]を記述する言語です。

[12]
[CITE@en[Web Service Definition Language (WSDL)]] ([CODE[2001-03-15 07:14:12 +09:00]] 版) <http://www.w3.org/TR/2001/NOTE-wsdl-20010315#_http:urlReplacement>

[15]
[CITE@en[Web Services Description Language (WSDL) Version 2.0 Part 2: Adjuncts]] ([CODE[2007-06-23 05:33:39 +09:00]] 版) <http://www.w3.org/TR/2007/REC-wsdl20-adjuncts-20070626/#_http_operation_location_cited_ser>

[13]
[CITE@ja[InterWikiテクニカル - InterWikiNameの記述方法など]] ([CODE[2007-02-04 18:22:17 +09:00]] 版) <http://www.hyuki.com/yukiwiki/wiki.cgi?InterWiki%a5%c6%a5%af%a5%cb%a5%ab%a5%eb>

[FIG(quote)[
[FIGCAPTION[
[72] [CITE@en[Opera: Opera Link API Beta]]
([[Frank M. Palinkas, Technical Writer]] 著, [TIME[2015-03-14 20:57:45 +09:00]] 版)
<http://www.opera.com/docs/apis/linkrest/>
]FIGCAPTION]

> uri: Search result URI; the formatting operator %s will be replaced by the search terms '''['''Required''']'''

]FIG]

[FIG(quote)[
[FIGCAPTION[
[74] [CITE@en[OpenService Format Specification for Accelerators - Version 0.8]]
([TIME[2015-04-19 15:03:40 +09:00]] 版)
<https://msdn.microsoft.com/en-us/library/cc304163(v=vs.85).aspx>
]FIGCAPTION]

> All variables are treated as required unless it the modifier "?". An optional variable that cannot be resolved is treated as an empty string for an inline parameterized URL. In a form-based parameterized URL the entire parameter element is ignored.
> Example of an optional variable in an inline parameterized URL:
> <execute action="http://encarta.msn.com/encnet/refpages/search.aspx?q={selection?}" />

]FIG]


[FIG(quote)[
[FIGCAPTION[
[75] [CITE@en[OpenService Format Specification for Accelerators - Version 0.8]]
([TIME[2015-04-19 15:03:56 +09:00]] 版)
<https://msdn.microsoft.com/en-us/library/cc304163(v=vs.85).aspx>
]FIGCAPTION]

> Escape Character
> To specify { and } literally, escape them with a backslash \. Backslash can be used to escape any character.
> \{{selection}\}

]FIG]


[6] [[XYZ]]




[7] [[nginx]] の設定ファイルでは

>
[PRE[
    proxy_pass http://$myhost:10101/$1;
]PRE]

のように[[変数]]を使って [[URL]] を生成できます。