summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-09-26 00:38:43 +0100
committerCarl Hetherington <cth@carlh.net>2013-09-26 00:38:43 +0100
commit3b6ddf4b140befd1286af26c34800a50b3ba3f56 (patch)
tree93073a6bfc847c208c92988a3f3731fffc2bb587 /src
parente486e70da8c3c65294e27c18ad9cb0e4a5fe8aaf (diff)
Use xpath for node_children.
Diffstat (limited to 'src')
-rw-r--r--src/cxml.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/cxml.cc b/src/cxml.cc
index 2ca46ed..ddfa00f 100644
--- a/src/cxml.cc
+++ b/src/cxml.cc
@@ -57,17 +57,11 @@ cxml::Node::optional_node_child (string name) const
list<shared_ptr<cxml::Node> >
cxml::Node::node_children (string name) const
{
- /* XXX: using find / get_path should work here, but I can't follow
- how get_path works.
- */
-
- xmlpp::Node::NodeList c = _node->get_children ();
+ xmlpp::NodeSet c = _node->find (name);
list<shared_ptr<cxml::Node> > n;
- for (xmlpp::Node::NodeList::iterator i = c.begin (); i != c.end(); ++i) {
- if ((*i)->get_name() == name) {
- n.push_back (shared_ptr<Node> (new Node (*i)));
- }
+ for (xmlpp::NodeSet::iterator i = c.begin (); i != c.end(); ++i) {
+ n.push_back (shared_ptr<Node> (new Node (*i)));
}
_taken.push_back (name);