Modules | Implementer Page: exsl.object-type.html Function Syntaxstring exsl:object-type(object)
The
Most XSLT object types can be coerced to each other without error. However, there are certain coercions that raise errors, most importantly treating anything other than a node set as a node set. Authors of utilities such as named templates or user-defined extension functions may wish to give some flexibility in the parameter and argument values that are accepted by the utility; the Implementations
The following XSLT processors support
There are currently no third-party implementations of ExamplesFunctionThe following example shows how to use the Source<doc /> Stylesheet<!-- Test exslt:object-type --> <xsl:variable name="tree"> <a> <b> <c> <d /> </c> </b> </a> </xsl:variable> <xsl:variable name="string" select="'fred'" /> <xsl:variable name="number" select="93.7" /> <xsl:variable name="boolean" select="true()" /> <xsl:variable name="node-set" select="//*" /> <xsl:template match="/"> <out> : <xsl:value-of select="exslt:object-type($string)" /> ; <xsl:value-of select="exslt:object-type($number)" /> ; <xsl:value-of select="exslt:object-type($boolean)" /> ; <xsl:value-of select="exslt:object-type($node-set)" /> ; <xsl:value-of select="exslt:object-type($tree)" /> ; <xsl:if test="function-available('saxon:expression')" xmlns:saxon="http://icl.com/saxon"> <xsl:value-of select="exslt:object-type(saxon:expression('item'))" /> </xsl:if> ; </out> </xsl:template> Result<out xmlns:exslt="http://exslt.org/common">: string; number; boolean; node-set; RTF; external; </out> |
http://www.exslt.org/exsl/functions/object-type/index.html last modified 2002-11-12