Endelm
asked on
Do i need DOMDocument in order to append a new child node ?
hi have this part of the xml in my class:
<carController>
<car max="160" min="0"/>
</carController>
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->getFirstChi ld()->clon eNode( false ); // this doesnt work
xercesc::DOMElement *car = static_cast<xercesc::DOMEl ement *>(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.
Thank you.
<carController>
<car max="160" min="0"/>
</carController>
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->getFirstChi
xercesc::DOMElement *car = static_cast<xercesc::DOMEl
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.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.