Skip to content

Instantly share code, notes, and snippets.

@LasMD
Created December 22, 2012 03:30
Show Gist options
  • Save LasMD/4357365 to your computer and use it in GitHub Desktop.
Save LasMD/4357365 to your computer and use it in GitHub Desktop.
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment