# HG changeset patch # User lana # Date 1340731671 25200 # Node ID a21c904ee700811c6b79de44c93f964c0d38a7b0 # Parent 7eae1fc045c9d2d725daf10f496a6e7dea2e14d1# Parent 37e5902c39850fbf6f4ce8a875bbb88a42712006 Merge diff -r 7eae1fc045c9 -r a21c904ee700 jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java Mon Jun 25 21:37:34 2012 -0700 +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java Tue Jun 26 10:27:51 2012 -0700 @@ -402,6 +402,16 @@ boolean dataFoundForTarget = false; boolean sawSpace = fEntityScanner.skipSpaces(); + // since pseudoattributes are *not* attributes, + // their quotes don't need to be preserved in external parameter entities. + // the XMLEntityScanner#scanLiteral method will continue to + // emit -1 in such cases when it finds a quote; this is + // fine for other methods that parse scanned entities, + // but not for the scanning of pseudoattributes. So, + // temporarily, we must mark the current entity as not being "literal" + Entity.ScannedEntity currEnt = fEntityManager.getCurrentEntity(); + boolean currLiteral = currEnt.literal; + currEnt.literal = false; while (fEntityScanner.peekChar() != '?') { dataFoundForTarget = true; String name = scanPseudoAttribute(scanningTextDecl, fString); @@ -499,6 +509,9 @@ } sawSpace = fEntityScanner.skipSpaces(); } + // restore original literal value + if(currLiteral) + currEnt.literal = true; // REVISIT: should we remove this error reporting? if (scanningTextDecl && state != STATE_DONE) { reportFatalError("MorePseudoAttributes", null);