Open anarchivist opened 2 months ago
A cursory look at the code on the current develop
branch makes me think there are no unit tests that check the escaping of XML, although there is a test edu.harvard.iq.dataverse.pidproviders.doi.datacite.XmlMetadataTemplateTest
that checks simpler values against an XML Schema for DataCite.
The XmlMetadataTemplate
uses the standard XmlStreamWriter
, which automatically escapes strings for XML. If I modify the values in the above test and run it, they are escaped correctly.
It makes me think that even though the error you see mentions the DataCite schema, the service doesn't use the XmlMetadataTemplate
. The develop branch doesn't include the edu.harvard.iq.dataverse.DOIEZIdServiceBean
anymore; edu.harvard.iq.dataverse.pidproviders.doi.ezid.EZIdDOIProvider
doesn't use the template, but the externally developed EZIDService
. Apparently, that service doesn't escape strings for XML.
So it appears that the root problem is not in Dataverse (at least for this issue ;)).
What steps does it take to reproduce the issue?
&
instead of&
).When does this issue occur?
Which page(s) does it occurs on?
What happens?
To whom does it occur (all users, curators, superusers)?
What did you expect to happen?
Which version of Dataverse are you using?
6.1
Any related open or closed issues to this bug report?
3328, #3845, #7611
Are you thinking about creating a pull request for this issue?
not at this point; existing workaround to replace ampersands with "and" will work for us
server.log
``` [2024-09-09T14:16:45.442-0700] [Payara 6.2023.9] [WARNING] [] [edu.harvard.iq.dataverse.DOIEZIdServiceBean] [tid: _ThreadID=109 _ThreadName=http-thread-pool::jk-connector(4)] [timeMillis: 1725916605442] [levelValue: 900] [[ modifyMetadata failed]] [2024-09-09T14:16:45.442-0700] [Payara 6.2023.9] [WARNING] [] [edu.harvard.iq.dataverse.DOIEZIdServiceBean] [tid: _ThreadID=109 _ThreadName=http-thread-pool::jk-connector(4)] [timeMillis: 1725916605442] [levelValue: 900] [[ String edu.ucsb.nceas.ezid.EZIDException: bad request - error="ValidationError({'datacite': ['Metadata validation error: XML parse error: EntityRef: expecting \';\', line 6, column 40 (