+<template name="is-xsl">
+ <param name="element" select="."/>
+ <choose>
+ <when test="$element/self::xsl:*">
+ <value-of select="true()"/>
+ </when>
+ <otherwise>
+ <variable name="namespace" select="namespace-uri($element)"/>
+ <variable name="extension-namespaces">
+ <for-each select="$element/ancestor-or-self::*/@xsl:extension-element-prefixes">
+ <variable name="prefixes"
+ select="concat(' ', normalize-space(.), ' ')"/>
+ <variable name="namespaces"
+ select="../namespace::*[contains($prefixes, concat(' ', name(), ' ')) or
+ (name() = '' and contains($prefixes, ' #default '))]"/>
+ <value-of select="$namespaces[. = $namespace]"/>
+ </for-each>
+ </variable>
+ <value-of select="$extension-namespaces != ''"/>
+ </otherwise>
+ </choose>
+</template>
+