LasithaMD
12/22/2012 - 3:30 AM

this is a code for making an XML sheet by using a loop . the vector passed for the loop comes from a different location with a static number

this is a code for making an XML sheet by using a loop . the vector passed for the loop comes from a different location with a static number of values(5 values all the time). after finishing the work all the elements were removed from the vector .. Kindly debug this code

public synchronized String xmlWrite(String rootEle){
        sb.delete(0,sb.length());
        StringBuffer append = sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>").append("<").append(rootEle).append(">");
        String s="";
        for(int i=0;i<v.size();i++){
            s=s.concat("<vectorData>"+(String)v.elementAt(i)+"</vectorData>");
        }
        append.append(s);
        append.append("</").append(rootEle).append(">");
        String s2=append.toString();

        return s2;
        
    }