[R-SIG-Mac] Failure message in R on Mac with xmlTreeParse

Armin Goralczyk agoralczyk at gmail.com
Wed Dec 19 11:01:56 CET 2007


Hello

In the following thread (R-help) the possibilities of analyzing
publications from pubmed via XML were discussed:

http://www.nabble.com/Analyzing-Publications-from-Pubmed-via-XML-to14328779.html#a14343090

Using xmlTreeParse in a function results in a failure message on my
Mac which is not reproduced in R for Windows:

> esearch <- function (term){
+ 	srch.stem <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?"
+ 	srch.mode <- "db=pubmed&retmax=10000&retmode=xml&term="
+ 	doc <-xmlTreeParse(paste(srch.stem,srch.mode,term,sep=""),isURL = TRUE,
+ 		useInternalNodes = TRUE)
+ 	sapply(c("//Id"), xpathApply, doc = doc, fun = xmlValue)
+ 	}
>
> term <- 'meyer'
> pmid <- esearch(term) # works fine
>
> term <- 'meyer[au]'
> pmid <- esearch(term)
Fehler in .Call("RS_XML_ParseTree", as.character(file), handlers,
as.logical(ignoreBlanks),  :
  error in creating parser for
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&retmax=10000&retmode=xml&term=meyer[au]
>
I/O warning : failed to load external entity
"http%3A//eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi%3Fdb=pubmed&retmax=10000&retmode=xml&term=meyer%5Bau%5D"
>

The problem seems to be the search tag [au].
I am not very familiar with XML or the xmlTreeParse function, so I
don't know what is wrong. Can anybody help?

Thanks

My version:
> R.Version()
$platform
[1] "powerpc-apple-darwin8.10.1"

$arch
[1] "powerpc"

$os
[1] "darwin8.10.1"

$system
[1] "powerpc, darwin8.10.1"

$status
[1] "Patched"

$major
[1] "2"

$minor
[1] "6.0"

$year
[1] "2007"

$month
[1] "11"

$day
[1] "09"

$`svn rev`
[1] "43408"

$language
[1] "R"

$version.string
[1] "R version 2.6.0 Patched (2007-11-09 r43408)"

-- 
Armin Goralczyk, M.D.
--
Universitätsmedizin Göttingen
Abteilung Allgemein- und Viszeralchirurgie
Rudolf-Koch-Str. 40
39099 Göttingen
--
Dept. of General Surgery
University of Göttingen
Göttingen, Germany
--
http://www.chirurgie-goettingen.de


More information about the R-SIG-Mac mailing list