You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bob Rudis
fe2739c1b1
|
8 years ago | |
---|---|---|
.. | ||
README.md | 8 years ago | |
package.json | 8 years ago | |
treewdgt.css | 8 years ago | |
xml-viewer.js | 8 years ago |
README.md
xml-viewer
Render and interact with XML in the browser
Example
var Viewer = require('xml-viewer');
var fs = require('fs');
var xml = fs.readFileSync(__dirname + '/data.xml');
var insertCSS = require('insert-css');
var view = new Viewer(xml);
view.appendTo(document.body);
view.on('select', function(node){
if (!node) return console.log('nothing selected');
console.log('selected:');
console.log(node);
console.log(node.text());
});
insertCSS('.selected { background-color: #FFFF91 }');
Installation
$ npm install xml-viewer
License
MIT