File xml2 = new File(args[args.length - 1]);
// loading
long t0 = System.currentTimeMillis();
Recorder recorder = getRecorder(args);
EventSequence seq1 = recorder.process(xml1);
EventSequence seq2 = recorder.process(xml2);
long t1 = System.currentTimeMillis();
if (profile) {
System.err.println("Loaded files in "+(t1 - t0)+"ms");
}
// get the config
DiffXConfig config = new DiffXConfig();
config.setGranularity(getTextGranularity(args));
config.setWhiteSpaceProcessing(getWhiteSpaceProcessing(args));
if (!quiet) {
System.err.println("Whitespace processing: "+getTextGranularity(args)+" "+getWhiteSpaceProcessing(args));
}
// get and setup the formatter
Writer out = new OutputStreamWriter(getOutput(args), "utf-8");
DiffXFormatter formatter = getFormatter(args, out);
if (formatter instanceof XMLDiffXFormatter) {
((XMLDiffXFormatter)formatter).declarePrefixMapping(seq1.getPrefixMapping());
((XMLDiffXFormatter)formatter).declarePrefixMapping(seq2.getPrefixMapping());
}
formatter.setConfig(config);
// pre-slicing
SequenceSlicer slicer = new SequenceSlicer(seq1, seq2);
if (slice) {
slicer.slice();
slicer.formatStart(formatter);
}
// start algorithm
if (!quiet) {
System.err.println("Matrix: "+seq1.size()+"x"+seq2.size());
}
DiffXAlgorithm df = getAlgorithm(args, seq1, seq2);
df.process(formatter);
// post-slicing