summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-09-29 09:28:23 +0100
committerCarl Hetherington <cth@carlh.net>2013-09-29 09:28:23 +0100
commit088f3cc5d2f200c27d76c23c480153f1b93f8230 (patch)
tree3e43a4174c5e0a9458a753d1e3db8bb5ddb43fba
parentc534aeb70d3770b5a081796b7aae1cfef1411cad (diff)
Revert 3b6dd4db.
-rw-r--r--src/cxml.cc12
-rw-r--r--test/tests.cc1
2 files changed, 10 insertions, 3 deletions
diff --git a/src/cxml.cc b/src/cxml.cc
index ddfa00f..2ca46ed 100644
--- a/src/cxml.cc
+++ b/src/cxml.cc
@@ -57,11 +57,17 @@ cxml::Node::optional_node_child (string name) const
list<shared_ptr<cxml::Node> >
cxml::Node::node_children (string name) const
{
- xmlpp::NodeSet c = _node->find (name);
+ /* XXX: using find / get_path should work here, but I can't follow
+ how get_path works.
+ */
+
+ xmlpp::Node::NodeList c = _node->get_children ();
list<shared_ptr<cxml::Node> > n;
- for (xmlpp::NodeSet::iterator i = c.begin (); i != c.end(); ++i) {
- n.push_back (shared_ptr<Node> (new Node (*i)));
+ 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)));
+ }
}
_taken.push_back (name);
diff --git a/test/tests.cc b/test/tests.cc
index 90b31cb..fc16031 100644
--- a/test/tests.cc
+++ b/test/tests.cc
@@ -73,4 +73,5 @@ BOOST_AUTO_TEST_CASE (test)
BOOST_CHECK_EQUAL (document.node_children("H/I").back()->content(), "more testing");
BOOST_CHECK_EQUAL (document.string_child("J/K"), "jim");
+ BOOST_CHECK (!document.optional_bool_child("G"));
}