EPrints Technical Mailing List Archive

Message: #02597


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

[EP-tech] Re: Creating new citation formats....


If the output of your export uses EPrints::Utils::tree_to_utf8 (text.pm does in 3.3.10), then you should (according to the documentation) be able to add an html line break, that will get converted to a newline:
>From ~/perl_lib/EPrints/Utils.pm:
"$string = EPrints::Utils::tree_to_utf8( $tree, $width, [$pre], [$whitespace_before], [$ignore_a] )

Convert a XML DOM tree to a utf-8 encoded string.
If $width is set then word-wrap at that many characters.
XHTML elements are removed with the following exceptions:
<br /> is converted to a newline.
<p>...</p> will have a blank line above and below.
<img /> will be replaced with the content of the alt attribute.
<hr /> will, if a width was specified, insert a line of dashes.
<a href="foo">bar</a> will be converted into "bar <foo>" unless ignore_a is set.
"
 - might just work!?

Cheers,
John

-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Ian Stuart
Sent: 04 February 2014 14:33
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Creating new citation formats....

On 04/02/14 12:09, John Salter wrote:
> [On our install] If you stick a new line in the citation, it comes out as a new line in the output.
If I have an XML file thus:

<cite:citation xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns="http://eprints.org/ep3/control"; 
xmlns:cite="http://eprints.org/ep3/citation"; >
       <print expr="$item.citation('default')" />
       <print expr="$item.url()"/>
</cite:citation>

and export the data as a text file, this is all one line

> If you look in ~/perl_lib/EPrints/Script/Compiled.pm it will show you what you can do in EPScript - I don’t think there's a magic 'export' function in there - so you could:
>   - make one by writing into that package ('run_render_export_link' maybe)
>   - do it manually in the citation
>   - something else that someone cleverer than I will no doubt suggest in a minute :o)

I'm suspecting #2 is the way forward
I'm also suspecting #3 is more challenging that you appreciate :)


-- 

Ian Stuart.
Developer: ORI, RJ-Broker, and OpenDepot.org
Bibliographics and Multimedia Service Delivery team,
EDINA,
The University of Edinburgh.

http://edina.ac.uk/

This email was sent via the University of Edinburgh.

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/