Skip to Content
0
Former Member
May 30, 2009 at 02:29 PM

xml doubt

27 Views

I havr writen this prog, it converts all &,,<,. ect to xml values to display in excel.....

I need the value for "\" plz help me

public java.lang.String encodeValuentoXML( java.lang.String strValueToBeEncoded )

{

//@@begin encodeValuentoXML()

String strXMLEncodedString =

"";

//Converting characters &,<,>,'," into their XML equivalents.

if(strValueToBeEncoded!=null && strValueToBeEncoded.trim().length() > 0) {

strXMLEncodedString = strValueToBeEncoded.replaceAll(

"&","&amp;").

replaceAll(

"<","&lt;").

replaceAll(

">","&gt;").

replaceAll(

"/","&quot;").

replaceAll(

"'","&apos;");

}

return strXMLEncodedString;