Skip to content

Commit

Permalink
#52
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Jul 6, 2023
1 parent a743c58 commit 4735417
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,49 @@ Also, you can insert it in some JSON datastore:
accounts.insert(new BankAccount(iban,nickname));
```

### JSON to XML

You can easily transform JSON to XML using [JsonXML]():

```json
{
"test": "true",
"simple": "true",
"project": "eokson-0.3.2"
}
```

```java
final String xml = new JsonXML(new JsonOf(json), "test").asString();
```

here is XML output:

```xml
<?xml version='1.0' encoding='UTF-8'?>
<test>
<test>true</test>
<simple>true</simple>
<project>eokson-0.3.2</project>
</test>
```

You can integrate it with [jcabi-xml](https://github.com/jcabi/jcabi-xml):

```java
import com.jcabi.xml.XMLDocument;
import com.jcabi.xml.XML;

final XML xml = new XMLDocument(
new JsonXML(
new JsonOf(
json
),
"test"
).asString()
);
```

## How to Contribute

Fork repository, make changes, send us a [pull request](https://www.yegor256.com/2014/04/15/github-guidelines.html).
Expand Down

0 comments on commit 4735417

Please sign in to comment.