# HG changeset patch # User lana # Date 1415315612 28800 # Node ID b2746ec1c520a4aff77877021af71fdfef74dd57 # Parent 4225051bf4c258c3ba02a442f1ceb735becbd172# Parent 6f891fc6e7f0128144339c13c1ff3654f3dc2e0c Merge diff -r 4225051bf4c2 -r b2746ec1c520 jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Thu Nov 06 10:11:37 2014 -0800 +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Thu Nov 06 15:13:32 2014 -0800 @@ -383,6 +383,8 @@ protected boolean foundBuiltInRefs = false; + /** Built-in reference character event */ + protected boolean builtInRefCharacterHandled = false; //skip element algorithm static final short MAX_DEPTH_LIMIT = 5 ; @@ -1949,7 +1951,10 @@ fDocumentHandler.startGeneralEntity(entity, null, null, null); } fTempString.setValues(fSingleChar, 0, 1); - //fDocumentHandler.characters(fTempString, null); + if(!fIsCoalesce){ + fDocumentHandler.characters(fTempString, null); + builtInRefCharacterHandled = true; + } if (fNotifyBuiltInRefs) { fDocumentHandler.endGeneralEntity(entity, null); @@ -3068,7 +3073,12 @@ //return CHARACTERS if(fScannerState == SCANNER_STATE_BUILT_IN_REFS && !fIsCoalesce){ setScannerState(SCANNER_STATE_CONTENT); - return XMLEvent.CHARACTERS; + if (builtInRefCharacterHandled) { + builtInRefCharacterHandled = false; + return XMLEvent.ENTITY_REFERENCE; + } else { + return XMLEvent.CHARACTERS; + } } //if there was a text declaration, call next() it will be taken care.