Skip to content

DataCite exporter double-escapes HTML in description metadata #12624

Description

@schorcht-ioer

Problem description
HTML markup in the “Description” field is xml-double-escaped when exported to Datacite.

As a result, HTML content is displayed literal in Datacite Commons and, consequently, in OpenAire as well.

See https://commons.datacite.org/doi.org/10.7910/dvn/glqwah
In this example descritpion, the linebreaks are rendered as:
... women. <br /><br /> The sample ...

However, a line break is expected.

Here is the cURL request to view the metadata:
curl "https://dataverse.harvard.edu/api/datasets/export?exporter=Datacite&persistentId=doi:10.7910/DVN/GLQWAH"

And here's the response:
... women. &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; ...

But it should be:
... women. &lt;br /&gt;&lt;br /&gt; ...

On the other hand, here's a "working" example from Zenodo that is displayed in DataCite Commons using interpreted HTML, where the text is correctly displayed in bold:
https://commons.datacite.org/doi.org/10.5281/zenodo.6861793

The description in the correspondending downloaded example DataCite XML is not double-escaped:
<description descriptionType="Abstract">&lt;p&gt;&lt;strong&gt;Abstract: &lt;/strong&gt;Feudalism

That's why I suspect that escaping only once would solve the problem. Unfortunately, I can't really test it, so I'm not sure.

Affected versions
at least 6.10 and 6.11 (and probably older versions as well)

Previous Discussion
https://groups.google.com/g/dataverse-community/c/dXqHmgpdJ9k

Any open or closed issues related?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions