changeset 662:a12d347f8417 jdk9-b39

Merge
author lana
date Thu, 06 Nov 2014 15:13:32 -0800
parents 4ffb47fda7bb 0bb3cf8b2973
children fe179de493b1 583f3e6dfc48
files
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java	Thu Nov 06 10:11:37 2014 -0800
+++ b/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.