On Tue, Mar 6, 2012 at 6:02 PM, RedBullet <scottedchap...@gmail.com> wrote: > I may not have this problem with the XML structure I am interested in > parsing, but I imagine one could run into issues if there are nested > elements being parsed: > <body> > got some text here > <author>me</author> > </body> > > I am guessing I would have to be clever and maintain multiple accumulators > for each element when it is started (until I get the endElement).
Yup. I've used stack structures for this previously, using the top of the stack as the StringBuilder for characters(), and pushing/popping StringBuilders on/off the stack in startElement()/endElement(). Though my favorite approach is to use a JAR where somebody else wrote all that code for me... :-) -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in NYC: http://marakana.com/training/android/ -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en