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

93b49b
      *