@@ -234,7 +234,11 @@ XMLP.prototype._parse = function() {
234
234
return XMLP . _NONE ;
235
235
}
236
236
237
- if ( this . m_iP == this . m_xml . indexOf ( "<?" , this . m_iP ) ) {
237
+ var fc = this . m_xml . charAt ( this . m_iP ) ;
238
+ if ( fc !== '<' && fc !== '&' ) {
239
+ return this . _parseText ( this . m_iP ) ;
240
+ }
241
+ else if ( this . m_iP == this . m_xml . indexOf ( "<?" , this . m_iP ) ) {
238
242
return this . _parsePI ( this . m_iP + 2 ) ;
239
243
}
240
244
else if ( this . m_iP == this . m_xml . indexOf ( "<!DOCTYPE" , this . m_iP ) ) {
@@ -599,17 +603,24 @@ XMLP.prototype._parsePI = function(iB) {
599
603
}
600
604
601
605
XMLP . prototype . _parseText = function ( iB ) {
602
- var iE , iEE ;
606
+ var iE , ch ;
603
607
604
- iE = this . m_xml . indexOf ( "<" , iB ) ;
605
- if ( iE == - 1 ) {
606
- iE = this . m_xml . length ;
607
- }
608
-
609
- iEE = this . m_xml . indexOf ( "&" , iB ) ;
610
- if ( ( iEE != - 1 ) && ( iEE <= iE ) ) {
611
- iE = iEE ;
608
+ for ( iE = iB ; iE < this . m_xml . length ; ++ iE ) {
609
+ ch = this . m_xml . charAt ( iE ) ;
610
+ if ( ch === '<' || ch === '&' ) {
611
+ break ;
612
+ }
612
613
}
614
+
615
+ // iE = this.m_xml.indexOf("<", iB);
616
+ // if(iE == -1) {
617
+ // iE = this.m_xml.length;
618
+ // }
619
+ //
620
+ // iEE = this.m_xml.indexOf("&", iB);
621
+ // if((iEE != -1) && (iEE <= iE)) {
622
+ // iE = iEE;
623
+ // }
613
624
614
625
this . _setContent ( XMLP . _CONT_XML , iB , iE ) ;
615
626
0 commit comments