diff --git a/java/org/slub/rosetta/dps/repository/plugin/Validation/ValidateSchema.java b/java/org/slub/rosetta/dps/repository/plugin/Validation/ValidateSchema.java index d304183330bdc4cf9f17627d9a177df109b4142e..5460787eb5e2c285ddbdfe255e3483e504575451 100644 --- a/java/org/slub/rosetta/dps/repository/plugin/Validation/ValidateSchema.java +++ b/java/org/slub/rosetta/dps/repository/plugin/Validation/ValidateSchema.java @@ -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;