Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/javadev/xml-to-json

Xml to json javascript library.
https://github.com/javadev/xml-to-json

javascript json json-to-xml xml xml-json-converter xml-to-json

Last synced: 2 months ago
JSON representation

Xml to json javascript library.

Awesome Lists containing this project

README

        

xml-to-json
===========

Utility for converting between XML and JSON formats, with the added ability to prettify both XML and JSON strings.

### Usage

```javascript
var json = xmlToJson("");

// {
// "a": {
// "-self-closing": "true"
// },
// "#omit-xml-declaration": "yes"
// }

var prettyXml = formatXml("");

//
//
//

var xml = jsonToXml("{}");

//
//

var xml = jsonToXml("{}", "myroot");

//
//

var prettyJson = formatJson('{"a":{"b":true}}');

// {
// "a": {
// "b": true
// }
// }
```