Skip to content
Snippets Groups Projects
Commit b0057f25 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- fixed assertion for nonvalidating

parent ebaeeb42
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,10 @@ public class ValidateSchema {
this.validationResult = false;
throw new SAXException("RECURSIVE SCHEMA VALIDATOR: No entry for child namespace found: " + child_ns);
} else {
assert (res.get().schemaType == ValidationSchemaType.schema);
assert (
res.get().schemaType == ValidationSchemaType.schema
|| res.get().schemaType == ValidationSchemaType.nonvalidating
);
var schema = res.get();
internValidateFormatAgainstSchemaRecursively(childNodes.item(i), schema);
}
......@@ -74,7 +77,10 @@ public class ValidateSchema {
private boolean internValidateFormatAgainstSchemaRecursively(Node root, ValidationSchema validationSchema) throws IOException, SAXException {
var schemaType = validationSchema.schemaType;
if (schemaType == ValidationSchemaType.schema) {
if (schemaType == ValidationSchemaType.nonvalidating) {
validationResult = true;
logger.debug("RECURSIVE SCHEMA VALIDATOR: nonvalidating namespace found, results in " + validationResult);
} else if (schemaType == ValidationSchemaType.schema) {
ValidateSchema validator = new ValidateSchema( validationResourceResolver, logger );
// Select validation roots from DOM
validationResult = validator.validateAgainst(root, validationSchema.schemaURI);
......@@ -82,8 +88,7 @@ public class ValidateSchema {
if (validationResult) {
check_ns_of_childs(root);
}
}
else {
} else {
throw new SAXException("RECURSIVE SCHEMA VALIDATOR: unsupported schema uri="+ validationSchema.schemaURI + " of type: " + validationSchema.schemaType);
}
return validationResult;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment