changeset 321:7a8825b15df6 icedtea-2.1.1

7157609: Issues with loop Reviewed-by: hawtin, lancea
author joehw
date Fri, 06 Apr 2012 09:32:57 -0700
parents 1cf75c0e2c96
children a812eed5797d
files sources/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sources/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Wed Feb 15 08:26:36 2012 +0000
+++ b/sources/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Fri Apr 06 09:32:57 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);