diff --git a/parser.js b/parser.js index 8db68d2..302248f 100644 --- a/parser.js +++ b/parser.js @@ -93,7 +93,7 @@ function registerEvents () { var verbatimText = this.opts.verbatimText; parser.on('startElement', function (name, attrs) { - if (state.isRootNode) validateResourcePath(name) + if (state.isRootNode) state.isRootNode = false; state.currentPath = state.currentPath + '/' + name checkForResourcePath(name) if (state.isPathfound) processStartElement(name, attrs) @@ -256,26 +256,6 @@ function registerEvents () { } return jsonPath } - - function validateResourcePath (name) { - var temp - var index - - state.isRootNode = false - - if (resourcePath) { - if (resourcePath[0] === '/') { - temp = resourcePath.substring(1, resourcePath.length) - } else { - temp = resourcePath - } - index = temp.indexOf('/') - if (index !== -1) temp = temp.substring(0, index) - if (temp !== name) { - scope.end() - } - } - } } function processError (err) {