PDA

View Full Version : QDomElement::setAttribute() doesn't work : (



Qiieha
10th August 2011, 13:42
Hi
I want to add some Elements to a QDomNode (node).

the output should be:
<node>
<sy href = "test1">
<sy href = "test2">
<sy href = "test3">
</node>

at the beginning i have <sy href = "test1"> and I know that there come three same elements with the same attributes, but different values. I create three sy elements and add the attributes with:


element.setAttribute("href","test1");

and then add the elemnt to the node


node.appandChild(element)


the output is:

<node>
<sy href = "test1">
<sy href = "">
<sy href = "">
</node>

why?
thank u for yout help

Dong Back Kim
11th August 2011, 01:13
Can you show us the way you set the elements for test2 and test3? Since you are showing only the codes working properly... it's bit hard to help? =)

Regards,

Qiieha
11th August 2011, 14:21
thank u for the effort!

i solved the problem. it was my fault, that it didn't work. sorry for this thread!