package data;

public class XMLUtil
{
    public static String getFormat(String Json)
    {
        StringBuffer xmlRowsSB = new StringBuffer();
        String xmlRowsS;
                        
        xmlRowsSB.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n");
        xmlRowsSB.append("<xml>\n");
        xmlRowsSB.append("<result>\n");
        xmlRowsSB.append("<![CDATA[\n");
        //xmlRowsSB.append("result = {\n");
        xmlRowsSB.append("{\n");
        xmlRowsSB.append(Json);
        //xmlRowsSB.append("};\n");
        xmlRowsSB.append("}\n");
        xmlRowsSB.append("]]>\n");
        xmlRowsSB.append("</result>\n");
        xmlRowsSB.append("</xml>\n");

        xmlRowsS = xmlRowsSB.toString();
        return xmlRowsS;
    }
    
    public static String errorHandler(String errorMessage)
    {
        StringBuffer jsonError = new StringBuffer();
        jsonError.append("\"status\" : \"failure\", \n");
        jsonError.append("\"errorMessage\" : \"" + errorMessage + "\" \n");
        return (jsonError.toString());
    }
   
}





