xml - Error importing SDMX data into R -
the problem happens when trying import oecd data. example, if try following code:
library(rsdmx) data.url <- "http://stats.oecd.org/restsdmx/sdmx.ashx/getdata/qna/aus.b1_ge+p3+p31s14_s15+p3s13+p5+p51+p52_p53+p52+p53+b11+p6+p61+p62+p7+p71+p72+rb1_ge+pppgdp+p41+p3_p51+p3_p5.cqrsa.q/all?starttime=2011-q1&endtime=2015-q2" my.sdmx <- readsdmx(data.url)
i following error
<xmlinputerror: xml content not seem xml: '<message:messagegroup xmlns="http://www.sdmx.org/resources/sdmxml/schemas/v2_0/generic" ...
however, seems happen oecd data. if replace data.url
above with
data.url <- "http://data.fao.org/sdmx/repository/data/crop_production/.156.5312../fao?startperiod=2008&endperiod=2008"
then code runs smoothly. works if download xml file , parse using readsdmx('file.xml', isurl=false)
.
i wonder if has '' characters show when parsing oecd xml, , if there way fix this.
there has been recent changes in oecd portal. 1 of them web requests did not return valid xml
response. few characters mentioned correspond bytes order mark (bom). control has been added in rsdmx manage such bom, change has been reflected in cran. upgrading rsdmx 0.4-7 solve issue.
Comments
Post a Comment