GithubHelp home page GithubHelp logo

jhannes / eaxy Goto Github PK

View Code? Open in Web Editor NEW
53.0 4.0 11.0 494 KB

Eaxy - Enjoy XML. Java library for parsing, building and iterating both simple and huge + complex XML

License: Other

Java 99.68% HTML 0.32%
java xml-library xml xml-parser library

eaxy's People

Contributors

dependabot[bot] avatar jhannes avatar quaff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

eaxy's Issues

lazy Iterable<Element> which discards subtree

Event driven is annoying. One alternative is to use a lazy Iterable. The syntax could be something like this:

for (Element element : Xml.iterate(someReader).find("foo", "bar", "baz")) {
}

The element contains a full subtree but eaxy would discard it when Iterator.next() is called.

This feature is of course most useful for documents that could be thought of as consisting of several sub-documents.

first, firstOrNull, single, singleOrNull convenience methods for find()ing a single Element

first, firstOrNull, single, singleOrNull to deal with the four possible restrictions (accept many or not, accept no hits or not).

Convenience method for finding exactly one element by path: Finding a set of
elements, insuring that there was exactly one result, and then
grabbing the first element in the set.

                    ElementSet verticesSet = mesh.find("vertices");
                    if (1 != verticesSet.size()) {
                        throw new RuntimeException("Found " +

verticesSet.size() + " vertices sets for geometry id=" + geometry.id()

  • " name=" + geometry.name());
    }
    Element vertices = verticesSet.first();

Outstanding question: Would you want them to be searching arbitrary depth or direct path?

ValidationTest test failed

Running org.eaxy.usage.ValidationTest
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.189 sec <<< FAILURE!

Tests in error:
shouldAcceptValidXml(org.eaxy.usage.ValidationTest): cvc-complex-type.3.2.2: Attribute 'role' is not allowed to appear in element 'msg:recipient'.

please make all static utility methods public

We love this easy-to-use xml library and use it more and more in stead of e.g. JAXB.
There are however, some utility methods which are hidden from outside use with no apparent reason. In specific, we'd like to be able to access DomTransformer.createElement, but there are others, e.g. org.eaxy.DomTransformer.createName, IOUtil.slurp(BufferedReader reader) etc.
Regards,
Erik Dybdahl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.