@@ -745,13 +745,30 @@ public void setHtml4ModeCompatibleWithXhtml1Schemata(
745
745
// ]NOCPP]
746
746
747
747
// For the token handler to call
748
+
748
749
/**
749
750
* Sets the tokenizer state and the associated element name. This should
750
751
* only ever used to put the tokenizer into one of the states that have
751
752
* a special end tag expectation.
752
753
*
753
754
* @param specialTokenizerState
754
755
* the tokenizer state to set
756
+ */
757
+ public void setState (int specialTokenizerState ) {
758
+ this .stateSave = specialTokenizerState ;
759
+ this .endTagExpectation = null ;
760
+ this .endTagExpectationAsArray = null ;
761
+ }
762
+
763
+ // [NOCPP[
764
+
765
+ /**
766
+ * Sets the tokenizer state and the associated element name. This should
767
+ * only ever used to put the tokenizer into one of the states that have
768
+ * a special end tag expectation. For use from the tokenizer test harness.
769
+ *
770
+ * @param specialTokenizerState
771
+ * the tokenizer state to set
755
772
* @param endTagExpectation
756
773
* the expected end tag for transitioning back to normal
757
774
*/
@@ -768,6 +785,8 @@ public void setStateAndEndTagExpectation(int specialTokenizerState,
768
785
endTagExpectationToArray ();
769
786
}
770
787
788
+ // ]NOCPP]
789
+
771
790
/**
772
791
* Sets the tokenizer state and the associated element name. This should
773
792
* only ever used to put the tokenizer into one of the states that have
@@ -3858,11 +3877,17 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
3858
3877
c = checkChar (buf , pos );
3859
3878
/*
3860
3879
* ASSERT! when entering this state, set index to 0 and
3861
- * call clearStrBufBeforeUse() assert (contentModelElement !=
3862
- * null); Let's implement the above without lookahead.
3863
- * strBuf is the 'temporary buffer'.
3880
+ * call clearStrBufBeforeUse(); Let's implement the above
3881
+ * without lookahead. strBuf is the 'temporary buffer'.
3864
3882
*/
3865
- if (index < endTagExpectationAsArray .length ) {
3883
+ if (endTagExpectationAsArray == null ) {
3884
+ tokenHandler .characters (Tokenizer .LT_SOLIDUS ,
3885
+ 0 , 2 );
3886
+ cstart = pos ;
3887
+ reconsume = true ;
3888
+ state = transition (state , returnState , reconsume , pos );
3889
+ continue stateloop ;
3890
+ } else if (index < endTagExpectationAsArray .length ) {
3866
3891
char e = endTagExpectationAsArray [index ];
3867
3892
char folded = c ;
3868
3893
if (c >= 'A' && c <= 'Z' ) {
0 commit comments