void parseXMPDecl(boolean ignoreEncoding) throws java.lang.Exception
    {
        String version;
        String encodingName = null;
        String standalone = null;

        // Read the version.
        require("version");
        parseEq();
        version = readLiteral(0);
        if (!version.equals("1.0")) {
            error("unsupported XML version", version, "1.0");
        }

        // Try reading an encoding declaration.
        skipWhitespace();
        if (tryRead("encoding")) {
            parseEq();
            encodingName = readLiteral(0);
            checkEncoding(encodingName, ignoreEncoding);
        }

        // Try reading a standalone declaration
        skipWhitespace();
        if (tryRead("standalone")) {
            parseEq();
            standalone = readLiteral(0);
        }

        skipWhitespace();
        require("?>");
    }