simple-easy-xml-parser

General

Category
Free
Tag
XML
License
Apache License, Version 2.0
Registered
Jul 5, 2014
Favorites
0
Link
https://github.com/novoda/simple-easy-xml-parser
See also
Tik XML
kXML
XmlToJson
Simple
XStream

Additional

Language
Java
Version
1.0.8 (Dec 23, 2015)
Created
Jun 23, 2013
Updated
Jan 10, 2018 (Retired)
Owner
Novoda (novoda)
Contributors
Carl-Gustaf Harroch (charroch)
Paul Blundell (blundell)
Benjamin AUGUSTIN (Dorvaryn)
Eugen Martynov (emartynov)
cketti
paulinemontmayeur
Adam Brown (ouchadam)
Ryan Feline (Mecharyry)
Xavi Rigau (xrigau)
Ataul Munim (ataulm)
danielohrlund
Daniele Conti (fourlastor)
Jeroen Mols (JeroenMols)
Juanky Soriano (juankysoriano)
Joe Timmins (joetimmins)
alpert
16
Activity
Badge
Generate
Download
Source code
APK file

Advertising

simple-easy-xml-parser

XML parsing is now sexy!

Description

A simple, high performance, typed XML parser based upon Android sax parser but written in pure Java. SEXP gives callbacks for all parsing events and being written in pure java allows faster and more comprehensive testability.

Moreover SEXP is a pull-parsing XML deserialiser which affects both performance (no reflection is required) and low memory footprint (unncessary objects are not allocated). Our testing shows that SEXP performs:

You can refer to the following micro-benchmarking for further information.

Adding to your project

To start using this library, add these lines to the build.gradle of your project:

repositories {
    jcenter()
}

dependencies {
    compile 'com.novoda:sexp:1.0.8'
}

Simple usage

String XML =
            "<novoda>" +
              "<favouriteColour>Blue</favouriteColour>" +
            "</novoda>";

ElementFinderFactory factory = SimpleEasyXmlParser.getElementFinderFactory();
elementFinder = factory.getStringFinder();
Streamer<String> streamer = new SimpleStreamer(elementFinder);
String favouriteColour = SimpleEasyXmlParser.parse(XML, streamer);

private static class SimpleStreamer implements Streamer<String> {

    private final ElementFinder<String> elementFinder;
    private final String elementTag;

    public SimpleStreamer(ElementFinder<String> elementFinder, String elementTag) {
        this.elementFinder = elementFinder;
        this.elementTag = elementTag;
    }

    @Override
    public RootTag getRootTag() {
        return RootTag.create("novoda");
    }

    @Override
    public void stream(RootElement rootElement) {
        elementFinder.find(rootElement, elementTag);
    }

    @Override
    public String getStreamResult() {
        return elementFinder.getResultOrThrow();
    }
}

(See the demo and demoAndroid modules for more.)

Links

Here are a list of useful links:

  • We always welcome people to contribute new features or bug fixes, here is how
  • If you have a problem check the Issues Page first to see if we are working on it
  • For further usage or to delve more deeply checkout the Project Wiki
  • Looking for community help, browse the already asked Stack Overflow Questions or use the tag: support-sexp when posting a new question