Skip to content

Commit

Permalink
#5319 - Only do gbxmlValidator is the version is 7.03, or omitted=ass…
Browse files Browse the repository at this point in the history
…umed to be 7.03
  • Loading branch information
jmarrec committed Dec 18, 2024
1 parent 1f4c24e commit 5059797
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/gbxml/ReverseTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 5059797

Please sign in to comment.