I was thinking about this, does it require a schema-aware parser (say Saxon PE) ? I would presume so. From: Michael Kay [mailto:mike@saxonica.com] On 23/12/2010 12:29, David Lee wrote: 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 ? Example. <number>1.0</number> vs. <number>1</number> Without type annotation these are different. 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. |