<program>
<id>1306917122529</id>
<starttime></starttime>
<endtime></endtime>
<layout><slide fileURL="E:/123&.jpg"/></layout>
<title><![CDATA[1080*1920-ff]]></title>
</program>
<program>
<id>1306917122529</id>
<starttime></starttime>
<endtime></endtime>
<layout><slide fileURL="E:/123&.jpg"/></layout>
<title><![CDATA[1080*1920-ff]]></title>
</program>
To copy to clipboard, switch view to plain text mode
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
dom = QDomDocument()
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
To copy to clipboard, switch view to plain text mode
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
Bookmarks