QtXml can't properly resolve xml with char "&" in it
Code:
<program>
<id>1306917122529</id>
<starttime></starttime>
<endtime></endtime>
<layout><slide fileURL="E:/123&.jpg"/></layout>
<title><![CDATA[1080*1920-ff]]></title>
</program>
Code:
dom.setContent(xml)
root=dom.documentElement()
p_nodeList = dom.childNodes()
i=0
while i<p_nodeList.count():
nodeList=p_nodeList.at(i).childNodes()
print nodeList.count()
i=i+1
i used above code to print the counts of the children of a program node, For xml with "&" in it ,output is 4, but if i delete "&", output is 5,so why this happen?
sry for my english and thx in advance
Re: QtXml can't properly resolve xml with char "&" in it
Using ampersand in XML attributes is not allowed, see http://www.w3.org/TR/xhtml1/#C_12
You should write "&"