Downloads an XML notice of a given type associated with a Cellar resource.
A valid url as character vector of length one based on a resource identifier such as CELEX or Cellar URI.
A character string with the name where the downloaded file is saved.
The type of notice requested controls what kind of metadata are returned.
The priority language in which the data will be attempted to be retrieved, in ISO 639 2-char code
If data not available in language_1
, try language_2
If data not available in language_2
, try language_3
A character string specifying the mode with which to write the file. Useful values are "w", "wb" (binary), "a" (append) and "ab".
Path of downloaded file (invisibly) if server validates request (http status code has to be 200). For more information about notices, see Cellar documentation.
To retrieve all identifiers associated with a url, use elx_fetch_data(type = "ids").
# \donttest{
temploc <- paste(tempdir(), "elxnotice.xml", sep = "\\")
elx_download_xml(url = "http://publications.europa.eu/resource/celex/32022D0154",
file = temploc, notice = "object")
#> Could not resolve host: publications.europa.eu (Error)
#> Error in utils::download.file(url = head$url, destfile = file, mode = mode): 'url' must be a length-one character vector
unlink(temploc)
# }