Hi, I have built an xml parser and I have a problem. I cannot control the content with which the xml parser works and there are some xml documents that in tags like <content> have html tags elements, for example:
This content should be like this:Code:<content> <b>This is a <a href="http://www.sample.com">sample</a></b> </content>
This way everything works ok, but as I said the problem is that I cannot control the xml documents, so in case there isn't a cdata section the xml parser interprets the html tags as other nodes and I would like to read everything that is in a content node as text.Code:<content> <![CDATA[<b>This is a <a href="http://www.sample.com">sample</a></b>]]> </content>
Now my c++ code looks like this:
So, how could I read everything there is in a content tag as text?Code:if(n.nodeName() == "content"){ if(!n.firstChild().isCDATASection()){ qDebug() << "No CDATA"; strDescription = ?????? }else{ qDebug() << "CDATA"; strDescription = n.firstChild().nodeValue(); } }



