Removed the debugging stuff.
authorkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Thu, 27 Nov 2008 09:04:56 +0000 (09:04 +0000)
committerkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Thu, 27 Nov 2008 09:04:56 +0000 (09:04 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/xpathcomp@20 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

OCamlDriver.cpp
SXSIStorageInterface.cpp
XMLDocShredder.cpp

index 1c50a7b..b0e57d9 100644 (file)
@@ -86,12 +86,7 @@ extern "C" CAMLprim value caml_xml_tree_text_collection(value tree){
 extern "C" CAMLprim value caml_xml_tree_first_child(value tree, value id){
   CAMLparam2(tree,id);
   CAMLlocal1(res);
-  DPRINT("BEFORE!!!");
-  DPRINT(XMLTREE(tree)->flag);
-  DPRINT("ID is " << Int_val(id));
-  res = Val_int (XMLTREE(tree)->FirstChild(TREENODEVAL(id)));
-  DPRINT("AFTER!!!" << Int_val(res));
-  CAMLreturn(res);
+  CAMLreturn(Val_int (XMLTREE(tree)->FirstChild(TREENODEVAL(id))));
 }
 extern "C" CAMLprim value caml_xml_tree_next_sibling(value tree, value id){
   CAMLparam2(tree,id);
@@ -101,8 +96,7 @@ extern "C" CAMLprim value caml_xml_tree_next_sibling(value tree, value id){
 extern "C" CAMLprim value caml_xml_tree_prev_text(value tree, value id){
   CAMLparam2(tree,id);
   CAMLlocal1(res);
-  res = Val_int((XMLTREE(tree)->PrevText(TREENODEVAL(id))));
-  cerr << "AFTER PREV TEXT" << Int_val(res);
+  CAMLreturn(Val_int((XMLTREE(tree)->PrevText(TREENODEVAL(id)))));
   CAMLreturn(res);
 }
 extern "C" CAMLprim value caml_xml_tree_next_text(value tree, value id){
index dcd3c30..bd21cd0 100644 (file)
@@ -23,39 +23,30 @@ SXSIStorageInterface::~SXSIStorageInterface()
 }
 
 void SXSIStorageInterface::newChild(string name)
-{
-  
-  DPRINT("enter NewChild" << name << "\n")
+{ 
   tree->NewOpenTag((unsigned char*) name.c_str());
-  DPRINT("leave NewChild" << name << "\n")
 }
 
 
 void SXSIStorageInterface::newText(string text)
 {
-  DPRINT("enter NewText" << text << "\n")
-  if (text.empty())
+   if (text.empty())
     tree->NewEmptyText();
   else
     tree->NewText((unsigned char*) text.c_str());
-  DPRINT("leave NewText" << text << "\n")
-}
+ }
        
 
 
 void SXSIStorageInterface::nodeFinished(string name)
 {  
-  DPRINT("enter NodeFinished" << name << "\n")
-  tree->NewClosingTag((unsigned char*) name.c_str());
-  DPRINT("leave NodeFinished" << name << "\n")
-}            
+   tree->NewClosingTag((unsigned char*) name.c_str());
+ }           
              
   void SXSIStorageInterface::parsingFinished()
 {
-  DPRINT("enter parsingFinished\n")
-  tree->CloseDocument();
-  DPRINT("leave parsingFinished\n")
-       
+   tree->CloseDocument();
+       
 }
 
 void *SXSIStorageInterface::returnDocument(){
index f81251e..722c291 100644 (file)
@@ -105,7 +105,6 @@ void XMLDocShredder::processStartElement()
 
        
        if (empty){
-         DPRINT("Node " << name <<" is empty!\n")
            storageIfc_->newText("");  //myText
            storageIfc_->nodeFinished(name);
            storageIfc_->newText("");  //nextText
@@ -192,7 +191,7 @@ void XMLDocShredder::processSignificantWhitespace()
 void XMLDocShredder::processStartDocument(const string docName)
 {
   // tell storage interface to construct the document name
-  storageIfc_->newChild("ROOT");  
+  storageIfc_->newChild("");  
   
 }
 
@@ -200,7 +199,7 @@ void XMLDocShredder::processEndDocument()
 {
        /* tell the storage interface that document parsing has finished, and structures
         * can now be written to disk. */
-  storageIfc_->nodeFinished("ROOT");
+  storageIfc_->nodeFinished("");
   storageIfc_->parsingFinished();      
 }