Do i need DOMDocument in order to append a new child node ?
Posted on 2008-06-10
hi have this part of the xml in my class:
<car max="160" min="0"/>
i dont have a pointer to the DomDocument... anyway here is an example of what i tried instead, but it does not work:
xercesc::DOMElement *carController= getDOMConfig(); // this gives me MY CONFIG the one above
xercesc::DOMNode *newCar = carController->getFirstChild()->cloneNode( false ); // this doesnt work
xercesc::DOMElement *car = static_cast<xercesc::DOMElement *>(carController->
appendChild( newCar )); // therfore this wont work also.
// ... here comes the saving the changes stuff
I am lost in what else to do.
How can I create a newCar node, in order for me to insert it into my carController node? Also If it doesnt have any child nodes yet.