X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=SXSIStorageInterface.cpp;h=43ea1551518b05009d74a5ac8c7f74b6a6c2be58;hb=70ff0bfc463882ecf233f1b1a7ac4a8007fa4cc2;hp=88ed42f2ef8930d69a43c4125f0ac2bd964c96e2;hpb=f98a8d98d86941a885f492d5cc134e34989c198a;p=SXSI%2Fxpathcomp.git diff --git a/SXSIStorageInterface.cpp b/SXSIStorageInterface.cpp index 88ed42f..43ea155 100644 --- a/SXSIStorageInterface.cpp +++ b/SXSIStorageInterface.cpp @@ -13,8 +13,9 @@ SXSIStorageInterface::SXSIStorageInterface(int sf,bool iet,bool dtc) { - tree = new XMLTree(); - tree->OpenDocument(iet,sf,dtc); + tree = NULL; + tb = new XMLTreeBuilder(); + tb ->OpenDocument(iet,sf,dtc); } SXSIStorageInterface::~SXSIStorageInterface() @@ -24,35 +25,29 @@ SXSIStorageInterface::~SXSIStorageInterface() void SXSIStorageInterface::newChild(string name) { _new_child++; - tree->NewOpenTag((unsigned char*) name.c_str()); + tb->NewOpenTag((unsigned char*) name.c_str()); } void SXSIStorageInterface::newText(string text) { - if (text.empty()) { - _new_empty_text++; - tree->NewEmptyText(); - } - else { - _new_text++; - _length_text += text.size(); - tree->NewText((unsigned char*) text.c_str()); - } + _new_text++; + _length_text += text.size(); + tb->NewText((unsigned char*) text.c_str()); } void SXSIStorageInterface::nodeFinished(string name) { - tree->NewClosingTag((unsigned char*) name.c_str()); + tb->NewClosingTag((unsigned char*) name.c_str()); } void SXSIStorageInterface::parsingFinished() { - tree->CloseDocument(); + tree = tb->CloseDocument(); }