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 ();
}
}
return n;
}
- /** @return The content of this node */
+ /** @return The text content of this node (including comments or CDATA) */
std::string content () const;
/** @return namespace URI of this node */
<E>yes</E>
<F>1</F>
<F>2</F>
- <H><I>testing</I><I>more testing</I></H>
+ <H><I>testing</I><I><!-- ignore this -->more testing</I></H>
<J><K>jim</K></J>
</A>