When would I want to use the xmlParse function versus the xmlTreeParse function? Also, when are parameter values useInternalNodes=TRUE or asText=TRUE useful?
For example:
library("XML")
nct_url <- "http://clinicaltrials.gov/ct2/show/NCT00112281?resultsxml=true"
xml_doc <- xmlParse(nct_url, useInternalNodes=TRUE)
vs.
doc <- xmlTreeParse(getURL(nct_url), useInternalNodes=TRUE)
top <- xmlRoot(doc)
top[["keyword"]]
xmlValue(top[["start_date"]])
xmlValue(top[["location"]])
People seem to use the xmlTreeParse function for getting a non-repeating node via the $doc$children$... traversal. But I am not sure I understand when each approach is best. Parsing XML is one of the reasons to almost abandon R and learn Python. Lack of for-dummies examples without being forced to buy a book.