Fixed bug in NextElement, improved caching
[SXSI/xpathcomp.git] / OCamlDriver.cpp
index 0d0a24c..9df73d6 100644 (file)
@@ -150,7 +150,6 @@ extern "C" CAMLprim value caml_text_collection_get_text(value tree, value id){
   CAMLlocal1(str);
   uchar* txt = XMLTREE(tree)->GetText((DocID) Int_val(id));
   str = caml_copy_string((const char*)txt);
-  delete (txt);
   CAMLreturn (str);
 }
 
@@ -159,7 +158,6 @@ extern "C" CAMLprim value caml_text_collection_get_cached_text(value tree, value
   CAMLlocal1(str);
   char* txt = (char*) XMLTREE(tree)->GetText((DocID) Int_val(id));
   str = caml_copy_string(txt);
-  free(txt);
   CAMLreturn (str);
 }
 
@@ -263,7 +261,7 @@ extern "C" CAMLprim value caml_xml_tree_next_sibling(value tree, value id){
 }
 
 extern "C" CAMLprim value caml_xml_tree_next_element(value tree, value id){
-  return(Val_int (XMLTREE(tree)->NextSibling(TREENODEVAL(id))));
+  return(Val_int (XMLTREE(tree)->NextElement(TREENODEVAL(id))));
 }
 
 extern "C" CAMLprim value caml_xml_tree_tagged_sibling(value tree, value id, value tag){