I have a simple download from SEC’s EDAGR and parse the XLM file, but something does not work.
library(xml2)
library(XML)
download.file("https://www.sec.gov/Archives/edgar/data/1026144/000175272424054979/primary_doc.xml", destfile = "ncen.txt")
ncen.data <- read_xml("ncen.txt")
ncen.xml <- xmlParse(ncen.data)
Since I would like to have all data in ncen.txt
in a data frame, I then use
xml.df <- xmlToDataFrame(nodes = getNodeSet(ncen.xml, "//edgarSubmission"))
but that results in an empty data frame.
ncen.txt
seems to be an proper xml file.
Any thoughts on this?