Also On This Page →


This page describes what is necessary for generating DIFF documents for XML Spec drafts with DiffMk, and gives an exampe using Ant.

What you need

You will need the following files. Put them into the same directory as your draft documents.

The latest XML Spec files (schemas, stylesheets) are available from the XML Spec Schema and Stylesheets home page. You will also need Java and an XSLT processor.


Step 1 To create a diff document diff.xml for the input previousVersion.xml and latestVersion.xml, do the following (in one line, only with linebreak for readability):

java -cp diffmk.jar com.sun.xtc.diffmk.DiffMk 
     -doctype xmlspec -diff both -words previousVersion.xml latestVersion.xml diff.xml

NOTE: you will get some messages like "Cannot find on CLASSPATH" or "Cannot find". Ignore them, they don't break the diff creation.

Step 2 postprocess diff.xml to diffCleanedUp.xml with diff-postprocess.xsl. This cleans up the output of DiffMk a bit.

Step 3 generate XHTML output from diffCleanedUp.xml with diffspec.xsl.

Example with Ant

This example Ant file has a task diff which depends on the three tasks generateXmlDiff, postprocessDiff and generateHtml. These tasks implement the three steps described above. Install Ant and provide the file names in the properties previousDraft and currentDraft. Running Ant on the command line will do the rest.

Felix Sasaki
$Date: 2008/05/21 01:28:32 $