An open API service indexing awesome lists of open source software.

https://github.com/t1/xml

modern api for xml documents
https://github.com/t1/xml

java xml

Last synced: 9 months ago
JSON representation

modern api for xml documents

Awesome Lists containing this project

README

          

# xml [![Maven-Central](https://maven-badges.herokuapp.com/maven-central/com.github.t1/xml/badge.svg)](https://search.maven.org/artifact/com.github.t1/xml)

modern api for xml documents

Xml has a bad reputation for being complex. Part of that reputation comes from the APIs you have to use to work with it.
They haven't changed in years and reflect the coding style that was common 20 years ago.
So it's not fair to compare modern APIs, e.g. JSON-B, with the old APIs, e.g. JAX-B.

This project tries to give a XML a modern, fluent API.
It's not complete or polished, but I use it in some projects for production code.

# sample code

```java
Xml xml = Xml.createWithRootElement("root");
xml.addComment("my-comment");
xml.getOrCreateElement("elem")
.setAttribute("attr", "val")
.addText("foo")
.addText("bar");
```

creates a document:

```xml


foobar

```