If a $node-var is not a node, the following error is displayed in the mapper:
Error occurred while executing XQuery: Error loading the XQuery or XSLT for this method: Type error in function node-kind invocation: expected type node, given type [string@http://www.w3.org/2001/XMLSchema]
If the value of $node-var is the empty sequence, the following error is displayed in the mapper:
Error occurred while executing XQuery: Error loading the XQuery or XSLT for this method: Type error in function node-kind invocation: expected type node, given type empty
The empty sequence is a sequence containing zero items (), which is similar to null in SQL.
xf:node-kind(xf:node $node-var) —> xs:string
Returns a string which represents the kind of $node-var. One of the following strings will be returned: document, element, attribute, text, namespace, processing-instruction, or comment.
When you invoke the following query:
let $x := <e a="b">c</e>
return <type>{xf:node-kind($x)}</type>
The following result is generated:
<type>element</type>
When you invoke the following query:
let $x := <e a="b">c</e>
return <type>{xf:node-kind($x/@a)}</type>
The following result is generated:
<type>attribute</type>
When you invoke the following query:
let $x := <e a="b">c</e>
return <type>{xf:node-kind($x/text())}</type>
The following result is generated:
<type>text</type>
W3C node-kind function description.