DomTreeBuilder oldHandler = new DomTreeBuilder();
XMLReader xr1 = XMLReaderFactory.createXMLReader();
xr1.setContentHandler(oldHandler);
xr1.parse(oldSource);
TextNodeComparator leftComparator = new TextNodeComparator(oldHandler,
locale);
DomTreeBuilder newHandler = new DomTreeBuilder();
XMLReader xr2 = XMLReaderFactory.createXMLReader();
xr2.setContentHandler(newHandler);
xr2.parse(newSource);
TextNodeComparator rightComparator = new TextNodeComparator(newHandler,
locale);
HtmlSaxDiffOutput output = new HtmlSaxDiffOutput(consumer, prefix);
HTMLDiffer differ = new HTMLDiffer(output);
differ.diff(leftComparator, rightComparator);