Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

XmlParser For Android

Xml Parser for Android that reads an Xml file and creates a composite XmlObject.

XmlObjects are infinitely nestable.

Example:

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
}

Expected Output:

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

About

Java Android XmlParser. Creates an Composite XmlObject from xml file.

Resources

Releases

No releases published

Packages

No packages published

Languages