X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=xml-tree-inc.hpp;fp=xml-tree-inc.hpp;h=19745ed49d96f158af235592dc3692fd4e849677;hb=9775b1833487a525901cf968d91a9e7f193395c5;hp=de88de0a9f0dbae1397862deb68c8ecc3a7422fa;hpb=a03dd7328575623b07aee80362b4214f0cf76b31;p=SXSI%2FXMLTree.git diff --git a/xml-tree-inc.hpp b/xml-tree-inc.hpp index de88de0..19745ed 100644 --- a/xml-tree-inc.hpp +++ b/xml-tree-inc.hpp @@ -36,16 +36,20 @@ xml_tree::subtree_tags(xml_tree::node_t x, xml_tree::tag_t label) const } } -inline uint32_t xml_tree::subtree_elements(xml_tree::node_t x, - xml_tree::tag_t *atts) const +inline uint32_t xml_tree::subtree_elements(xml_tree::node_t x) const { int32_t size = bp_subtree_size(par, x) - 1; if (size <= 0) return 0; size -= subtree_tags(x, xml_tree::PCDATA_OPEN_TAG_ID); + size -= subtree_tags(x, xml_tree::ATTRIBUTE_OPEN_TAG_ID); + size -= subtree_tags(x, xml_tree::ATTRIBUTE_DATA_OPEN_TAG_ID); if (size < 3) return (uint32_t) size; - for(; *atts != xml_tree::NIL_TAG_ID; atts++) - size -= subtree_tags(x, *atts); + std::unordered_set::iterator it; + for(it = this->attribute_ids->begin(); + it != this->attribute_ids->end(); + ++it) + size -= subtree_tags(x, *it); return (uint32_t) size; }