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

8f92653
      *