aboutsummaryrefslogtreecommitdiff
path: root/node_modules/xml2js/x.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/xml2js/x.js')
-rw-r--r--node_modules/xml2js/x.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/xml2js/x.js b/node_modules/xml2js/x.js
new file mode 100644
index 000000000..b51ce5704
--- /dev/null
+++ b/node_modules/xml2js/x.js
@@ -0,0 +1,24 @@
+var util = require('util');
+var xml2js = require('xml2js');
+
+var myxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?> \
+<Items> \
+ <Item> \
+ <id>1</id> \
+ <color>green</color> \
+ </Item> \
+ <Item> \
+ <id>2</id> \
+ <color>red</color> \
+ </Item> \
+ <Item> \
+ <id>3</id> \
+ <color>yellow</color> \
+ </Item> \
+</Items>"
+
+xml2js.parseString(myxml, function (e, r) {
+ console.log(util.inspect(r, false, null));
+ console.log(new xml2js.Builder().buildObject(r));
+});
+