Skip to content
This repository was archived by the owner on Jan 7, 2021. It is now read-only.

Commit d155d84

Browse files
committed
Merge branch 'master' into 0.2
2 parents 71c192c + 3b173cb commit d155d84

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

lib/json2xml.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var xml = '';
2-
module.exports = function toXml(json) {
1+
module.exports = function toXml(json, xml) {
2+
var xml = xml || '';
33
if (json instanceof Buffer) {
44
json = json.toString();
55
}
@@ -26,12 +26,12 @@ module.exports = function toXml(json) {
2626
var l = elems.length;
2727
for (var j = 0; j < l; j++) {
2828
xml += '<' + key + '>';
29-
toXml(elems[j]);
29+
xml = toXml(elems[j], xml);
3030
xml += '</' + key + '>';
3131
}
3232
} else if (typeof(obj[key]) == 'object') {
3333
xml += '<' + key + '>';
34-
toXml(obj[key]);
34+
xml = toXml(obj[key], xml);
3535
xml += '</' + key + '>';
3636
} else if (typeof(obj[key]) == 'string') {
3737
if (key == '$t') {

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
"description" : "Converts xml to json using node-expat.",
66
"repository": "git://github.com/buglabs/node-xml2json.git",
77
"main": "index",
8-
"maintainers":[ {
9-
"name": "Camilo Aguilar",
10-
"email": "camilo@buglabs.net"}
11-
],
8+
"contributors":[ {"name": "Camilo Aguilar", "email": "camilo@buglabs.net"}],
129
"dependencies": {
1310
"node-expat": "1.3.2"
1411
}

0 commit comments

Comments
 (0)