Skip to content

Fix EML <pubDate> element ordering and add XML declaration #6902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

grantfitzsimmons
Copy link
Member

Fixes #6421

Ensures the <pubDate> element is inserted after the last <associatedParty> or before another common element if possible, with a fallback to the previous behavior. Also writes the XML with a declaration to align with GBIF requirements.

Testing instructions

Perform this testing on both v7.11.0 and issue-6421

  • Create a DwC archive package in a collection with existing DwC export resources
  • Download the DWC archive
  • Extract the archive

Once complete:

  • Compare the two eml.xml files to each other
  • Verify that <pubDate> appears
--- before
+++ after
@@ -1,6 +1,7 @@
-
+<?xml version='1.0' encoding='utf-8'?>
 <eml:eml xmlns:eml="eml://ecoinformatics.org/eml-2.1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 http://rs.gbif.org/schema/eml-gbif-profile/1.1/eml.xsd" packageId="e0fcabb5-162c-4bc5-aaed-ae3d074c6f09" system="Specify" scope="system" xml:lang="en">
 
 <dataset>
       <alternateIdentifier>10.15468/bfd6ci</alternateIdentifier>
@@ -23,6 +24,7 @@
     </individualName>
 <electronicMailAddress>[email protected]</electronicMailAddress>    <role>USER</role>
     </associatedParty>
-      <language>ENGLISH</language>
+      <pubDate>2025-07-03</pubDate><language>ENGLISH</language>
     <abstract>
         <para>This dataset is generated from the records for specimens housed at the Fish and Wildlife Research institute (FWRI) in St. Petersburg, FL. As a division of the State of Florida’s Fish and Wildlife Conservation Commission (FWC), FWRI houses voucher specimens supporting the research and monitoring efforts of FWC staff and other state agencies, as well as depositions from academic researchers and industrial projects. The samples are largely restricted geographically to the waters in and around Florida, USA. Sampling events primarily span from the 1950s through the present.</para>
     </abstract>
@@ -52,7 +54,7 @@
     </individualName>
 <organizationName>Fish and Wildlife Research Institute</organizationName><positionName>Curator</positionName><electronicMailAddress>[email protected]</electronicMailAddress>      </contact>
 
-<pubDate>2024-01-10</pubDate></dataset>
+</dataset>
 
 <additionalMetadata>
     <metadata>

Ensures the pubDate element is inserted after the last associatedParty or before certain elements to match common EML order. Also writes the XML with a declaration to align with GBIF requirements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋Back Log
Development

Successfully merging this pull request may close these issues.

Update RSS Feed adds date at the end of the eml file
1 participant