I generate a XML like this. It works fine. But I want to print it out in Eliscps:
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
public class PersonConstructor {
String info="";
String path="c://myfile/myperson";
// here is my xml object
Person person = new Person();
person.setFirstName("fname");
person.setLastName("lname");
person.setTel("111-111-1111");
person.setAddress("1000 main st.");
//Serializer my object to file.
Serializer serializer = new Persister();
File file = new File(path);
serializer.write(person, file);
//now I want to print out my xml file.I don't know how to do it.
info = file.toString();
System.out.println(info);
}
Should I use output stream?