Problems whilst Parsing XML with KXML2

I have been doing a lot of reading up on the APIs of XMLPull and KXML2.

I seem to be facing a problem which can't be solved just by reading but rather the expertise of the more experienced programmers dealing with XML parsing in J2ME.

I know how long it takes to process an entire XML document, I just would like to parse certain parts of the document. For e.g. instead of reading the whole document, say I just want to read the first 7 items and subsequently, the next 7 items when the user clicks on the next page?

In other words, I wish to incorporate paging. Is it possible? Or if you have an alternative solution which will not make a user wait too long, please share it!

Can anyone help me?

[728 byte] By [darrana] at [2007-11-27 4:04:11]
# 1
do the job on the server...the server create a small xml instead of a big one and it to the mobile better than parsing a huge xml file !
suparenoa at 2007-7-12 9:09:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

I don't think that is possible. We can't make the XML any smaller because it contains all the information I want to display. Just that I want to display it in pages/sections so as to reduce the load.

So I was thinking of whether it is possible to read the first 5 <title> tags and next 5 for every page ... etc

darrana at 2007-7-12 9:09:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

> I don't think that is possible. We can't make the XML

> any smaller because it contains all the information I

> want to display. Just that I want to display it in

> pages/sections so as to reduce the load.

> So I was thinking of whether it is possible to read

> the first 5 <title> tags and next 5 for every page

> ... etc

imagine that you have 20 pages so the user will have to download a 20 x 5 items xml file?

if the user stops the navigation at page 4, he will download 16 pages for nothing so that's

why i told you to separate the results...

an xml file for each page and not a huge for all !

suparenoa at 2007-7-12 9:09:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4

That is what I am trying to achieve. I only get the XML file when the user clicks on a specific page. However I do not understand how we can actually make a smaller xml file especially when all the info is in there. Isn't there anyway I can ask the Xmlparser to say read the first 5 now, then the next 5 ... etc

darrana at 2007-7-12 9:09:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
kXML is a pull parser. You have complete control over its parsing behavior and can stop and resume parsing whenever you want.
kweinera at 2007-7-12 9:09:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6
Can you provide more information on how I can stop parsing and then resume later on?
darrana at 2007-7-12 9:09:02 > top of Java-index,Java Mobility Forums,Java ME Technologies...