I do not quite understand why you want to parse your XML file twice. Just because you are looking for two different results does not mean that you have to parse the whole stream twice. I would just have two lists (your List<BeanA> and List<BeanB>) and whenever there is a tag in the stream from which to fill that list, append something to either list. That way you get both results in a single parse event over the document.
(Apologies if there is some stringent reason why you cannot look for the information on both elements at the same time) Ludwig 2008/10/26 Premier <[EMAIL PROTECTED]> > > No, the file isn't inside my application, it is external, an upgrade! > > I used XMLPullParser, but in this way i can't parse the file two > times. > > i.e. > > XmlPullParser xpp= ctx.getResources().getXml(R.xml.file); > XmlDeserializer xmlDeserializer= new XmlDeserializer(xpp); > > List<BeanA> listOfBeanA= > (List<BeanA>)xmlDeserializer.deserialize(BeanA.class); > List<BeanB> listOfBeanB= > (List<BeanB>)xmlDeserializer.deserialize(BeanB.class); > > At firts time (BeanA), the parse works correctly, at second time, it > doesn't works. > > Can you suggest me another way? > > Tnx. > > > On Oct 26, 3:24 pm, Mark Murphy <[EMAIL PROTECTED]> wrote: > > Premier wrote: > > > Hello world, > > > i'd like to open a popup into my application and read the selected > > > file. > > > That file is xml-file, and i want to parse it. > > > > > Now i'm using context.getAssets().open(fileName); > > > but it requires text file and not xml. > > > > If the file is part of your APK, make it an XML resource. Put it in > > res/xml/ in your project and use Resources.getXML() to get an XML Pull > > Parser. This is reportedly significantly more efficient than parsing it > > yourself. > > > > Beyond that, there are three XML parsers in Android: DOM, SAX, and the > > aforementioned XML pull parser. > > > > -- > > Mark Murphy (a Commons Guy)http://commonsware.com > > _The Busy Coder's Guide to Android Development_ Version 1.3 Published! > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

