c71c45
--- src/org/apache/xerces/impl/XMLScanner.java	2013/07/03 18:25:06	1499505
c71c45
+++ src/org/apache/xerces/impl/XMLScanner.java	2013/07/03 18:29:43	1499506
c71c45
@@ -542,7 +542,7 @@
c71c45
         // document is until we scan the encoding declaration
c71c45
         // you cannot reliably read any characters outside
c71c45
         // of the ASCII range here. -- mrglavas
c71c45
-        String name = fEntityScanner.scanName();
c71c45
+        String name = scanPseudoAttributeName();
c71c45
         XMLEntityManager.print(fEntityManager.getCurrentEntity());
c71c45
         if (name == null) {
c71c45
             reportFatalError("PseudoAttrNameExpected", null);
c71c45
@@ -599,6 +599,35 @@
c71c45
     } // scanPseudoAttribute(XMLString):String
c71c45
     
c71c45
     /**
c71c45
+     * Scans the name of a pseudo attribute. The only legal names
c71c45
+     * in XML 1.0/1.1 documents are 'version', 'encoding' and 'standalone'.
c71c45
+     * 
c71c45
+     * @return the name of the pseudo attribute or null
c71c45
+     * if a legal pseudo attribute name could not be scanned.
c71c45
+     */
c71c45
+    private String scanPseudoAttributeName() throws IOException, XNIException {
c71c45
+        final int ch = fEntityScanner.peekChar();
c71c45
+        switch (ch) {
c71c45
+            case 'v':
c71c45
+                if (fEntityScanner.skipString(fVersionSymbol)) {
c71c45
+                    return fVersionSymbol;
c71c45
+                }
c71c45
+                break;
c71c45
+            case 'e':
c71c45
+                if (fEntityScanner.skipString(fEncodingSymbol)) {
c71c45
+                    return fEncodingSymbol;
c71c45
+                }
c71c45
+                break;
c71c45
+            case 's':
c71c45
+                if (fEntityScanner.skipString(fStandaloneSymbol)) {
c71c45
+                    return fStandaloneSymbol;
c71c45
+                }
c71c45
+                break;
c71c45
+        }
c71c45
+        return null;
c71c45
+    } // scanPseudoAttributeName()
c71c45
+    
c71c45
+    /**
c71c45
      * Scans a processing instruction.
c71c45
      * 

c71c45
      *