RE: [xsl] Comparing two xml documents

Subject: RE: [xsl] Comparing two xml documents
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Wed, 12 Mar 2003 23:31:06 +0000
Hi Lars,

Thanks! It seems so simple when I look at it now. I like the way you used the mode in selecting the elements of different documents.

I don't know about the limit on 200 KB yet. I will check out the downloaded version at a later time (perhaps tomorrow).

On the sort: I can see how you would do something like this when you are able to delete the elements that you have already compared, but I can't see how you would be able to avoid going through all elements in A and B another time when searching B for elements not found in A.
Would this be in any way possible in pure XSL?


Regards,
Ragulf Pickaxe :)


It seems like you could
save a lot of cycles by first sorting both documents by element
name; then go through both lists at once using linear recursion,
[does this mean you have to convert RTFs to node-sets? I'm not sure]
comparing the "next" element in each sorted document, and updating
the two "next" pointers according to which "next" node compares earlier.

This would give you O(n log n + m log m) time instead of O(n * m) where
n and m are the number of nodes in the two documents.
(I imagine xmlDiff does use a sort, but it was written using .NET,
not XSLT.)

On the other hand, the 200KB limit may be just the max load they want
you to put on their server.  If you download xmlDiff and run it yourself
it might work with your data.

If not, let me know... this is an interesting problem.

Lars


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread