Allow extensions in checkFixedValue if a pattern instead of a fixedValue is defined on the element

This commit is contained in:
Alexander Zautke 2021-05-20 17:23:34 +02:00
parent 5648f7a925
commit 22af0cba90
1 changed files with 1 additions and 1 deletions

View File

@ -1843,7 +1843,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
List<Element> extensions = new ArrayList<Element>(); List<Element> extensions = new ArrayList<Element>();
focus.getNamedChildren("extension", extensions); focus.getNamedChildren("extension", extensions);
if (fixed.getExtension().size() == 0) { if (fixed.getExtension().size() == 0) {
rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, extensions.size() == 0, I18nConstants.EXTENSION_EXT_FIXED_BANNED); rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, extensions.size() == 0 || pattern == true, I18nConstants.EXTENSION_EXT_FIXED_BANNED);
} else if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, extensions.size() == fixed.getExtension().size(), I18nConstants.EXTENSION_EXT_COUNT_MISMATCH, Integer.toString(fixed.getExtension().size()), Integer.toString(extensions.size()))) { } else if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, extensions.size() == fixed.getExtension().size(), I18nConstants.EXTENSION_EXT_COUNT_MISMATCH, Integer.toString(fixed.getExtension().size()), Integer.toString(extensions.size()))) {
for (Extension e : fixed.getExtension()) { for (Extension e : fixed.getExtension()) {
Element ex = getExtensionByUrl(extensions, e.getUrl()); Element ex = getExtensionByUrl(extensions, e.getUrl());