Re: [libxml++] Rename Element::add_content() to add_text_content?



Dan Dennedy wrote:

Please add:
CommentNode* Document::add_comment(const std::string& content)
{
 xmlNode* node = xmlNewComment((xmlChar*)content.c_str());
 xmlAddChild( (xmlNode*) _impl, node);
 return static_cast<CommentNode*>(node->_private);
}

comments can be outside the root node too!

Good point. I'll do that.


I have also thought about removing the add_ methods() becauase the set_()
methods do the same thing 90% of the time. The add_ methods are only useful
if you want to add more than one text or comment node. I suppose that's
slightly useful.

I think we should keep add_ in addition to set_ because a node can have
a child node list containing more than one text contents node. What if I
am able to implement my derived DOM such that in my derived SAX parser I
can add entity references to the DOM I am building? I then need to be
able to add_text(), add_entity_reference(), and add_text(), e.g.

We don't have Element::add_entity_reference() I think.

If needed please provide a patch.


Thanks !


Christophe







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]