uint32_t xml_tree::subtree_elements(xml_tree::node_t x) const
{
-
- uint32_t size = bp_subtree_size(par, x);
+ xml_tree::node_t fin = bp_find_close(par, x);
+ uint32_t size = (fin - x)/2;
if (x == root()){
x = bp_first_child(par,x);
size = size - 1;
};
- int s = x + 2*size - 1;
int ntext =
- tags->rank(xml_tree::PCDATA_OPEN_TAG_ID, s) -
+ tags->rank(xml_tree::PCDATA_OPEN_TAG_ID, fin) -
tags->rank(xml_tree::PCDATA_OPEN_TAG_ID, x-1);
size = size - ntext;
- xml_tree::node_t fin = bp_find_close(par, x);
xml_tree::node_t y = tags->select_next(xml_tree::ATTRIBUTE_OPEN_TAG_ID, x);
while (y != xml_tree::NIL && y < fin){
size -= subtree_size(y);