functx:leaf-elements

All XML elements that don’t have any child elements

Description

The functx:leaf-elements function returns the elements that do not have any element children that are descendants of (or the same as) the root. Leaf elements may have attributes, and may contain text, processing instructions and/or comments.

Parameters

Description

root:node()

the root

Examples

XPath

Results

functx:leaf-elements($in-xml)

<fName>Kate</fName> <lName>Jones</lName> <fName>John</fName> <lName>Doe</lName>

functx:leaf-elements($in-xml/author[1])

<fName>Kate</fName> <lName>Jones</lName>