X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=xml-tree-builder.cpp;h=cff28f81147cf78d79bf2821f1d51d6208d0c0eb;hb=HEAD;hp=0b7effc4576429a6eef4502443fdbe354644d760;hpb=c6266d8fd1872fad45b18d3d554410d080b65099;p=SXSI%2FXMLTree.git diff --git a/xml-tree-builder.cpp b/xml-tree-builder.cpp index 0b7effc..cff28f8 100644 --- a/xml-tree-builder.cpp +++ b/xml-tree-builder.cpp @@ -1,5 +1,6 @@ #include "xml-tree-builder.hpp" #include +#include #include using namespace SXSI; @@ -80,6 +81,8 @@ xml_tree_builder::open_document(bool disable_text_index, register_tag(xml_tree::ATTRIBUTE_DATA_OPEN_TAG, xml_tree::ATTRIBUTE_DATA_OPEN_TAG_ID); + register_tag(xml_tree::CLOSE_TAG, + xml_tree::CLOSE_TAG_ID); this->disable_text_index = disable_text_index; if (!disable_text_index){ @@ -94,7 +97,7 @@ void xml_tree_builder::open_tag(std::string tag) int32_t id = register_tag(tag); tags->push_back(id); par->push_back(true); - if (!disable_text_index) text_positions->push_back(false); + if (!disable_text_index) text_positions->set_le(text_positions->size(), false); } void xml_tree_builder::close_tag(std::string) @@ -102,7 +105,7 @@ void xml_tree_builder::close_tag(std::string) xml_tree::tag_t t = xml_tree::CLOSE_TAG_ID; tags->push_back(t); par->push_back(false); - if (!disable_text_index) text_positions->push_back(false); + if (!disable_text_index) text_positions->set_le(text_positions->size(), false); } void xml_tree_builder::text(std::string s) @@ -110,7 +113,7 @@ void xml_tree_builder::text(std::string s) if (!disable_text_index){ if (s.empty()) s = "\001"; tc_builder->InsertText((const unsigned char *) s.c_str()); - text_positions->set(text_positions->size() - 1, true); + text_positions->set_le(text_positions->size() - 1, true); } }