How to create CDATA tag in Excel vba?

jasonradical

New Member
Can anyone please help.I am trying to convert excel data into xml file uisng vba. My xml file looks like this, \[code\] <product> <info><i>Samsung</i></info> </product>\[/code\]I want the html tags not to be parsed.so trying to add cdata in vba using createCDATASection method in vba I added vba code like this \[code\] Set objDom = New DOMDocument Set objXMLRootelement = objDom.createElement("Product") Set objXMLelement = objDom.createElement("info") objXMLRootelement.appendChild objXMLelement cdata=http://stackoverflow.com/questions/12454211/objDom.createCDATASection ("<i>Samsung</i>") objXMLelement.text=cdata.text\[/code\]I want my xml file to appear like this and when viewed the viewsource in notepad it should
display '<' as '<' but not 'ampersand lt;'\[code\] <product> <info><![CDATA[<i>Samsung</i>]]></info> </product>\[/code\]after executing my code it is displaying like this,\[code\] <product> <info><i>Samsung</i></info> </product>\[/code\]but cdata tag is not appearing.Dont know the reason.And when viewed the view source of the xml file in notepad '<' symbol is shown as ampersand lt;can anyone please solve this?Thanks in advance
 
Back
Top