CDATA to ignore html tags doesn't work

Tiana

New Member
Hi I'm passing a message to an attribute in XML. The xml is 'emailBodyXML' and the attribute I want to receive the message is the 'body'. The message I'm passing is contained in a variable 'emailBody'.I have this code:\[code\]emailBodyXML.selectSingleNode("//email").setAttribute("body", "<![CDATA[" + emailBody + "]]>");\[/code\]I put cdata in it because I want it to ignore the html tags the emailBody may contain.But when I debug it, the html tags get converted to \[code\]<\[/code\] or \[code\]>\[/code\]. I don't like it to get converted to that. I want it to still show '<' and '>'. What's wrong with my code?
 
Back
Top