Yes, deep-equal() is exactly what I needed, thank you very much!
From: Andrew Welch [mailto:email@example.com]
Sent: Tuesday, March 23, 2010 2:23 AM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Deep compare of two elements
have a look at "deep-equal()" it does exactly what you want...
The deep-equal() function would appear to do what you need.
From: Vanfleet, David [mailto:firstname.lastname@example.org]
Sent: 22 March 2010 22:06
Subject: [saxon] Deep compare of two elements
Hi, I need to be able to do a deep compare two elements structures to determine if they are the same. For the elements to be the same they need to:
· Contain the same element names in the same order
· Contain the same element values
· Contain the same attribute values
For example if I have the following 3 nodes:
<!-- $node1 -->
<!-- $node2 -->
<!-- $node3 -->
I need to determine that:
$node1 is NOT equal to $node2
$node1 IS equal to $node3
I know that I can write a function that can manually check all of these values but my element structure can get much more complicated then what I’m showing in my examples so I would like to know if there is an easier way to do this. I have looked at the <<is>> and <<=>> operators but they don’t give me what I need. Any help would be greatly appreciated.