Learn R Programming

restatapi (version 0.6.0)

extract_toc: Extract values from XML

Description

Extracts the values of a node from the Eurostat XML Table of contents (TOC) file

Usage

extract_toc(ns)

Arguments

ns

An XML node set from the XML TOC file

Value

a character vector with all the values of the node set.

Details

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

Examples

Run this code
# NOT RUN {
cfg<-get("cfg",envir=.restatapi_env) 
rav<-get("rav",envir=.restatapi_env)
toc_endpoint<-eval(parse(text=paste0("cfg$TOC_ENDPOINT$'",rav,"'$ESTAT$xml")))
# }
# NOT RUN {
xml_leafs<-xml2::xml_find_all(xml2::read_xml(toc_endpoint),".//nt:leaf")
extract_toc(xml_leafs[1])
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab