The easiest way to set Strings containing “special characters” that you do not want parsed is to wrap them in a CDATA section:

http://www.w3.org/TR/xml11/#dt-cdsection

 

The solution for your example would be:

parentName.setName("<![CDATA[kathir&]]>");

 

Cheers,

 

~ David


From: kathiresan jeyapandian [mailto:[EMAIL PROTECTED]
Sent: July 13, 2006 6:09 AM
To: [EMAIL PROTECTED]
Subject: XML Strings with special Characters

 

Hi All,

 

       I am trying to set the string content of an element.

       I simply do parentName.setName("kathir&");

       The problem is that the string contains ampersands (&). In the xml i am getting & instead of getting &amp;

       I need to get the output xml with & as &amp;

 

Please help me.

Thanks,
J.Kathir

 

 


Find out what India is talking about on Yahoo! Answers India.
So, what’s NEW about the NEW Yahoo! Messenger? Find out.

Reply via email to