[libxml++] Add content_node to a Node



Hi,
Can someone tell me whether the libxml++ library can add a child node of type of content_node to a parent node?! 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");

But with dynamic casting, newNodeContent will be null !! Shouldn't I be able to add a content node?

Thanks,
Mehran Ziadloo

_________________________________________________________________
Scan and help eliminate destructive viruses from your inbound and outbound e-mail and attachments. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.





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