Loading TOC...

MarkLogic 10 Product Documentation
fn:element-available

fn:element-available(
   $element-name as xs:string
) as xs:boolean

Summary

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.

Example

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

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.