dhlab-epfl / dhwriter

11 stars 2 forks source link

PHP error message on TEI export #9

Closed cmsmcq closed 10 years ago

cmsmcq commented 10 years ago

When I attempt to export my abstract (abstract 61) to TEI, I get a downloaded file labeled abstract.tei.txt containing:


<br />
<b>Warning</b>:  DOMDocument::loadXML() [<a href='domdocument.loadxml'>domdocument.loadxml</a>]: xmlParseEntityRef: no name in Entity, line: 238 in <b>/home/httpd/vhosts/dhwriter.org/httpdocs/exporter.php</b> on line <b>18</b><br />
<br />
<b>Warning</b>:  DOMDocument::loadXML() [<a href='domdocument.loadxml'>domdocument.loadxml</a>]: xmlParseEntityRef: no name in Entity, line: 240 in <b>/home/httpd/vhosts/dhwriter.org/httpdocs/exporter.php</b> on line <b>18</b><br />

The only entity I believe myself to be referring to in the document is lt, which I have found is necessry to escape references to element types in the form <p> and <pb/>. But there are references in the citations to journals which have ampersands in their titles; when I look at the references, the ampersands appear to be correctly escaped, but it's possible that the entity reference &amp; is being expanded to & somewhere along the work flow.

[Postscript: I made a copy of part of my abstract in which the relevant journal titles are modified artificially so they do not contain ampersands; in this copy of the abstract (paper 113), TEI export runs without visible error messages, and places an XML document on my disk. That seems to suggest that the problem is indeed a problem of ampersand escaping in the references management system.]

cyrilbornet commented 10 years ago

I did a few changes in the version currently online. Could you confirm if the bug seems to be solved (which I believe is the case, but couldn't reproduce it) or if it's still there? Thank you in advance,

cmsmcq commented 10 years ago

The bug appears to be resolved; when I export abstract 61 now, I get a well formed TEI Lite document, and the name of ADHO's journal is given as Literary &amp; Linguistic Computing. The export continues to work after I change my manually escaped less-than signs back into literal less-than signs and let the system handle escaping (so my inline tag references become &lt;pb&gt; and &lt;p&gt; ).

Well done!