Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SvenEwald/xmlbeam
Java XML library. A really cool one. Obviously.
https://github.com/SvenEwald/xmlbeam
Last synced: about 2 months ago
JSON representation
Java XML library. A really cool one. Obviously.
- Host: GitHub
- URL: https://github.com/SvenEwald/xmlbeam
- Owner: SvenEwald
- License: apache-2.0
- Created: 2012-12-20T12:08:30.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2023-09-23T11:52:38.000Z (about 1 year ago)
- Last Synced: 2024-05-03T00:15:58.261Z (8 months ago)
- Language: Java
- Homepage: https://xmlbeam.org
- Size: 2.48 MB
- Stars: 73
- Watchers: 4
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-java - XMLBeam - Processes XML by using annotations or XPath within code. (Projects / Miscellaneous)
README
XMLBeam
This is a Java XML library with an extraordinary expressive API.
By using XPath for read and write operations, many operations take only one line of Java code.
This is how it looks:```XML
bar
```
Access XML content in an object oriented way:
```Java
public interface Example {
// This is a getter for the attribute "type"
@XBRead("/xml/example/content/@type")
String getType();
// This is a getter and a setter for the value of the element "content"
@XBAuto("/xml/example/content")
XBAutoValue content();
}Example example = new XBProjector().io().file("example.xml").read(Example.class);
String type = example.getType(); // "foo"
String content = example.content().get(); // "bar"
example.content().set("new value");
```Or, direct access via XPath enabled collection types:
```Java
Map map = new XBProjector().io().file("example.xml").readAsMapOf(String.class);
String type = map.get("/xml/example/content/@type");
String content = map.get("/xml/example/content");
map.put("/xml/example/content","new value");
```Learn more on [xmlbeam.org](https://xmlbeam.org)