getxml: General function to read xml files in with error catching,...

Description Usage Arguments Details Examples

View source: R/internal.r

Description

General function to read xml files in with error catching, plus xpath parsing.

Usage

1
  getxml(dir, xpath)

Arguments

x

Complete directory to .xml file, including file name.

xpath

A string (character vector of length 1) giving the XPath expression to evaluate.

Details

Included reading xml file and xpath parsing so that whole xml files don't have to be read in, but only the text parsed on into RAM. Typically this function will only be called internally by other fxns.

Examples

1
2
url <- "http://www.plosone.org/article/fetchObjectAttachment.action?uri=info%3Adoi%2F10.1371%2Fjournal.pone.0040348&representation=XML"
getxml(url, "//publisher-name")

ropensci/rhindawi documentation built on May 16, 2018, 7:04 a.m.