protected boolean rncContentType(String type, InputSource is)
            throws SAXException {
        boolean typeOk = "application/relax-ng-compact-syntax".equals(type);
        if (!typeOk) {
            typeOk = "application/vnd.relax-ng.rnc".equals(type);
            if (typeOk && errorHandler != null) {
                errorHandler.warning(new SAXParseException(
                        "application/vnd.relax-ng.rnc is an unregistered type. application/relax-ng-compact-syntax is the registered type.",
                        is.getPublicId(), is.getSystemId(), -1, -1));
            }
        }
        if (!typeOk) {
            typeOk = "application/octet-stream".equals(type)
                    && is.getSystemId().endsWith(".rnc");
        }
        if (!typeOk && laxContentType) {
            boolean laxOk = "text/plain".equals(type)
                    && is.getSystemId().endsWith(".rnc");
            if (laxOk && errorHandler != null) {
                errorHandler.warning(new SAXParseException(
                        "Being lax about non-RNC Content-Type: " + type,
                        is.getPublicId(), is.getSystemId(), -1, -1));
            }
            return laxOk;
        } else if (!typeOk && !laxContentType && errorHandler != null) {
            String msg = "Non-RNC Content-Type: \u201C" + type + "\u201D."
                    + " (application/relax-ng-compact-syntax"
                    + " is the registered type.)";
            SAXParseException spe = new SAXParseException(msg,
                    is.getPublicId(), is.getSystemId(), -1, -1,
                    new SystemIdIOException(is.getSystemId(), msg));
            if (errorHandler != null) {
                errorHandler.fatalError(spe);
            }
            throw spe;
        } else {
            return typeOk;
        }
    }
@param errorHandler
@param laxContentType
@param allowRnc
@param allowHtml
@param allowXhtml
@param acceptAllKnownXmlTypes
@param allowGenericXml
src/nu/validator/xml/ContentTypeParser.java