private static void validateSleighFile(ResourceFile relaxSchemaFile,
			ResourceFile fileToValidate, String type) throws SleighException {

		FileResolutionResult result = FileUtilities.existsAndIsCaseDependent(fileToValidate);
		if (!result.isOk()) {
			throw new SleighException(
				fileToValidate + " is not properly case dependent: " + result.getMessage());
		}

		Verifier verifier = null;
		try {
			verifier = getVerifier(relaxSchemaFile);
		}
		catch (Exception e) {
			throw new SleighException("Error creating verifier", e);
		}
		try (InputStream in = fileToValidate.getInputStream()) {
			verifier.setErrorHandler(new VerifierErrorHandler(fileToValidate));
			verifier.verify(new InputSource(in));
		}
		catch (Exception e) {
			throw new SleighException(
				"Invalid " + type + " file: " + fileToValidate.getAbsolutePath(), e);
		}
	}
Verify an XML document as a string against this validator.
Currently this only supports verifierType == CSPECTAG_TYPE.
@param title is a description of the document
@param document is the XML document body
@throws SleighException with an explanation if the document does not validate
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguageValidator.java