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

https://github.com/kunyan/obj2xml

JavaScript Object to XML string
https://github.com/kunyan/obj2xml

Last synced: 3 months ago
JSON representation

JavaScript Object to XML string

Awesome Lists containing this project

README

          

obj2xml
===

##### Object to XML

```javascript
const obj2xml = require('obj2xml');

const person = {
name: 'kyan',
age: 28,
company: 'RedHat Inc.',
getAge: function() {
return this.age;
}
};

const xml = obj2xml('person', person);
```
output:
```xml

```

##### Array to XML

```javascript
const obj2xml = require('obj2xml');

const jim = {
name: "Jim",
age: 12,
parent: {
name: "Mike",
age: 45,
},
};

const mike = {
name: "Jim",
age: 45,
child: {
name: "Jim",
age: 12,
}
};

const persons = [jim, mike];

const xml = obj2xml('persons', persons);
```

```xml






```