functx:distinct-deep

The XML nodes with distinct values, taking into account attributes and descendants

Description

The functx:distinct-deep function compares nodes based on whether they are deep-equal, then returns only the first node with each distinct value. Two nodes are deep-equal if they have the same attributes with the same values, and all the same children, in the same order, that are themselves deep-equal.

Parameters

Description

nodes:node()

the sequence of nodes to test

Examples

XPath

Results

functx:distinct-deep($in-xml//author)

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

functx:distinct-deep($in-xml//lName)

<lName>Jones</lName> <lName>Doe</lName>

functx:distinct-deep($in-xml//fName)

<fName>Kate</fName>

Depends On

See Also