jhannes / eaxy Goto Github PK
View Code? Open in Web Editor NEWEaxy - Enjoy XML. Java library for parsing, building and iterating both simple and huge + complex XML
License: Other
Eaxy - Enjoy XML. Java library for parsing, building and iterating both simple and huge + complex XML
License: Other
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 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()
Outstanding question: Would you want them to be searching arbitrary depth or direct path?
When it comes to finding by attribute value this is supported with the syntax find("verticies[class=rounded]"), or find(ElementFilters.attr("class", "rounded")).
Provide chained or fluent-style element query filters:
Example:
element.query().tagName("verticies").attr("class", "rounded").list()
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'.
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
add a method Document.setEncoding(encoding) not hardcode UTF-8
and() element filter should not require filter name in constructor -- default to "&" perhaps
return a ordered map of all attributes on this element.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.