[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: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 30 Mar 2005 18:31:20 +0100
RE:  Testing 2 XML documents for equality - a solution
> Thanks a lot Mike for your observations.. I propose
> this code to solve the attribute ordering problem you
> cited (for both the documents).
> 
> <xsl:for-each select="$doc1//@*">
>   <xsl:sort select="." />
> 
> i.e. adding a xsl:sort instruction in the for-each
> loop. This shall solve this problem!

No, you need to sort on the attribute name. Two attributes can have the same
value in which case their respective order is still unpredictable.

> *I feel my stylesheet caters to a large subset of
> Canonical XML definition (I guess about 70-90%). Can
> you please comment on my this claim? *

I've no idea what the claim means. Are you saying that your algorithm will
give the same answer as a canonicalized comparison 70%-90% of the time? If
not, what are you saying?

Michael Kay
http://www.saxonica.com/

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.