[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Testing 2 XML documents for equality - a solution

Subject: RE: Testing 2 XML documents for equality - a solution
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Mon, 4 Apr 2005 14:39:12 +0100
RE:  Testing 2 XML documents for equality - a solution
> For a given element node if you calculate an XPath to the
> current node, and then use that XPath to find a node in the
> other document, you have two nodes, you then need to compare
> whether they are equal, but that is _exactly_ the problem you
> are trying to solve. The earlier stylesheet just took the
> string value of the node but that is just the concatenation
> of all the element content so loses most of the markup information.

True enough, I would suggest restricting it to data-centric XML, or
adding a special case for mixed content nodes.  I really think the aim
here is to keep it as simple as possible, rather than create the
de-facto comparison stylesheet.

> What is wrong with the much simpler alternative of just
> writing out the string corresponding to a specific
> "canonical" linearisation, and then jsut comparing those two strings?

I guess because how do you map back to the element/attribute that
doesn't match once you've done the comparison.


cheers
andrew

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.