Merge
authorlana
Thu, 06 Nov 2014 15:13:32 -0800
changeset 27374 b2746ec1c520
parent 27372 4225051bf4c2 (current diff)
parent 27373 6f891fc6e7f0 (diff)
child 27375 ea77d518a793
Merge
--- 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.