saxonica.com

saxon:deep-equal()

saxon:deep-equal($seq1 as item()*, $seq2 as item()*, $collation as xs:string?, $flags as xs:string) ==> xs:boolean

This function compares two sequences $seq1 and $seq2 for deep equality. The two sequences are supplied in the first two arguments. In the absence of any $flags, the function returns the same result as the deep-equal function in the standard XPath library. The $flags argument is used to modify the way in which the comparison is performed.

The $collation argument is mandatory. Supply an empty sequence to use the default collation.

The flags argument is a string containing characters acting as flags that cause the function to behave differently from the standard fn:deep-equal() function. The following flags are defined:

N

Include namespace nodes in the comparison. For two elements to be deep-equal, they must have the same in-scope namespaces (that is, same prefix and same URI).

F

Include namespace prefixes in the comparison. For two elements or attributes to be equal, their names must use the same namespace prefix (or none).

C

Include comment nodes in the comparison. For two element or document nodes to be deep-equal, they must have the same comment node children.

P

Include processing-instruction nodes in the comparison. For two element or document nodes to be deep-equal, they must have the same processing-instruction node children.

J

Join adjacent text nodes (for example, nodes either side of an ignored comment)

S

Compare string values rather than typed values of simple-typed elements and attributes.

A

Compare type annotations on elements and attributes. The type annotations must match exactly.

w

Exclude whitespace text nodes from the comparison. Any whitespace text node in either tree is ignored (except when determining the typed value of an element annotated with a simple type or a complex type with simple content).

?

Explain reason for a non-match. If the result is not-equal, a warning message explaining the reason will be sent to the ErrorListener. (In general, a sequence of warning messages will be sent, starting with the lowest-level difference and moving up the tree).

Next