Learn R Programming

restatapi (version 0.6.0)

extract_dsd: Extract values from XML

Description

Extracts the values from the XML Data Structure Definition (DSD) file

Usage

extract_dsd(concept = NULL, dsd_xml = NULL)

Arguments

concept

a character vector with concept ids

dsd_xml

an XML file with DSD content

Value

a matrix with 3 columns if the concepts has code list in the DSD file

Details

It is a sub-function to use in the get_eurostat_dsd function.

Examples

Run this code
# NOT RUN {
dsd_url<-"http://ec.europa.eu/eurostat/SDMX/diss-web/rest/datastructure/ESTAT/DSD_nama_10_a10_e"
tryCatch({
  dsd_xml<-xml2::read_xml(dsd_url)}, 
  error=function(e){
  message("Unable to download the xml file.\n",e)}, 
  warning=function(w){
  message("Unable to download the xml file.\n",w)}) 
if (exists("dsd_xml")) {extract_dsd("GEO",dsd_xml)} 

# }

Run the code above in your browser using DataLab