-
Notifications
You must be signed in to change notification settings - Fork 0
/
test2.js
42 lines (39 loc) · 797 Bytes
/
test2.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
var Parser = require("fast-xml-parser").j2xParser;
//default options need not to set
var defaultOptions = {
attributeNamePrefix : "@_",
attrNodeName: "@", //default is false
textNodeName : "#text",
ignoreAttributes : false,
cdataTagName: "__cdata", //default is false
cdataPositionChar: "\\c",
format: false,
indentBy: " ",
supressEmptyNode: false,
};
var obj=
var parser = new Parser(defaultOptions);
var xml = parser.parse(obj);
console.log(xml)
*/
var XML = require('xml')
var xml = XML(
// Class: 'e',
// Health: 'aoeu',
// Identity: 'eueou'
{
nested: [{
keys: [{
fun: 'hi',
}, {
nested: [{
keys: [{
_fun: 'hi'
}]
}]}
]
}]
}
)
console.log(xml)