Using XML-JS with EnyoJS

I saw this on the GitHub issues page and thought that this was an excellent question.


I apologize if this is posted in the wrong place, but looking at the XML-JS's [Quick Start](https://www.npmjs.com/package/xml-js) example we have

```
var convert = require('xml-js');
var xml =
'<?xml version="1.0" encoding="utf-8"?>' +
'' +
' Happy' +
' Work' +
' Play' +
'';
var op = { compact: true, spaces: 4 };
var result1 = convert.xml2json(xml, op);
console.log(result1);
```

Converting back,

---
console.log(convert. json2xml(result1, op));
---

Which gives the following error:

```
json2xml.js:4 Uncaught ReferenceError: Buffer is not defined
at Object.module.exports [as json2xml] (json2xml.js:4)
at enyoConstructor.handleExport (DataControl.js:357)
at enyoConstructor.dispatch (Component.js:779)
at enyoConstructor.dispatchEvent (Component.js:687)
at enyoConstructor.dispatchEvent (Control.js:1311)
at enyoConstructor.dispatchBubble (Component.js:734)
at enyoConstructor.bubbleUp (Component.js:645)
at enyoConstructor.dispatchEvent (Component.js:716)
at enyoConstructor.dispatchEvent (Control.js:1311)
at enyoConstructor.dispatchBubble (Component.js:734)
at enyoConstructor.bubble (Component.js:617)
at Object.dispatchBubble (dispatcher.js:161)
at Object.dispatch (dispatcher.js:115)
at Object.sendTap (gesture.js:142)
at Object.up (gesture.js:102)
at Object.mouseup (gesture.js:295)
```

Other than what's up there, I grabbed xml-js through
````
npm install --save xml-js
````

Thoughts?
Sign In or Register to comment.