]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/ocaml/c_mathml_editor.cc
* the documents passed to the ocaml binding have been turned into strings
[helm.git] / helm / DEVEL / mathml_editor / ocaml / c_mathml_editor.cc
index f610a7ff5d92bd810ee56dcefdb67310f65a9274..14bab319d455df313b45d9c146889739a6979bb4 100644 (file)
@@ -59,7 +59,7 @@ CCallbackLogger::message(Level l, const std::string& s)
 
 struct Editor
 {
-  Editor(const DOM::Document&, const DOM::Document&, const DOM::Document&, void (*)(int, const char*, void*), void*);
+  Editor(const char*, const char*, const char*, void (*)(int, const char*, void*), void*);
   ~Editor();
 
   ALogger*        logger;
@@ -71,13 +71,19 @@ struct Editor
   APushLexer*     lexer;
 };
 
-Editor::Editor(const DOM::Document& dict, const DOM::Document& mml, const DOM::Document& tex,
+Editor::Editor(const char* dict_uri, const char* mml_uri, const char* tex_uri,
               void (*cb)(int, const char*, void*), void* data)
 {
+  assert(dict_uri);
+  assert(mml_uri);
+  assert(tex_uri);
   assert(cb);
   logger = new CCallbackLogger(cb, data);
   dictionary = new TDictionary(*logger);
-  dictionary->load(DOM::Document(dict));
+  dictionary->load(dict_uri);
+  DOM::DOMImplementation di;
+  DOM::Document mml = di.createDocumentFromURI(mml_uri);
+  DOM::Document tex = di.createDocumentFromURI(tex_uri);
   tml_mml = new DOMX::XSLTStylesheet(mml);
   tml_tex = new DOMX::XSLTStylesheet(tex);
   factory = new CMathMLFactoryXSLT(*logger, *tml_mml);
@@ -115,15 +121,13 @@ c_mathml_editor_get_default_tex_stylesheet_path()
 }
 
 extern "C" Editor*
-c_mathml_editor_new(GdomeDocument* dictionary,
-                   GdomeDocument* tml_mml,
-                   GdomeDocument* tml_tex,
+c_mathml_editor_new(const char* dictionary_uri,
+                   const char* tml_mml_uri,
+                   const char* tml_tex_uri,
                    void (*log_message_cb)(int, const char*, void*),
                    void* user_data)
 {
-  return new Editor(DOM::Document(dictionary),
-                   DOM::Document(tml_mml),
-                   DOM::Document(tml_tex), log_message_cb, user_data);
+  return new Editor(dictionary_uri, tml_mml_uri, tml_tex_uri, log_message_cb, user_data);
 }
 
 extern "C" void