Le Mercredi 3 Août 2005 14:38, Mehran Ziadloo a écrit :
> Hi,
> Can someone tell me whether the libxml++ library can add a child node of
> type of content_node to a parent node?!
See the dom_build example.
> I've been trying to do this since I needed a new node and I wanted to set
> some content for it. Here's the way I tried to do so:
>
> xmlpp::Element* newElement = rootNode->add_child("entry");
> newElement->set_attribute("name", "sample value");
> xmlpp::ContentNode* newNodeContent =
> dynamic_cast<xmlpp::ContentNode*>((xmlpp::Node*) newElement);
> newNodeContent->set_content("sample content");
newElement->set_child_text("sample content")
Regards,
Christophe
Attachment:
pgp5ZBtB8j92e.pgp
Description: PGP signature