Loading TOC...

xdmp:node-kind

xdmp:node-kind(
   $node as node()
) as xs:string

Summary

Returns an xs:string representing the node's kind: either "document", "element", "attribute", "text", "namespace", "processing-instruction", "binary", or "comment".

The fn:node-kind builtin was dropped from the final XQuery 1.0 spec. This is the equivalent function in the xdmp: namespace carried over for MarkLogic 1.0 dialects.

Parameters
$node The node whose kind is to be returned.

Example

let $x := <hello><goodbye>1</goodbye></hello>
return
xdmp:node-kind($x/node())

=> element

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

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • the node kind "binary" does not appear to be supported in version 3.0 of the XML Data model. http://www.w3.org/TR/xpath-datamodel-30/#Node.
    • "binary" is a MarkLogic extension to the data model. Binary documents in MarkLogic are document nodes with a binary node child.