Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

deep-equal

deep-equal

Assesses whether two nodes have the same content and attributes.
To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal. The $collation argument identifies a collation which is used at all levels of recursion when strings are compared, but not when names are compared.

Syntax

fn:deep-equal(
parameter1
,
parameter2
,
collation
)
The following table describes the arguments:
Argument
Required/
Optional
Description
parameter1
Required
The first sequence to compare.
parameter2
Required
The second sequence to compare.
collation
Optional
The collation to use for comparing strings. The collation argument identifies the collation to be used at all levels of recursion when strings are compared, but not when names are compared.

Return Value

Returns
true
if both the $parameter1 and $parameter2 sequences contain the same values, in the same order.
Atomic values are compared based on their typed values, using the
eq
operator. If two atomic values cannot be compared, for example, if one is a number, and the other is a string, the function returns
false
rather than raising an error.

Examples

The following expression returns
true
as the result:
fn:deep-equal (1, 1)
The following expression returns
false
as the result:
fn:deep-equal ((1,2), (2,1))
The following expression returns
false
as the result:
fn:deep-equal (123, John)

0 COMMENTS

We’d like to hear from you!