debugging

This commit is contained in:
Sai1919
2016-11-11 12:01:35 +05:30
parent a797e90b16
commit e2578ccdc9

View File

@@ -148,7 +148,7 @@ XmlParser.prototype.parse = function (chunk) {
var index var index
var xpath var xpath
var pathTokens var pathTokens
console.log('***************inside emitInterestedNode name=', name)
xpath = state.currentPath.substring(1) xpath = state.currentPath.substring(1)
pathTokens = xpath.split('/') pathTokens = xpath.split('/')
pathTokens.push(name) pathTokens.push(name)
@@ -160,6 +160,7 @@ XmlParser.prototype.parse = function (chunk) {
} }
if (Array.isArray(tempObj)) tempObj = tempObj[tempObj.length - 1] if (Array.isArray(tempObj)) tempObj = tempObj[tempObj.length - 1]
scope.emit(name, tempObj) scope.emit(name, tempObj)
console.log('*************pushing tempObj on name=', tempObj, name)
scope.push(tempObj) scope.push(tempObj)
} }
@@ -243,6 +244,7 @@ XmlParser.prototype.parse = function (chunk) {
index = temp.indexOf('/') index = temp.indexOf('/')
if (index !== -1) temp = temp.substring(0, index) if (index !== -1) temp = temp.substring(0, index)
if (temp !== name) { if (temp !== name) {
console.log('****************ending the stream as root doesnt match')
scope.end() scope.end()
} }
} }
@@ -250,7 +252,9 @@ XmlParser.prototype.parse = function (chunk) {
} }
XmlParser.prototype._flush = function (callback) { XmlParser.prototype._flush = function (callback) {
this.parse('') console.log('**************inside flush')
this.parse('', true)
console.log('**************inside flush returned from parse calling callback')
callback() callback()
} }