below is part of my coding
public static int parseReceivedXML( String xmlStr ){
String person="";
String id="";
String area="";
String amount="";
try{
FileOutputStream ftemp = new FileOutputStream( "doc.xml");
ftemp.write( xmlStr.getBytes());
ftemp.flush();
ftemp.close();
DocumentBuilderFactory oFdb = DocumentBuilderFactory.newInstance();
DocumentBuilder oBldr = oFdb.newDocumentBuilder();
Document oDoc = oBldr.parse( "doc.xml" );
Element oRoot = oDoc.getDocumentElement();
String sRoot = oRoot.getTagName();
this part of code will run until the server connection is close.. it run smoothly at the 1st time of data come in, but when the data come in for 2nd time, i get error as follow
[Fatal Error] doc.xml:1:1: Content is not allowed in prolog.
this error apprear when i trace until
Document oDoc = oBldr.parse( "doc.xml" );
anyone hav any idea? thanks...