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);
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){
}
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(){
if (empty){
- DPRINT("Node " << name <<" is empty!\n")
storageIfc_->newText(""); //myText
storageIfc_->nodeFinished(name);
storageIfc_->newText(""); //nextText
void XMLDocShredder::processStartDocument(const string docName)
{
// tell storage interface to construct the document name
- storageIfc_->newChild("ROOT");
+ storageIfc_->newChild("");
}
{
/* tell the storage interface that document parsing has finished, and structures
* can now be written to disk. */
- storageIfc_->nodeFinished("ROOT");
+ storageIfc_->nodeFinished("");
storageIfc_->parsingFinished();
}