@@ -280,6 +280,7 @@ const parseXml = function(xmlData) {
280
280
} else { //Opening tag
281
281
let result = readTagExp ( xmlData , i , this . options . removeNSPrefix ) ;
282
282
let tagName = result . tagName ;
283
+ const rawTagName = result . rawTagName ;
283
284
let tagExp = result . tagExp ;
284
285
let attrExpPresent = result . attrExpPresent ;
285
286
let closeIndex = result . closeIndex ;
@@ -305,7 +306,7 @@ const parseXml = function(xmlData) {
305
306
if ( tagName !== xmlObj . tagname ) {
306
307
jPath += jPath ? "." + tagName : tagName ;
307
308
}
308
- if ( this . isItStopNode ( this . options . stopNodes , jPath , tagName ) ) { //TODO: namespace
309
+ if ( this . isItStopNode ( this . options . stopNodes , jPath , tagName ) ) {
309
310
let tagContent = "" ;
310
311
//self-closing tag
311
312
if ( tagExp . length > 0 && tagExp . lastIndexOf ( "/" ) === tagExp . length - 1 ) {
@@ -318,8 +319,8 @@ const parseXml = function(xmlData) {
318
319
//normal tag
319
320
else {
320
321
//read until closing tag is found
321
- const result = this . readStopNodeData ( xmlData , tagName , closeIndex + 1 ) ;
322
- if ( ! result ) throw new Error ( `Unexpected end of ${ tagName } ` ) ;
322
+ const result = this . readStopNodeData ( xmlData , rawTagName , closeIndex + 1 ) ;
323
+ if ( ! result ) throw new Error ( `Unexpected end of ${ rawTagName } ` ) ;
323
324
i = result . i ;
324
325
tagContent = result . tagContent ;
325
326
}
@@ -504,6 +505,7 @@ function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){
504
505
tagExp = tagExp . substr ( separatorIndex + 1 ) ;
505
506
}
506
507
508
+ const rawTagName = tagName ;
507
509
if ( removeNSPrefix ) {
508
510
const colonIndex = tagName . indexOf ( ":" ) ;
509
511
if ( colonIndex !== - 1 ) {
@@ -517,6 +519,7 @@ function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){
517
519
tagExp : tagExp ,
518
520
closeIndex : closeIndex ,
519
521
attrExpPresent : attrExpPresent ,
522
+ rawTagName : rawTagName ,
520
523
}
521
524
}
522
525
/**
0 commit comments