string
cxml::Node::name () const
{
- assert (_node);
+ if (!_node) {
+ throw Error ("No node to read name from");
+ }
return _node->get_name ();
}
list<shared_ptr<cxml::Node> >
cxml::Node::node_children () const
{
+ if (!_node) {
+ throw Error ("No node to read children from");
+ }
xmlpp::Node::NodeList c = _node->get_children ();
list<shared_ptr<cxml::Node> > n;
xmlpp::Node::NodeList c = _node->get_children ();
for (xmlpp::Node::NodeList::const_iterator i = c.begin(); i != c.end(); ++i) {
xmlpp::ContentNode const * v = dynamic_cast<xmlpp::ContentNode const *> (*i);
- if (v) {
+ if (v && dynamic_cast<xmlpp::TextNode const *>(v)) {
content += v->get_content ();
}
}