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

xml doubt

25 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(

"&","&").

replaceAll(

"<"<").

replaceAll(

">",">").

replaceAll(

"/",""").

replaceAll(

"'","'");

}

return strXMLEncodedString;