From 46344c91f8d89f50f996cbb2b786ead611deaadd Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 18 Dec 2024 13:40:06 +0100 Subject: [PATCH] #5319 - Only do gbxmlValidator is the version is 7.03, or omitted=assumed to be 7.03 --- src/gbxml/ReverseTranslator.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gbxml/ReverseTranslator.cpp b/src/gbxml/ReverseTranslator.cpp index 7f1ab04ad0..c544495b69 100644 --- a/src/gbxml/ReverseTranslator.cpp +++ b/src/gbxml/ReverseTranslator.cpp @@ -100,12 +100,17 @@ namespace gbxml { if (version.empty()) { LOG(Warn, "gbXML has no `version` attribute for the schema version, assuming 7.03."); version = "7.03"; - } else if (version != "7.03") { - LOG(Error, "Version of schema specified: " << version << ", expected 7.03. Validation will still assume 7.03, expect errors."); } - // validate the gbxml prior to reverse translation - auto gbxmlValidator = XMLValidator::gbxmlValidator(); - gbxmlValidator.validate(path); + if (version == "7.03") { + // validate the gbxml prior to reverse translation + auto gbxmlValidator = XMLValidator::gbxmlValidator(); + gbxmlValidator.validate(path); + } else { + LOG(Error, + "Version of schema specified: " << version + << ", expected 7.03. gbXML Schema Validation skipped. Note that ReverseTranslator rules are built " + "for 7.03 and older versions are not officially supported, check resulting model with care."); + }; result = this->convert(root); }