Skip to content

Commit

Permalink
#181 M1 propagate standard name in comments/validator
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 2, 2024
1 parent 510e906 commit 3747c02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/ISOAbstractObject.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ ISOAbstractObject <- R6Class("ISOAbstractObject",
xmlComments = function(isoCompliant = NA, inspireReport = NULL){
comments <- list()
geometa <- packageDescription("geometa")
title <- paste0("ISO 19139 XML generated by geometa R package - Version ", geometa$Version)
title <- paste0("ISO ",getMetadataStandard()," XML generated by geometa R package - Version ", geometa$Version)

isISOCompliant <- ifelse(is.na(isoCompliant),"NOT TESTED", ifelse(isoCompliant, "YES", "NO"))
ISOCompliance <- paste0("ISO 19139 XML compliance: ", isISOCompliant)
ISOCompliance <- paste0("ISO ",getMetadataStandard()," XML compliance: ", isISOCompliant)

isINSPIRECompliant <- ifelse(is.null(inspireReport), "NOT TESTED", ifelse(inspireReport$Status=="PASSED", "YES", "NO"))
INSPIRECompliance <- paste0("INSPIRE compliance: ", isINSPIRECompliant)
Expand Down Expand Up @@ -1020,7 +1020,7 @@ ISOAbstractObject <- R6Class("ISOAbstractObject",
suppressWarnings(xmlAttrs(out) <- rootXMLAttrs)
}

#validation vs. ISO 19139 XML schemas + eventually INSPIRE
#validation vs. ISO 19139/19115-3 XML schemas + eventually INSPIRE
compliant <- NA
if(validate){
compliant <- self$validate(xml = out, strict = strict, inspire = inspire, inspireValidator = inspireValidator)
Expand Down Expand Up @@ -1088,15 +1088,15 @@ ISOAbstractObject <- R6Class("ISOAbstractObject",
errorMsg <- paste0(substr(error$msg, 1, nchar(error$msg)-2), " at line ", error$line, ".")
self[[loggerType]](errorMsg)
}
msg <- sprintf("Object '%s' is INVALID according to ISO 19139 XML schemas!", self$getClassName())
msg <- sprintf("Object '%s' is INVALID according to ISO %s XML schemas!", self$getClassName(), getMetadataStandard())
if(strict){
self$ERROR(msg)
stop(msg)
}else{
self$WARN(msg)
}
}else{
self$INFO(sprintf("Object '%s' is VALID according to ISO 19139 XML schemas!", self$getClassName()))
self$INFO(sprintf("Object '%s' is VALID according to ISO %s XML schemas!", self$getClassName(), getMetadataStandard()))
}

if(inspire){
Expand Down

0 comments on commit 3747c02

Please sign in to comment.