org.xmlpull.v1.XmlPullParserException: Error parsing document. (position:line -1, column -1) caused by: org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 265: not well-formed (invalid token)在实际的开发中我们发送请求访问服务器端,当返回的是xml格式的InputStream对象时,有时我们采用解析方法如sax, pull 对流进行解析时会出现上面的情况,显示解析,这时可以将流对象读取到内存中转换成字符串,在以流的方式从内存中读出。重新解析就可以得到正确的集合对象 public static byte[] readInput(InputStream in ) throws IOException{
public static InputStream getStringStream(String sInputString){ |