jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
changeset 27373 6f891fc6e7f0
parent 27112 4bc3e4a993c7
child 29765 d0707eacc322
equal deleted inserted replaced
27325:948cceef81ba 27373:6f891fc6e7f0
   381 
   381 
   382     protected boolean fAddDefaultAttr = false;
   382     protected boolean fAddDefaultAttr = false;
   383 
   383 
   384     protected boolean foundBuiltInRefs = false;
   384     protected boolean foundBuiltInRefs = false;
   385 
   385 
       
   386     /** Built-in reference character event */
       
   387     protected boolean builtInRefCharacterHandled = false;
   386 
   388 
   387     //skip element algorithm
   389     //skip element algorithm
   388     static final short MAX_DEPTH_LIMIT = 5 ;
   390     static final short MAX_DEPTH_LIMIT = 5 ;
   389     static final short ELEMENT_ARRAY_LENGTH = 200 ;
   391     static final short ELEMENT_ARRAY_LENGTH = 200 ;
   390     static final short MAX_POINTER_AT_A_DEPTH = 4 ;
   392     static final short MAX_POINTER_AT_A_DEPTH = 4 ;
  1947             fSingleChar[0] = c;
  1949             fSingleChar[0] = c;
  1948             if (fNotifyBuiltInRefs) {
  1950             if (fNotifyBuiltInRefs) {
  1949                 fDocumentHandler.startGeneralEntity(entity, null, null, null);
  1951                 fDocumentHandler.startGeneralEntity(entity, null, null, null);
  1950             }
  1952             }
  1951             fTempString.setValues(fSingleChar, 0, 1);
  1953             fTempString.setValues(fSingleChar, 0, 1);
  1952             //fDocumentHandler.characters(fTempString, null);
  1954             if(!fIsCoalesce){
       
  1955                 fDocumentHandler.characters(fTempString, null);
       
  1956                 builtInRefCharacterHandled = true;
       
  1957             }
  1953 
  1958 
  1954             if (fNotifyBuiltInRefs) {
  1959             if (fNotifyBuiltInRefs) {
  1955                 fDocumentHandler.endGeneralEntity(entity, null);
  1960                 fDocumentHandler.endGeneralEntity(entity, null);
  1956             }
  1961             }
  1957         }
  1962         }
  3066                             scanEntityReference(fContentBuffer);
  3071                             scanEntityReference(fContentBuffer);
  3067                             //if there was built-in entity reference & coalesce is not true
  3072                             //if there was built-in entity reference & coalesce is not true
  3068                             //return CHARACTERS
  3073                             //return CHARACTERS
  3069                             if(fScannerState == SCANNER_STATE_BUILT_IN_REFS && !fIsCoalesce){
  3074                             if(fScannerState == SCANNER_STATE_BUILT_IN_REFS && !fIsCoalesce){
  3070                                 setScannerState(SCANNER_STATE_CONTENT);
  3075                                 setScannerState(SCANNER_STATE_CONTENT);
  3071                                 return XMLEvent.CHARACTERS;
  3076                                 if (builtInRefCharacterHandled) {
       
  3077                                     builtInRefCharacterHandled = false;
       
  3078                                     return XMLEvent.ENTITY_REFERENCE;
       
  3079                                 } else {
       
  3080                                     return XMLEvent.CHARACTERS;
       
  3081                                 }
  3072                             }
  3082                             }
  3073 
  3083 
  3074                             //if there was a text declaration, call next() it will be taken care.
  3084                             //if there was a text declaration, call next() it will be taken care.
  3075                             if(fScannerState == SCANNER_STATE_TEXT_DECL){
  3085                             if(fScannerState == SCANNER_STATE_TEXT_DECL){
  3076                                 fLastSectionWasEntityReference = true ;
  3086                                 fLastSectionWasEntityReference = true ;