c.xlink ([target : xlink], method : string, [name : string, value : string]*) : xlink
The method “xlink” serves for forming a method link with parameters. The result of this method is supported by a great number of further methods. An XLink consists of the following elements:
- Object link within any data source
- Target method
- Any number of parameters
An xlink or a method name can be specified as parameters. The method name is optional if an xlink is specified without further parameters (name, value).
The first example creates a reference to an onion resource with the ID 100 and the method “teaser”:
onion://data/objects/100#teaser
The second example adds the parameters "language" and "mode".
onion://data/objects/100#teaser?language=de&mode=large
The method “xlink” makes it possible to form a new XLink on the basis of an existing one. It is possible to extend or change an existing XLink in this way. The following example overwrites the parameter “mode” and supplements the XLink with the parameter “border”.
The example leads to the following result:
onion://data/objects/100#teaser?border=yes&language=de&mode=small
The existing method “teaser” was kept in this example by transferring an empty character string.
Parameters can either be added or changed, but no parameters can be removed.