Le Mercredi 3 Ao=FBt 2005 14:38, Mehran Ziadloo a =E9crit=A0:
> 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 =3D rootNode->add_child("entry");
> newElement->set_attribute("name", "sample value");
> xmlpp::ContentNode* newNodeContent =3D
> dynamic_cast<xmlpp::ContentNode*>((xmlpp::Node*) newElement);
> newNodeContent->set_content("sample content");
newElement->set_child_text("sample content")
Regards,
Christophe
|