if (tryRead ("version")) { String version; parseEq (); checkLegalVersion (version = readLiteral (flags));  if (version.equals ("1.1")){ if (xmlVersion == XML_10){ error ("external subset has later version number.", "1.0", version); } handler.warn ("expected XML version 1.0, not: " + version); xmlVersion = XML_11; }else if(!version.equals ("1.0")) { error("illegal XML version", version, "1.0 or 1.1"); } requireWhitespace (); }    require ("encoding"); parseEq (); encodingName = readLiteral (flags); if (!ignoreEncoding) setupDecoding (encodingName);  skipWhitespace (); require ("?>");  return encodingName; }
if (tryRead ("version")) { String version; parseEq(); checkLegalVersion(version = readLiteral(flags));  if (version.equals("1.1")) { if (xmlVersion == XML_10) { error("external subset has later version number.", "1.0", version); } handler.warn("expected XML version 1.0, not: " + version); xmlVersion = XML_11; } else if (!version.equals("1.0")) { error("illegal XML version", version, "1.0 or 1.1"); } requireWhitespace(); }   require("encoding"); parseEq(); encodingName = readLiteral(flags); if (!ignoreEncoding) { setupDecoding(encodingName); } skipWhitespace(); require("?>");  return encodingName; }
    private String parseTextDecl (boolean ignoreEncoding)    throws SAXException, IOException    {	String	encodingName = null;	int	flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF;	// Read an optional version.	if (tryRead ("version")) {	    String version;	    parseEq ();	    checkLegalVersion (version = readLiteral (flags));	    	    if (version.equals ("1.1")){	    	if (xmlVersion == XML_10){	    	   error ("external subset has later version number.", "1.0", version);    	    	}		handler.warn ("expected XML version 1.0, not: " + version);		xmlVersion = XML_11;             }else if(!version.equals ("1.0")) {		 error("illegal XML version", version, "1.0 or 1.1");	     }	    requireWhitespace ();	}	// Read the encoding.	require ("encoding");	parseEq ();	encodingName = readLiteral (flags);	if (!ignoreEncoding)	    setupDecoding (encodingName);	skipWhitespace ();	require ("?>");	return encodingName;    }