Click anywhere to close

XmlParser for Android

XmlParser is an XmlParser that utilizes XmlPullParser to read in a generic Xml stream and create a composite XmlObject. This object contains all of the data that was in the xml file. The intention of this library is to simplify any code that used to have to write a bunch of boiler plate code in order to interact with XmlPullParser. Below are some usage examples of XmlParser.

Sample Xml File:
<array>
    <item>First Item</item>
    <anotheritem>Second Item</anotheritem>
</array>

Java code snippet:
InputStream is = getContext().getResources().openRawFile( R.raw.simple_xml )
XmlParser parser = new XmlParser( is, null );
try {
    XmlObject obj = parser.getXmlObject();
    Log.v( "Xml Parser", "Array with name: " + child.getTagName() );
    for( XmlObject child : obj.getChildren() ) {
        Log.v( "Xml Parser", "Child Tag Name: " + child.getTagName() +
                                     " Value: " + child.getValue() );
    }
} catch ( XmlParserException e ) {
    e.printStackTrace(); // Something went wrong.  Xml is formated incorrectly
}

Expected logcat output:
Array with name: array
Child Tag Name: item Value: First Item
Child Tag Name: anotheritem Value: Second Item


Recent Posts

The future is multiplayer
Technology
posted: November 05, 2026
How we stay productive in the claude code era Two things always mattered for engineering productivity, but Claude Code makes them matter a lot more: managing many projects at once, and iterating as fast as possible.
Technology
posted: April 14, 2026
Not Enough People Are Talking About AI-Enabled Disruption The real winners of the AI wave will be people who figure out how to disrupt old industries by building AI-first companies.
Technology
posted: February 24, 2026
Engineering Culture at Hi Finance What we're building at hi finance, why we're building it, and the engineering values driving how we build it. Plus, we're hiring a Founding Engineer.
Technology
posted: February 16, 2026
AI Doesn't Change the Job of a Software Engineer Writing code is not, and has never been, the main job of a Software Engineer
Technology
posted: February 06, 2026