- xml2json.git
- test
- test-xmlsanitize.js
This file ( 616B ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
var fs = require('fs');
var path = require('path');
var parser = require('../lib');
var assert = require('assert');
var expected = fs.readFileSync(__dirname + '/fixtures/xmlsanitize.xml', {encoding: 'utf8'});
//console.log("expected: " + expected)
var json = parser.toJson(expected, {object: true, space: true});
//console.log('xml => json: \n%j', json);
var xmlres = parser.toXml(json, { sanitize: true });
//console.log(xmlres)
//assert.deepEqual(json.doc.Column.length, 5, 'should have 5 Columns');
assert.strictEqual(expected, xmlres, 'xml strings not equal!')
console.log('xml2json toXml sanitize passed!');