When a SystemMetadata object is initialized from a parsed sysmeta XML document, if that
document doesn't contain a element, then the following error is produced
as shown in the following example:
> library(datapack)
> library(httr)
> library(XML)
> response <- GET("https://gmn.lternet.edu/mn/v1/meta/doi:10.6073%2FAA%2Fknb-lter-hfr.145.3")
> xml <- xmlParse(content(response, as="text"))
No encoding supplied: defaulting to UTF-8.
> sysmeta <- SystemMetadata(xmlRoot(xml))
Error in UseMethod("xmlAttrs", node) :
no applicable method for 'xmlAttrs' applied to an object of class "NULL"
10 xmlAttrs(xml[["replicationPolicy"]]) at SystemMetadata.R#260
9 .local(x, ...)
8 parseSystemMetadata(sm_obj, x) at SystemMetadata.R#202
7 parseSystemMetadata(sm_obj, x) at SystemMetadata.R#183
6 .local(...)
5 .Method(...)
4 eval(expr, envir, enclos)
3 eval(.dotsCall, env)
2 standardGeneric("SystemMetadata") at SystemMetadata.R#169
1 SystemMetadata(xmlRoot(xml))
>
When a SystemMetadata object is initialized from a parsed sysmeta XML document, if that document doesn't contain a element, then the following error is produced
as shown in the following example: