Mixin new DOI values at the right place
At the moment, zenodo DOIs created in the process triggered by the service are written to a hardcoded path. This is somewhat flexible, depending on what is found in the TEI file:
- if there are no
idno
children of/TEI/teiHeader/fileDesc/publicationStmt
yet, add a<idno type="DOI">{new zenodo doi}</idno>
element as the last child ofpublicationsStmt
. - if
/TEI/teiHeader/fileDesc/publicationStmt
does haveidno
children and the first such child does not containidno
children in turn, add a new<idno type="DOI">{new zenodo doi}</idno>
element as new first idno element - if the first
idno
element does contain at least oneidno
child, add<idno type="DOI">{new zenodo doi}</idno>
element as the last child of this first "top-level"idno
element.
(Old <idno type="DOI">{some doi}</idno>
element are removed when they are at /TEI/teiHeader/fileDesc/publicationStmt/idno[@type='DOI']
or /TEI/teiHeader/fileDesc/publicationStmt/idno[1]/idno[@type='DOI']
.)
Should this all rather happen where the user config says that DOIs are?...
Edited by Andreas Wagner