functx:node-kind

The XML node kind (element, attribute, text, etc.)

Description

The functx:node-kind function returns the node kind of a node (or sequence of nodes), one of the values “element”, “attribute”, “text”, “comment”, “processing-instruction”, or “document-node” for each node supplied. If $nodes is the empty sequence, it returns the empty sequence.

Parameters

Description

nodes:node()

the node(s) whose kind you want to determine

Examples

XPath

Results

functx:node-kind($in-xml/a)

element

functx:node-kind($in-xml/a/@z)

attribute

functx:node-kind($in-xml/comment())

comment

functx:node-kind($in-xml/processing-instruction())

processing-instruction

functx:node-kind($in-xml/a/text())

text

functx:node-kind(doc(‘http://www.functx.com/input/order.xml’))

document-node

See Also