@@ -3231,6 +3231,7 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3231
3231
case '<' :
3232
3232
case '&' :
3233
3233
case '\u0000' :
3234
+ case ';' :
3234
3235
emitOrAppendCharRefBuf (returnState );
3235
3236
if ((returnState & DATA_AND_RCDATA_MASK ) == 0 ) {
3236
3237
cstart = pos ;
@@ -3259,11 +3260,9 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3259
3260
firstCharKey = c - 'A' ;
3260
3261
} else {
3261
3262
// No match
3262
- /*
3263
- * If no match can be made, then this is a parse
3264
- * error.
3265
- */
3266
- errNoNamedCharacterMatch ();
3263
+ if (c == ';' ) {
3264
+ errNoNamedCharacterMatch ();
3265
+ }
3267
3266
emitOrAppendCharRefBuf (returnState );
3268
3267
if ((returnState & DATA_AND_RCDATA_MASK ) == 0 ) {
3269
3268
cstart = pos ;
@@ -3330,11 +3329,9 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3330
3329
}
3331
3330
}
3332
3331
if (hilo == 0 ) {
3333
- /*
3334
- * If no match can be made, then this is a parse
3335
- * error.
3336
- */
3337
- errNoNamedCharacterMatch ();
3332
+ if (c == ';' ) {
3333
+ errNoNamedCharacterMatch ();
3334
+ }
3338
3335
emitOrAppendCharRefBuf (returnState );
3339
3336
if ((returnState & DATA_AND_RCDATA_MASK ) == 0 ) {
3340
3337
cstart = pos ;
@@ -3423,10 +3420,9 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3423
3420
3424
3421
if (candidate == -1 ) {
3425
3422
// reconsume deals with CR, LF or nul
3426
- /*
3427
- * If no match can be made, then this is a parse error.
3428
- */
3429
- errNoNamedCharacterMatch ();
3423
+ if (c == ';' ) {
3424
+ errNoNamedCharacterMatch ();
3425
+ }
3430
3426
emitOrAppendCharRefBuf (returnState );
3431
3427
if ((returnState & DATA_AND_RCDATA_MASK ) == 0 ) {
3432
3428
cstart = pos ;
@@ -3470,7 +3466,9 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3470
3466
* after the U+0026 AMPERSAND (&) must be
3471
3467
* unconsumed, and nothing is returned.
3472
3468
*/
3473
- errNoNamedCharacterMatch ();
3469
+ if (c == ';' ) {
3470
+ errNoNamedCharacterMatch ();
3471
+ }
3474
3472
appendCharRefBufToStrBuf ();
3475
3473
reconsume = true ;
3476
3474
state = transition (state , returnState , reconsume , pos );
@@ -3536,6 +3534,7 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3536
3534
* I'm ∉ I tell you.
3537
3535
*/
3538
3536
}
3537
+ // XXX reorder point
3539
3538
case CONSUME_NCR :
3540
3539
if (++pos == endPos ) {
3541
3540
break stateloop ;
@@ -6637,7 +6636,6 @@ public void eof() throws SAXException {
6637
6636
state = returnState ;
6638
6637
continue ;
6639
6638
case CHARACTER_REFERENCE_HILO_LOOKUP :
6640
- errNoNamedCharacterMatch ();
6641
6639
emitOrAppendCharRefBuf (returnState );
6642
6640
state = returnState ;
6643
6641
continue ;
@@ -6691,10 +6689,6 @@ public void eof() throws SAXException {
6691
6689
}
6692
6690
6693
6691
if (candidate == -1 ) {
6694
- /*
6695
- * If no match can be made, then this is a parse error.
6696
- */
6697
- errNoNamedCharacterMatch ();
6698
6692
emitOrAppendCharRefBuf (returnState );
6699
6693
state = returnState ;
6700
6694
continue eofloop ;
@@ -6732,7 +6726,6 @@ public void eof() throws SAXException {
6732
6726
* after the U+0026 AMPERSAND (&) must be
6733
6727
* unconsumed, and nothing is returned.
6734
6728
*/
6735
- errNoNamedCharacterMatch ();
6736
6729
appendCharRefBufToStrBuf ();
6737
6730
state = returnState ;
6738
6731
continue eofloop ;
0 commit comments