Open sn0001 opened 4 years ago
Can't reproduce it on my machine. Does the problem persist for you?
> x <- efetch(174789, db = "taxonomy", retmode = "xml")
> x
Object of class ‘efetch’
<?xml version="1.0"?>
<!DOCTYPE TaxaSet PUBLIC "-//NLM//DTD Taxon, 14th January 2002//EN" "https://www.ncbi.nlm.nih.gov/entrez/query/DTD/taxon.dtd">
<TaxaSet>
<Taxon>
<TaxId>174789</TaxId>
<ScientificName>Ecpleopus gaudichaudii</ScientificName>
<OtherNames>
<Name>
<ClassCDE>authority</ClassCDE>
<DispName>Ecpleopus gaudichaudii Duméril & Bibron, 1839</DispName>
</Name>
<Name>
<ClassCDE>type material</ClassCDE>
<DispName>BMNH 1946.8.2.4</DispName>
</Name>
<Name>
<ClassCDE>type material</ClassCDE>
<DispName>BMNH:1946.8.2.4</DispName>
</Name>
</OtherNames>
<ParentTaxId>174747</ParentTaxId>
<Rank>species</Rank>
<Division>Vertebrates</Division>
<GeneticCode>
<GCId>1</GCId>
<GCName>Standard</GCName>
</GeneticCode>
<MitoGeneticCode>
<MGCId>2</MGCId>
<MGCName>Vertebrate Mitochondrial</MGCName>
</MitoGeneticCode>
<Lineage>cellular organisms; Eukaryota; Opisthokonta; Metazoa; Eumetazoa; Bilateria; Deuterostomia; Chordata; Craniata; Vertebrata; Gnathostomata; Teleostomi; Euteleostomi; Sarcopterygii; Dipnotetrapodomorpha; Tetrapoda; Amniota; Sauropsida; Sauria; Lepidosauria; Squamata; Bifurcata; Unidentata; Episquamata; Laterata; Teiioidea; Gymnophthalmidae; Cercosaurinae; Ecpleopus</Lineage>
<LineageEx>
<Taxon>
<TaxId>131567</TaxId>
<ScientificName>cellular organisms</ScientificName>
<Rank>no rank</Rank>
</Taxon>
<Taxon>
<TaxId>2759</TaxId>
<ScientificName>Eukaryota</ScientificName>
<Rank>superkingdom</Rank>
</Taxon>
<Taxon>
<TaxId>33154</TaxId>
<ScientificName>Opisthokonta</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>33208</TaxId>
<ScientificName>Metazoa</ScientificName>
<Rank>kingdom</Rank>
</Taxon>
<Taxon>
<TaxId>6072</TaxId>
<ScientificName>Eumetazoa</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>33213</TaxId>
<ScientificName>Bilateria</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>33511</TaxId>
<ScientificName>Deuterostomia</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>7711</TaxId>
<ScientificName>Chordata</ScientificName>
<Rank>phylum</Rank>
</Taxon>
<Taxon>
<TaxId>89593</TaxId>
<ScientificName>Craniata</ScientificName>
<Rank>subphylum</Rank>
</Taxon>
<Taxon>
<TaxId>7742</TaxId>
<ScientificName>Vertebrata</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>7776</TaxId>
<ScientificName>Gnathostomata</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>117570</TaxId>
<ScientificName>Teleostomi</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>117571</TaxId>
<ScientificName>Euteleostomi</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>8287</TaxId>
<ScientificName>Sarcopterygii</ScientificName>
<Rank>superclass</Rank>
</Taxon>
<Taxon>
<TaxId>1338369</TaxId>
<ScientificName>Dipnotetrapodomorpha</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>32523</TaxId>
<ScientificName>Tetrapoda</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>32524</TaxId>
<ScientificName>Amniota</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>8457</TaxId>
<ScientificName>Sauropsida</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>32561</TaxId>
<ScientificName>Sauria</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>8504</TaxId>
<ScientificName>Lepidosauria</ScientificName>
<Rank>class</Rank>
</Taxon>
<Taxon>
<TaxId>8509</TaxId>
<ScientificName>Squamata</ScientificName>
<Rank>order</Rank>
</Taxon>
<Taxon>
<TaxId>1329961</TaxId>
<ScientificName>Bifurcata</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>1329950</TaxId>
<ScientificName>Unidentata</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>1329912</TaxId>
<ScientificName>Episquamata</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>1329976</TaxId>
<ScientificName>Laterata</ScientificName>
<Rank>clade</Rank>
</Taxon>
<Taxon>
<TaxId>35036</TaxId>
<ScientificName>Teiioidea</ScientificName>
<Rank>superfamily</Rank>
</Taxon>
<Taxon>
<TaxId>88861</TaxId>
<ScientificName>Gymnophthalmidae</ScientificName>
<Rank>family</Rank>
</Taxon>
<Taxon>
<TaxId>2293894</TaxId>
<ScientificName>Cercosaurinae</ScientificName>
<Rank>subfamily</Rank>
</Taxon>
<Taxon>
<TaxId>174747</TaxId>
<ScientificName>Ecpleopus</ScientificName>
<Rank>genus</Rank>
</Taxon>
</LineageEx>
<CreateDate>2001/10/22 13:38:00</CreateDate>
<UpdateDate>2020/06/02 23:02:56</UpdateDate>
<PubDate>2002/01/10 18:04:00</PubDate>
</Taxon>
</TaxaSet>
EFetch query using the ‘taxonomy’ database.
Query url: ‘https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?=efetch&db=taxonomy&id=174789&retmode=xm...’
Retrieval type: ‘’, retrieval mode: ‘xml’
Thank you for your reply. Yes, the problem persists. Maybe you are using different package versions?
Plus, under Windows, I can no longer execute any efetch()
query:
> reutils::efetch(174789, db = "taxonomy", retmode = "xml")
Warnung: CurlError: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Object of class ‘efetch’
[1] "CurlError: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version"
EFetch query using the ‘taxonomy’ database.
Query url: ‘https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?=efetch&db=taxonomy&id=174789&retmode=xml&rettype=&ret...’
Retrieval type: ‘’, retrieval mode: ‘xml’
Same problem here with another taxon
The 3 following options fail :
reutils::efetch(1965393, db = "taxonomy", retmode = "xml")
efetch_url <- "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&rettype=xml&id=1965393"
my_xml <- efetch_url |> RCurl::getURL() |> XML::xmlParse(asText=TRUE, encoding = "UTF-8")
my_xml <- efetch_url |> RCurl::getURL() |> xml2::read_xml()
Here are the error messages :
> reutils::efetch(1965393, db = "taxonomy", retmode = "xml")
Error:
XML parse error: StartTag: invalid element name
Object of class ‘efetch’
[1] "XML parse error: StartTag: invalid element name\n"
EFetch query using the ‘taxonomy’ database.
Query url: ‘https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?=efetch&db=taxonomy&id=1965393&retmode=xml&ret...’
Retrieval type: ‘’, retrieval mode: ‘xml’
> efetch_url <- "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&rettype=xml&id=1965393"
> my_xml <- efetch_url |> RCurl::getURL() |> XML::xmlParse(asText=TRUE, encoding = "UTF-8")
StartTag: invalid element name
Erreur : 1: StartTag: invalid element name
> my_xml <- efetch_url |> RCurl::getURL() |> xml2::read_xml()
Erreur dans read_xml.raw(charToRaw(enc2utf8(x)), "UTF-8", ..., as_html = as_html, :
StartTag: invalid element name [68]
Using httr::GET
as proposed here works fine :
# This works !
my_xml <- efetch_url |> httr::GET() |> httr::content("text") |> XML::xmlParse()
Under Ubuntu 20.04,
efetch()
produces an errorXML parse error: StartTag: invalid element name
with certain taxon IDs, e.g.:efetch(174789, db = "taxonomy", retmode = "xml")
.Session Info: