OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Schema based XML compare

On 23/12/2010 12:29, David Lee wrote:
000001cba29c$fb9bca00$f2d35e00$@calldei.com" type="cite">

I've run into an age-old issue but I don’t see any off-the-shelf solutions for.


Suppose I have 2 XML documents I want to compare (not diff, just give me yes/no are they equivalent).

This is pretty simple to do even with things like ignoring whitespace options etc.  Many tools out there, including one I wrote

( http://www.xmlsh.org/CommandXcmp)


Now here's the twist …


Suppose I want to compare for XSD  data model equivalence, not XDM  equivalence ?








Without type annotation these are different.
But if I declare the type for number to  be xs:double

they should compare equal.


The XPath 2.0 deep-equal() function appears to do what you want here: it compares the typed values of the elements rather than their string values.

Michael Kay

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS