Error: XML Content does not seem to be XML | R 3.1.0 Error: XML Content does not seem to be XML | R 3.1.0 xml xml

Error: XML Content does not seem to be XML | R 3.1.0


Remove the s from https

library(XML)fileURL<-"https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Frestaurants.xml"doc <- xmlTreeParse(sub("s", "", fileURL), useInternal = TRUE)class(doc)## [1] "XMLInternalDocument" "XMLAbstractDocument"


You can use RCurl to fetch the content and then XML seems to be able to handle it

library(XML)library(RCurl)fileURL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Frestaurants.xml"xData <- getURL(fileURL)doc <- xmlParse(xData)


xmlTreeParse does not support https.

You can load the data with getURL (from RCurl) and then parse it.