问题描述
我正在尝试使用R XBRL
软件包读取此xbrl
文件...
I'm trying to read this xbrl
file with R XBRL
package...
...但是当我下载文件并运行代码
...but when I download the file and run the code
xbrl.vars <- xbrlDoAll(inst, verbose=TRUE)
我收到此错误:
我认为该错误是.xsd
文件的ULR问题.是否可以在本地目录中下载xsd
文件并使用它们读取.XBRL
文件?怎么做到呢?
I suppose that the error is a problem with the ULR of the .xsd
file. Is it possible to download the xsd
files in a local directory and use them to read the .XBRL
file? How can it be done?
推荐答案
您可以从 https://www.xbrl.es/informacion/ipp.html .尝试使用这些文件解析xbrl文件后,仍然出现错误,因为仍然需要其他一些文件.下载这些文件后,它似乎会解析并带有警告!我不知道是否有一种更标准的方法来获取这些额外的文件,而不是一个一个地获取.
You can download a zip of the schemas from https://www.xbrl.es/informacion/ipp.html. After trying to parse the xbrl file using these, still got errors as there were still a few other files that were required. After downloading these, it does seem to parse, with warnings! I don't know if there is a more standard way to get these extra files, rather than one by one.
下载内容
# directory for files
dir.create("SOtemp")
# schemas
download.file("http://www.cnmv.es/IPP/taxonomia/2005-06-30/ipp_2005-06-30_v1.22.zip", "SOtemp/scheme.zip")
unzip("SOtemp/scheme.zip", exdir="SOtemp/")
# file
pth = "https://www.cnmv.es/Portal/Consultas/wuc/DescargaXBRLIPP.ashx?t=%7B77853e69-5deb-4bd5-acd4-3fb4715e2664%7D"
download.file(pth, destfile="SOtemp/2005-06-30/testSO.xml")
# extra stuffs that needed downloaded -- from R error messages
morePths <-c("https://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd",
"https://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd",
"www.xbrl.org/2003/xl-2003-12-31.xsd",
"https://docs.oasis-open.org/emergency/edxl-have/cs01/xlink-2003-12-31.xsd")
mapply(download.file, morePths, destfile=file.path("SOtemp", "2005-06-30", basename(morePths)))
现在解析
library(XBRL)
out <- xbrlDoAll("SOtemp/2005-06-30/testSO.xml", cache.dir="naughtyCache/", prefix.out=NULL, verbose=TRUE)
这篇关于XBRL包"fileFromCache(file)中的错误"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!