fn:has-children

Asks whether the supplied node has one or more children.

has-children() ➔ xs:boolean

There are no arguments

Result

xs:boolean

has-children($seq as node()?) ➔ xs:boolean

Arguments

 

$seq

node()?

The input node

Result

xs:boolean

Namespace

http://www.w3.org/2005/xpath-functions

Links to W3C specifications

XPath 3.1 Functions and Operators

Saxon availability

Available in XPath 3.0, XSLT 3.0, XQuery 3.0, and later versions. From Saxon 9.6, available in all editions.

Notes on the Saxon implementation

Available from Saxon 9.5, provided XPath 3.0 is enabled. Streaming for the has-children() function is implemented from Saxon 9.7; specifically, a call on has-children() is now motionless, so that the call does not consume the content. This means, for example, that the call can appear as a predicate in a match pattern. The implementation uses a tiny amount of look-ahead in the parsing pipeline.