Android XML Parse Exception all of a sudden

omglol

New Member
My code was working fine yesterday, but I start it up again today and am getting the error\[code\]org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: not well-formed (invalid token)\[/code\]The xml in question doesn't have any funky characters. It is stored in a String variable called "xml". To be fair, I wasn't really sure how to deal with that and was just going off of some tutorials, but here was my attempt.\[code\]out = new PrintWriter(mySocket.getOutputStream(), true);BufferedReader br = new BufferedReader(new InputStreamReader(mySocket.getInputStream(), "US-ASCII"));InputStream is = mySocket.getInputStream();...String xml = the stuff that was read in with br.read();...SAXParserFactory saxPF = SAXParserFactory.newInstance();SAXParser saxP = saxPF.newSAXParser();XMLReader xmlR = saxP.getXMLReader();DataHandler myDataHandler = new DataHandler();xmlR.setContentHandler(myDataHandler);xmlR.parse(new InputSource(new StringReader(xml)));myData = http://stackoverflow.com/questions/11415680/myDataHandler.getData();\[/code\]Where did I go wrong?Update: The xml starts with\[code\]<?xml version="1.0" standalone="yes"?> \[/code\]so it doesn't seem that "line 1, column 0" actually has anything wrong with it.Update 2: I found that is.available() is returning 0.... How do I make do with the fixing?
 
Back
Top