Class Scorm2004SchemaValidator
java.lang.Object
dev.jcputney.elearning.parser.input.common.serialization.Scorm2004SchemaValidator
Utility for validating SCORM 2004 imsmanifest.xml against local XSDs.
Validation is optional and disabled by default. Enable it by setting the system property
elearning.parser.scorm2004.validateXsd=true or the environment variable
ELEARNING_SCORM2004_VALIDATE_XSD=true.
-
Method Summary
-
Method Details
-
isEnabled
public static boolean isEnabled()Determines whether validation is enabled based on system properties or environment variables.The method first checks the system property corresponding to
VALIDATE_SYSPROP. If a value is found, it converts it to a boolean and returns the result. If the system property is not set, it then checks the environment variable corresponding toVALIDATE_ENVand converts it to a boolean.- Returns:
trueif validation is enabled based on the corresponding system property or environment variable; otherwisefalse.
-
validate
Validates the provided manifest XML bytes against local SCORM 2004 XSDs.- Parameters:
manifestXml- The XML document bytes- Throws:
SAXException- when validation fails with detailsIOException- when reading schema resources fails
-