
fn:element-available( $element-name as xs:string ) as xs:boolean
Returns true if and only if the name of an XSLT instruction is passed in.
This function is only available in XSLT; it is not available in XQuery.
| Parameters | |
|---|---|
| element-name | The name of the element to test. |
xquery version "1.0-ml";
xdmp:xslt-eval(
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="foo">
<xsl:value-of
select="element-available('xsl:apply-templates')"/>
</xsl:template>
</xsl:stylesheet>,
document{<foo>hello there</foo>})
=> true