2
  • I am trying to parse the xml data coming from webservice using SAX parser, when i try to parse the data(size:7.4MB) using URL, it works fine but when I copy the xml data from the URL and place the xml file(size:7.4MB) in the raw folder, the parsing fails.

  • When the size of file placed in raw folder is reduced to 1.95MB, it works fine. I have tried shuffling the tags to check if there are any issues with the data, I haven't found any.It works fine as long as the size doesn't exceed 1.95MB. Is there any size limit while parsing the data from raw folder in android? if yes what is the limit? or How to parse the large files using SAX parser?

Any pointers will really help me. Thanks in advance for your time and any help offered.

Regards, Ramesh

02-14 17:35:35.651: DEBUG/asset(11035): Data exceeds UNCOMPRESS_DATA_MAX (2138421 vs 2097152) 
02-14 17:35:35.651: WARN/dalvikvm(11035): threadid=9: thread exiting with uncaught exception (group=0x4001d7d0) 
02-14 17:35:35.659: ERROR/AndroidRuntime(11035): FATAL EXCEPTION: Thread-13 
02-14 17:35:35.659: ERROR/AndroidRuntime(11035): java.lang.AssertionError: java.io.IOException 
02-14 17:35:35.659: ERROR/AndroidRuntime(11035): at android.util.Xml.parse(Xml.java:89) 

code

try { 
    System.out.println("1"); 
    //Xml.parse((url.openConnection().getInputStream()), Encoding.UTF_8, datahandler); 
    Xml.parse(getResources().openRawResource(R.raw.sample), Encoding.UTF_8, datahandler); 
    System.out.println("2"); 
    //xr.parse(new InputSource(getAssets().open("sample.xml")));
}catch(Exception e){ 
    System.out.println("Ramesh"+"XML Parsing exception:"+e);
}

error

Android DEBUG/asset(11035): Data exceeds UNCOMPRESS_DATA_MAX (2138421 vs 2097152) 
WARN/dalvikvm(11035): threadid=9: thread exiting with uncaught exception (group=0x4001d7d0) 
ERROR/AndroidRuntime(11035): FATAL EXCEPTION: Thread-13 
ERROR/AndroidRuntime(11035): java.lang.AssertionError: java.io.IOException 
ERROR/AndroidRuntime(11035): at android.util.Xml.parse(Xml.java:89) 
ERROR/AndroidRuntime(11035): at com.infosys.gss.ui.Login$2$1.run(Login.java:431) 
ERROR/AndroidRuntime(11035): Caused by: java.io.IOException
dave.c
  • 10,910
  • 5
  • 39
  • 62
Ramesh
  • 33
  • 4
  • What do you mean with "the parsing fails"? – Heiko Rupp Feb 14 '11 at 11:59
  • [refer to this](http://stackoverflow.com/questions/355909/parsing-very-large-xml-documents-and-a-bit-more-in-java) – Reno Feb 14 '11 at 12:01
  • Can you put your code how you are doing this – ingsaurabh Feb 14 '11 at 12:02
  • 02-14 17:35:35.651: DEBUG/asset(11035): Data exceeds UNCOMPRESS_DATA_MAX (2138421 vs 2097152) 02-14 17:35:35.651: WARN/dalvikvm(11035): threadid=9: thread exiting with uncaught exception (group=0x4001d7d0) 02-14 17:35:35.659: ERROR/AndroidRuntime(11035): FATAL EXCEPTION: Thread-13 02-14 17:35:35.659: ERROR/AndroidRuntime(11035): java.lang.AssertionError: java.io.IOException 02-14 17:35:35.659: ERROR/AndroidRuntime(11035): at android.util.Xml.parse(Xml.java:89) – Ramesh Feb 14 '11 at 12:08
  • Hi Saurabh, here is code:try{ System.out.println("1"); //Xml.parse((url.openConnection().getInputStream()), Encoding.UTF_8, datahandler); Xml.parse(getResources().openRawResource(R.raw.sample), Encoding.UTF_8, datahandler); System.out.println("2"); //xr.parse(new InputSource(getAssets().open("sample.xml"))); }catch(Exception e){ System.out.println("Ramesh"+"XML Parsing exception:"+e); } – Ramesh Feb 14 '11 at 12:14
  • What exception are you getting? – DKIT Feb 14 '11 at 12:21
  • you anr not supposed to write here. oh dear oh dear. – Reno Feb 14 '11 at 12:21
  • @DKIT Android DEBUG/asset(11035): Data exceeds UNCOMPRESS_DATA_MAX (2138421 vs 2097152) WARN/dalvikvm(11035): threadid=9: thread exiting with uncaught exception (group=0x4001d7d0) ERROR/AndroidRuntime(11035): FATAL EXCEPTION: Thread-13 ERROR/AndroidRuntime(11035): java.lang.AssertionError: java.io.IOException ERROR/AndroidRuntime(11035): at android.util.Xml.parse(Xml.java:89) ERROR/AndroidRuntime(11035): at com.infosys.gss.ui.Login$2$1.run(Login.java:431) ERROR/AndroidRuntime(11035): Caused by: java.io.IOException – Ramesh Feb 14 '11 at 12:21
  • This is a heck I believe might work change your xml extension to mp3, jpeg or any media format – ingsaurabh Feb 14 '11 at 12:35
  • @Ramesh, I have updated your question with the info you provided in the comments. In future, if you have code or stacktrace to add, please click the `edit` button under your question and add the information there, rather than adding it in a comment. It is much easier to read code and errors when they are part of the original question. – dave.c Feb 14 '11 at 12:39

0 Answers0