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

Re: XML Differences

Subject: Re: XML Differences
From: Antonio Fiol Bonnín <fiol@xxxxxxxxxx>
Date: Thu, 27 Jun 2002 07:38:26 +0200
asdf qwerty
Carlos Sanchez wrote:

Hi,

Has someone work on a style sheet that "detects" the different between
two documents. Taking one of them as the master, the style sheet should
be able to return the included/excluded elements (attributes) and
element content differences.

Any information will be very much appreciated.

Carlos


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



.




I have done something along that line. However the result was very picky (as expected from an automatic comparison tool), and I did not find any way of making it better.

My "tool" (what a great name for what I did) does this:

File 1:
<asdf>
<qwerty>
<poiuyy fwefew="1" />
text
</querty>
<test />
</asdf>

File 2:
<asdf>
<qwerty>
<poiuyy fwefew="2" />
different text
</querty>
</asdf>

Result:
<asdf>
<qwerty>
<xsl:choose>
<xsl:when test="$mode=1">
<poiuyy fwefew="1" />
text
</xsl:when>
<xsl:when test="$mode=2">
<poiuyy fwefew="2" />
different text
</xsl:when>
</xsl:choose>
</querty>
<xsl:choose>
<xsl:when test="$mode=1">
<test />
</xsl:when>
</xsl:choose>
</asdf>

So, this is a document that inserted in a proper stylesheet (which sets the mode param, among other things) is capable to output each of the input documents.

I conceived this as a compression method for a set of similar (template-based) XHTML files.

I found some trouble when extending that to 3 or more files (not that it is not possible, but I did not have enough time. The idea I had for the extension was taking the output of the first transform as file 1 and re-transform it with a third file as file 2. There is some support for that in my code, but it is not tested, and will break if the input files are XSL files, as I treat xsl:choose and xsl:when different from other elements. Removing that should not be that hard...

I found more trouble when I discovered that my XHTML files were not exactly template-based, so my combined version was nearly as big as the sum of two of the documents.

I would give it away. Just ask me if that is what you need.


Antonio Fiol



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



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.