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

Highlighting changes in a diff report

Subject: Highlighting changes in a diff report
From: "Manuel Souto Pico terminolator@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Jun 2014 23:12:25 -0000
 Highlighting changes in a diff report
Hi there,

I am looking for ways to create a HTML report of a comparison between two
versions of a XML file, so basically I would need to create a function that
compares the original file with the edited version. I would like to display
the differences with some formatting as in a word processor's track
changing mode.

For example (simplified case), given the two XML files, i.e. Orig.xml:

<doc>
<string>This is a string</string>
</doc>

and Edited.xml:

<doc ver="new">
<string>This is a text</string>
</doc>

I would like the output report to show something like this:

...
<td>This is a <span style="color: red;"><del>string</del></span><span
style="color: blue;"><ins>text</ins></span></td>
...

Before I start getting my head around this, I wanted to have an expert's
opinion: Can this be done easily with XSLT? (for a basic-level programmer
like me, that is)

I know formatting the output in HTML is not a problem, but finding the
exact differences between the two files might be. Only text content of some
elements (and always the same kind of element) should vary, not the
structure of the document.

My first preference would be to create a stylesheet because I can integrate
it in my workflows, but if this is difficult a ready-made tool would be
good as well as long as it's not too expensive (DeltaXML is too expensive).

I hope someone can advise and even point me in the right direction. Thank
you very much in advance.

Cheers,
Manuel

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.