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

752797c
      *