xsl-list
[Top] [All Lists]

RE: Testing 2 XML documents for equality - a solution

2005-03-30 10:31:20
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/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>