* or send an email to <lpadovan@cs.unibo.it>
*/
+#include <config.h>
+#include <cassert>
+
#include "dom.hh"
+#include "timer.hh"
#include "Diff.hh"
#include "TNode.hh"
#include "TDocument.hh"
#include "CMathMLFactoryXSLTDiff.hh"
#include "AMathMLConsumer.hh"
-#include <cassert>
CMathMLFactoryXSLTDiff::CMathMLFactoryXSLTDiff(ALogger& l, const DOMX::XSLTStylesheet& s)
: AMathMLFactory(l), style(s)
dirtyId.push_back(std::make_pair(DOM::GdomeString("id"),
DOM::GdomeString("'" + std::string(dirty["id"]) + "'")));
#endif
+ long t0 = getTimer();
DOM::Document res = style.apply(doc.document());
+ long t1 = getTimer();
assert(res);
//cout << "*** THE TEX DOCUMENT" << endl;
//style.save(doc.document(), stdout);
- std::cout << "*** THE CURRENT DOCUMENT:" << std::endl;
- if (result) style.save(result, stdout);
- std::cout << "*** THE NEW DOCUMENT:" << std::endl;
- style.save(res, stdout);
- std::cout << "*** THE DIFF:" << std::endl;
+ //std::cout << "*** THE CURRENT DOCUMENT:" << std::endl;
+ //if (result) style.save(result, stdout);
+ //std::cout << "*** THE NEW DOCUMENT:" << std::endl;
+ //style.save(res, stdout);
+ //std::cout << "*** THE DIFF:" << std::endl;
DOMX::Diff diff = DOMX::Diff::diff(result, res);
- style.save(diff.document(), stdout);
+ //style.save(diff.document(), stdout);
+ long t2 = getTimer();
diff.patch();
+ long t3 = getTimer();
+
+ //std::cout << "=== APPLY = " << (t1 - t0) / 1000 << " DIFF = " << (t2 - t1) / 1000 << " PATCH = " << (t3 - t2) / 1000 << std::endl;
doc.clearDirty();
}
if (e1.getAttribute("xref") == id)
{
DOMX::Diff diff = DOMX::Diff::diff(e1, e2);
- style.save(diff.document(), stdout);
+ //style.save(diff.document(), stdout);
diff.patch();
return true;
}