[XML-SIG] using XUpdate to render differences between two versions of a file
bogdan.bivolaru at gmail.com
Fri Aug 8 09:18:43 CEST 2008
I'm trying for some time find a tool that makes a diff in XML files.
What I have found so far is XMLdiff (python program) which can save the
differences between the two files in XUpdate format, but I'd like to be able
to visualize those differences, see how they look in the final product.
The best idea I could find is to use the XUpdate file and based on a XSL
(specific to the format that is being diffed) to make transformations on the
versioned files in such a way that highlights the differences between them.
For example, for HTML it would be:
deleteted text to be marked as <strikethrough> .... </strikethrough>
inserted text to marked as <p style="color: red;">...</p>
SVGdiff could fade version 1 into version 2, or could allow other effects
like showing only the parts that have been added or deleted.
So my idea on implementing this is to replace the elements pointed in
XUpdate (/document_root/element1) and embed them in the markup
specified by the XSL.
File version 1:
File version 2:
Doing "xmldiff -x file1 file2" gives an XUpdate output:
<xupdate:modifications version="1.0" xmlns:xupdate="
<xupdate:rename name="/memory/mailbox" >
After processing the XUpload the program would know it has to find
/memory/mailbox element in the first document and put <p
style="color:red;"> ... </p> around it. But how to do that? Or it could make
an intermediary XSL file that specifies this?
I'm not sure which way to go from here? Any ideas? Any word on performance?
I wouldn't like to keep all the document tree in memory just to find
/memory/mailbox element and replace it, do you know any alternatives?
Do you know any other way how to do this visual XML diff tool? Please share
"The best way to predict the future is to invent it.", 1971, Alan Kay:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the XML-SIG