diff --git a/app.js b/app.js index b8c3ba8..ba51158 100755 --- a/app.js +++ b/app.js @@ -37,7 +37,7 @@ if (program.input) { } }).catch(err=>{ console.error('An error came : ', err); - }) + }); } // Start Cli on Folder if (program.folder) { diff --git a/lib/FromXml.js b/lib/FromXml.js index 1e94587..3015219 100644 --- a/lib/FromXml.js +++ b/lib/FromXml.js @@ -43,11 +43,11 @@ class FromXml { } // first time we meet this xpath if(!this._count.hasOwnProperty(parents)){ - this._count[parents] = { count: 1, level: level , attributes : attributes }; + this._count[parents] = { countElement: 1, level: level , attributes : attributes }; } else{ // We already meet this xpath , we now merge currAttr with globals attributes - this._count[parents].count++; + this._count[parents].countElement++; for(let attr in attributes){ if(!this._count[parents].attributes.hasOwnProperty(attr)){ this._count[parents].attributes[attr] = attributes[attr]; diff --git a/readme.md b/readme.md index 99fdb24..600a2ce 100644 --- a/readme.md +++ b/readme.md @@ -67,12 +67,12 @@ Use it : ```js let xml = new FromXml().generate('path/to/XML').then(result=> { for (var key in result) { - console.log(`${path} ${result[path].count}`); + console.log(`${path} ${result[path].countElement}`); } }); let xmls = new FromFolder().generateAll(program.folder).then(result=> { for (var key in result) { - console.log(`${path} ${result[path].count}`); + console.log(`${path} ${result[path].countElement}`); } }); ``` @@ -83,7 +83,7 @@ Result will return an array of object like: [ { '/path/number/1' : { - count : n, + countElement : n, level : n, attributes: { attr1: ['a','list','of','distinct','values','for','attr1'], @@ -94,7 +94,7 @@ Result will return an array of object like: }, { '/path/number/2' : { - count : n, + countElement : n, level : n, attributes: { attr1: ['a','list','of','distinct','values','for','attr1'],