[MarkLogic Dev General] finding the difference between two
documents
Charles Blair
chas at uchicago.edu
Thu May 31 06:40:24 PDT 2007
On Thu, May 31, 2007 at 06:06:21AM -0700, Michael Blakeley wrote:
> If I understand correctly, op:except isn't suitable for your use-case
> because op:except uses node-identity comparison. So this sounds like a job
> for fn:deep-equal().
thanks. i've been using fn:deep-equal() to test for equality, but
didn't think of using it like this to test for inequality. very nice.
> let $a := document { <test id="a"/> }
> let $a1 := document { <test id="a"/> }
> let $b := document { <test id="b"/> }
> return ($a1, $b)[ not(deep-equal(., $a)) ]
> => <test id="b"/>
>
> http://www.w3.org/TR/xpath-functions/#func-deep-equal
More information about the General
mailing list