http://www.w3.org/1999/XSL/Transform

c.xmlCall ([target : xlink], method : string, [name : string, value : string]*) : nodeset

The method “xmlCall” makes it possible to call an XML method and returns its result as a nodeset. The parameter “xlink” can be a complete link here, which was created via the method “xlink”.

An xlink or a method name can be specified as parameters. The method name is optional if an xlink has been specified without further parameters (name, value).

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:template match="/">
<xsl:copy-of select="c.xmlCall('onion://data/objects/100', 'meta')" />
<xsl:variable name="meta" select="c.xmlCall('onion://data/objects/100', 'meta', 'language', 'de')/meta" />
<xsl:if test="count($meta/info) > 0">
<xsl:copy-of select="c.xmlCall($meta/info[1]/@target)" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Calling a remote method

The first example calls the XML method “meta” for the onion object 100 and writes the result into the output as XML. The second example loads the result of the method “meta” with the parameter “language” into a variable. If the result below the element “meta” has at least one info element, the target attribute of the first info element is used for a further xmlCall. It is assumed that a valid xlink to a further XML method is located there.

<c.xmlCall id="onion://data/objects/100" method="teaser" mode="large" border="yes" />
<c.xmlCall xsl-variable="content" xsl-select="/content" method="content" />
<xsl:value-of select="$content/meta/@label" />
Call of an distant method with an XML-Tag

The XML syntax serves for better legibility. The attributes “id” and “method·are reserved for the indication of xlinks and the target method. If no method is indicated, the system uses the method “default”. The same applies for the XLink. If no XLink is specified, the specific ID is used.

However, the function cannot be called without at least one parameter. This means that if neither the XLink nor the method are specified, then at least one variable (which can be transferred to the method) must be transferred.

When the parameter “xsl-variable” is specified, the variable is created and filled with the result of the xml method. The indication of the parameter xsl-select selects or copies a fragment of the result.

<xsl:variable name="longDescription" select="false()" />
<c.xmlCall id="onion://data/objects/100" method="meta">
<xsl:if test="$longDescription">
<xsl:attribute name="longDescription">yes</xsl:attribute>
</xsl:if>
</c.xmlCall>
Condtional transfer of a parameter.