projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Record which tag ids map to attribute nodes. Use that in subtree_element
[SXSI/XMLTree.git]
/
xml-tree-inc.hpp
diff --git
a/xml-tree-inc.hpp
b/xml-tree-inc.hpp
index
de88de0
..
19745ed
100644
(file)
--- 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);
{
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;
if (size < 3) return (uint32_t) size;
- for(; *atts != xml_tree::NIL_TAG_ID; atts++)
- size -= subtree_tags(x, *atts);
+ std::unordered_set<xml_tree::tag_t>::iterator it;
+ for(it = this->attribute_ids->begin();
+ it != this->attribute_ids->end();
+ ++it)
+ size -= subtree_tags(x, *it);
return (uint32_t) size;
}
return (uint32_t) size;
}