void (SAXParseException exception) { RngSchemaValidator.handleError(exception, myFile, myDocument, new RngSchemaValidator.ValidationMessageConsumer() { @Override public void onMessage(@NotNull PsiElement context, @NotNull String message) { myHost.addMessage(context, message, Validator.ValidationHost.ErrorType.ERROR); } }); }