Simple Java XML Parser (SJXP) 2.0 is released. SJXP is a very light weight (4 class) abstraction to XML Pull Parsing on Android (and Java in general) that allows you to use XPath-like expressions in parsing without needing to worry about while loops, event handling, try-catch blocks, etc.
A quick example of parsing story links from an RSS feed would look like this: ================= IRule linkRule = new DefaultRule(Type.CHARACTER, "/rss/channel/item/ link") { @Override public void handleParsedCharacters(XMLParser parser, String text, Object userObject) { // Also store the link, or something equivalently fancy } } XMLParser parser = new XMLParser(linkRule); parser.parse(xmlInputStream); ================= You just specify a type for the rule, provide a path in the XML you want parsed and then override 1 of 3 default no-op handlers and then you can just sit around waiting for data to show up at your doorstep. Namespaces are also supported, please see the project page for a lot more documentation, examples and benchmarks. Performance + Ease of Use is the big win and the design focus of SJXP. New and Noteworthy =============== * Memory usage and CPU usage are a magnitude times smaller than what they were in 1.x series. Spent some quality time with HPROF finding and removing hotspots. * A new TAG type of rule is supported if you are just analyzing XML metrics and don't want the overhead of parsing data out of it. * Support for user-object passthrough was added to make it easier to get at data stores inside of the handlers. Project: http://www.thebuzzmedia.com/software/simple-java-xml-parser-sjxp/ Download: https://github.com/downloads/thebuzzmedia/simple-java-xml-parser/sjxp-2.0.zip SJXP is licensed under the Apache 2 license. Good or bad feedback is appreciated! -- 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