对于包在顶部元素中定义了显式xmlns命名空间的XML文档,我没有得到软件包XML(参数命名空间)所要求的XPath表达式和命名空间规范的正确组合。
下面是我的代码的结构
formslist.URL <- "http://sharepoint2/ops/quality/audit_program_management_site/_vti_bin/ListData.svc/Admin_Audit_Forms_List"
dat.formslist = xmlParse(getURL(formslist.URL, userpwd = 'SP_OpReporting:Essendant216!'))
items.formslist = getNodeSet(dat.formslist, "//m:properties")
df.formslist = xmlToDataFrame(items.formslist, stringsAsFactors = FALSE)
formsURL.vec = levels(factor(df.formslist$ProcessAuditForm))
URL.formname.index = regexpr(", ", formsURL.vec)
auditforms.list = substr(x = formsURL.vec, start = (2 + URL.formname.index), stop = nchar(formsURL.vec))
它返回以下错误
XPath错误:未定义的名称空间前缀 XPath错误:表达式无效 警告:xpathApply.XMLInternalDocument中的错误:计算xpath表达式时出错// m:properties
52:xpathApply.XMLInternalDocument
50:getNodeSet
xpathApply.XMLInternalDocument中的错误(doc,path,fun,...,名称空间=名称空间,:评估xpath表达式时出错// m:properties