[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: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 4 Apr 2005 14:19:39 +0100
java compare
> This is a nice feature provided by Saxon (infact very
> nice). And is much more optimized than the named
> template I wrote (in the stylesheet I posted last), as
> Saxon's function runs in native Java code.. 

For the vast majority of nodes this is still a) very expensive way of
comparing them and b) doesn't help with the comparison.

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. 

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?

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.