]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/src/CMathMLFactoryXSLT.cc
* added show/hide cursro methods
[helm.git] / helm / DEVEL / mathml_editor / src / CMathMLFactoryXSLT.cc
index 2b714cb91f83d175f1757fb0c627a8f097d49c41..027aebcdfd68a9a4428bfd9721f7bfdfc7c4a6f5 100644 (file)
@@ -7,12 +7,6 @@
 
 CMathMLFactoryXSLT::CMathMLFactoryXSLT(ALogger& l, const DOMX::XSLTStylesheet& s)
   : AMathMLFactory(l), style(s)
-{
-  reset();
-}
-
-void
-CMathMLFactoryXSLT::reset()
 {
   DOM::DOMImplementation di;
   DOM::DocumentType dt;
@@ -22,32 +16,31 @@ CMathMLFactoryXSLT::reset()
 void
 CMathMLFactoryXSLT::documentModified(TDocument& doc)
 {
-  if (TNode dirty = doc.dirtyNode()) 
-    {
-      std::vector< std::pair<DOM::GdomeString, DOM::GdomeString> > dirtyId;
-      if (result.get_documentElement().hasAttribute("xref"))
-       dirtyId.push_back(std::make_pair(DOM::GdomeString("id"),
-                                        DOM::GdomeString("'" + std::string(dirty["id"]) + "'")));
-      DOM::Document res = style.apply(doc.document(), dirtyId);
-      assert(res);
-      style.save(doc.document(), stdout);
-
-      DOM::Element root = res.get_documentElement();
-      assert(root);
-      assert(root.hasAttribute("xref"));
+  cout << "passo di qui" << endl;
+  std::vector< std::pair<DOM::GdomeString, DOM::GdomeString> > dirtyId;
+  if (TNode dirty = doc.dirtyNode())
+    if (result.get_documentElement().hasAttribute("xref"))
+      dirtyId.push_back(std::make_pair(DOM::GdomeString("id"),
+                                      DOM::GdomeString("'" + std::string(dirty["id"]) + "'")));
+  DOM::Document res = style.apply(doc.document(), dirtyId);
+  assert(res);
+  style.save(doc.document(), stdout);
 
-      if (result.get_documentElement().hasAttribute("xref"))
-       {
-         bool ok = subst(result.get_documentElement(), root.getAttribute("xref"), result.importNode(root, true));
-         assert(ok);
-       }
-      else
-       result.replaceChild(result.importNode(root, true), result.get_documentElement());
-       
-      style.save(result, stdout);
+  DOM::Element root = res.get_documentElement();
+  assert(root);
+  assert(root.hasAttribute("xref"));
 
-      doc.clearDirty();
+  if (result.get_documentElement().hasAttribute("xref"))
+    {
+      bool ok = subst(result.get_documentElement(), root.getAttribute("xref"), result.importNode(root, true));
+      assert(ok);
     }
+  else
+    result.replaceChild(result.importNode(root, true), result.get_documentElement());
+
+  style.save(result, stdout);
+
+  doc.clearDirty();
 }
 
 bool