ropensci / EML

Ecological Metadata Language interface for R: synthesis and integration of heterogenous data
https://docs.ropensci.org/EML
Other
97 stars 33 forks source link

character vector input to set_taxonomicCoverage creates invalid EML #279

Open atn38 opened 5 years ago

atn38 commented 5 years ago

If input to `set_taxonomicCoverage is a character vector of scientific names:

set_taxonomicCoverage(sci_names = c("Darwinia")

Output XML is invalid:

<taxonomicClassification>
    <Darwinia>
      <taxonRankName>kingdom</taxonRankName>
      <taxonRankValue>Animalia</taxonRankValue>
      <taxonomicClassification>
        <taxonRankName>subkingdom</taxonRankName>
        <taxonRankValue>Bilateria</taxonRankValue>
        <taxonomicClassification>
          <taxonRankName>infrakingdom</taxonRankName>
          <taxonRankValue>Protostomia</taxonRankValue>
          <taxonomicClassification>
            <taxonRankName>superphylum</taxonRankName>
            <taxonRankValue>Platyzoa</taxonRankValue>
            <taxonomicClassification>
              <taxonRankName>phylum</taxonRankName>
              <taxonRankValue>Platyhelminthes</taxonRankValue>
              <taxonomicClassification>
                <taxonRankName>genus</taxonRankName>
                <taxonRankValue>Darwinia</taxonRankValue>
              </taxonomicClassification>
            </taxonomicClassification>
          </taxonomicClassification>
        </taxonomicClassification>
      </taxonomicClassification>
    </Darwinia>
  </taxonomicClassification>

This is due to a simple named list items issue and a one line fix. I'll be submitting a PR for it.