diff --git a/inst/metadata/entity/entity_handler_ncdf.R b/inst/metadata/entity/entity_handler_ncdf.R index 1701535..f5a9d54 100644 --- a/inst/metadata/entity/entity_handler_ncdf.R +++ b/inst/metadata/entity/entity_handler_ncdf.R @@ -5,6 +5,9 @@ handle_entities_ncdf <- function(handler, source, config, handle = TRUE){ if(!requireNamespace("ncdf4", quietly = TRUE)){ stop("The NCDF handler requires the 'ncdf4' package") } + if(!requireNamespace("XML", quietly = TRUE)){ + stop("The NCDF handler requires the 'XML' package") + } #if(!mime::guess_type(source)=="application/x-netcdf"){ # errMsg <- "Error in 'handle_entities_df': source parameter should be an 'netcdf' file" diff --git a/inst/metadata/entity/entity_handler_ncml.R b/inst/metadata/entity/entity_handler_ncml.R index 9f989fa..5fcbf00 100644 --- a/inst/metadata/entity/entity_handler_ncml.R +++ b/inst/metadata/entity/entity_handler_ncml.R @@ -3,6 +3,10 @@ handle_entities_ncml <- function(handler, source, config, handle = TRUE){ config$logger.info("NCML Handle") + if(!requireNamespace("XML", quietly = TRUE)){ + stop("The NCML handler requires the 'XML' package") + } + getNCML <- function(file){ xml <- XML::xmlParse(httr::content(httr::GET(file),"text")) diff --git a/inst/metadata/entity/entity_handler_thredds.R b/inst/metadata/entity/entity_handler_thredds.R index 31a508f..ac03707 100644 --- a/inst/metadata/entity/entity_handler_thredds.R +++ b/inst/metadata/entity/entity_handler_thredds.R @@ -5,7 +5,10 @@ handle_entities_thredds <- function(handler, source, config){ stop("The Thredds handler requires the 'thredds' package") } if(!requireNamespace("ncdf4", quietly = TRUE)){ - stop("The NCDF handler requires the 'ncdf4' package") + stop("The Thredds handler requires the 'ncdf4' package") + } + if(!requireNamespace("XML", quietly = TRUE)){ + stop("The Thredds handler requires the 'XML' package") } thredds <- config$software$input$thredds