public DocInfo testExtensionDocument(String document)
			throws SleighException, SAXException, XmlParseException {
		DocInfo res = new DocInfo(document);
		if (cspecValidator == null) {
			cspecValidator = new SleighLanguageValidator(SleighLanguageValidator.CSPECTAG_TYPE);
		}
		cspecValidator.verify(res.optionName, document);
		checkExtension(res);
		if (!(program.getCompilerSpec() instanceof BasicCompilerSpec)) {
			throw new SleighException(
				"Can only test specification extensions against SLEIGH program");
		}
		BasicCompilerSpec cSpecCopy =
			new BasicCompilerSpec((BasicCompilerSpec) program.getCompilerSpec());
		parseExtension(res.optionName, document, cSpecCopy, false);
		return res;
	}
Test if the given XML document describes a suitable spec extension.
The document must fully parse and validate and must not conflict with the existing spec;
otherwise an exception is thrown. If all tests pass, an object describing basic properties
of the document is returned.
@param document is the given XML document
@return info about the document
@throws SleighException if validity checks fail
@throws XmlParseException if the XML is badly formed
@throws SAXException if there are parse errors
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/SpecExtension.java