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

0b5ca6
      *