[xerces c++] Add attributes to nodes

F

Fabien R

Hello,

I'm walking through my XML tree and I want to add attributes to all
its nodes.
I thought to use the following code:

DOMElement* p_tmpNode = (DOMElement*)p_node->getChildNodes()->item(i);
p_tmpNode->setAttribute(XMLString::transcode(attrName),XMLString::transcode(attrVal));

Is there a more elegant way to do the same avoiding the downcast ?

TIA,
Fabien
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top