EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #09917


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] How to include bold, italics, superscript markups in bulk XML import?


Hi Joel,

I know you can definitely enter HTML tags when submitting via a web form and they will be saved as-is in the database.  However, the default renderer for these fields will not parse these tags and render in bold and italics.

If you saw the recent email about editing the $c->{render_paras} function you should be able to get it to parse HTML tags and render as expected.  I am not sure off the top of my head how to do this but it should not be too difficult to do in Perl code.  This will work for abstracts but I think you would also need to write a bespoke render method ftitles as you won't want it to add a <p> element.  If you create a similar function under $c->{render_title} and then set the render_single_value attribute title field (in cfg.d/eprint_fields.pl) to 'render_title'.

I have just tested using EPrints XML import and you need to make sure the text is XML entity encoded.  So rather than having the following XML for a title:

<title>This is <b>bold</b>and this is <i>italic</i></title>

You will need:

<title>This is &lt;b&gt;bold&lt;/b&gt; and this is &lt;i&gt;italic&lt;/i&gt;</title>

Hopefully the current format you have this metadata in will allow you to XML entity encode it before adding it to the EPrints XML encoded format.

Regards

David Newman


On 02/01/2025 5:45 pm, Joel Brown wrote:
CAUTION: This e-mail originated outside the University of Southampton.
CAUTION: This e-mail originated outside the University of Southampton.
We are preparing to bulk upload ~1300 articles to an eprints repository. Is there a way to include italics (and other markups) in the Title/abstract during the bulk XML import? 

Thanks,
Joel



*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List
*** Archive: https://www.eprints.org/tech.php/
*** EPrints community wiki: https://wiki.eprints.org/