c.literalMethodExists ([target : xlink], method : string) : boolean

The function literalMethodExists tests, if a literal method exists for the given xlink. The underlying data type of the xlink is resolved and the template system searches for a method with the given name.

<xsl:variable name="target" select="'onion://data/objects/100'" />
<xsl:if test="c.literalMethodExists($target, 'teaser')">
<c.literalCall id="{$target}" method="teaser" />
Conditional literal call

Testing for a method existence can be used to implement mechanisms similar to interfaces. The existence of a method says nothing about how executable it is however. The method may need further parameters.