EPrints Technical Mailing List Archive

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

Message: #01186


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

[EP-tech] Re: Comments in XML configuration files: beware! (possibly needs fixing)


On a related note, I was expecting this in a template:
<epc:comment>just a comment</epc:comment>
To result in nothing.

It seems to result in:
<comment>just a comment</comment>

Is this expected?
Cheers,
John


-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of John Salter
Sent: 15 October 2012 16:24
To: 'eprints-tech@ecs.soton.ac.uk'
Subject: [EP-tech] Re: Comments in XML configuration files: beware! (possibly needs fixing)

I give to you:
http://wiki.eprints.org/w/EPrints_Control_Format#epc:comment



-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of John Salter
Sent: 15 October 2012 15:14
To: 'eprints-tech@ecs.soton.ac.uk'
Subject: [EP-tech] Re: Comments in XML configuration files: beware! (possibly needs fixing)

Aaah, thanks for the info - it looks like there may be others who thought the way I did - e.g.
http://discovery.ucl.ac.uk/1338563/ contains:
<!-- title --><!-- cite:linkhere><xhtml:em><print expr="title" opts="magicstop"/></xhtml:em></cite:linkhere --><!-- if test="is_set(translators)">(<print expr="translators"/>, Trans.).</if --><!-- print type info where required --><!-- print subtype info where required --><!-- if test="is_set(data_type)">[<print expr="data_type"/>].</if --><!-- publication details --> 

Is it worth adding something like this to the top of the citation files:
<!--
          Full citation for an eprint.
XML Comments contained within the cite:citation block will be rendered in citations using this file.
To make comments that aren't rendered, use an <epc:comment>...</epc:comment> block
-->

 - or even a link to the wiki page explaining the existence of such an option (I couldn't find one, but I'm sure such a feature *would* be documented ;o)
I'll add something to http://wiki.eprints.org/w/EPrints_Control_Format 

Cheers,
John

-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Sebastien Francois
Sent: 15 October 2012 14:22
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Comments in XML configuration files: beware! (possibly needs fixing)

Hi John,

Try using <epc:comment/> instead (look at 
cfg/citations/eprint/summary_page.xml for an example).

Seb.

On 15/10/12 14:18, John Salter wrote:
> In case you weren't already aware...
>
> Comments in XML configuration files (e.g. citations) will come through to the rendered page.
> To me, this is an unexpected behaviour* - not sure what others think?
>
> Example:
> <choose>
>    <when test="type = 'book' and is_set( creators )">
>      <print expr="creators_name"/>
>    </when>
>    <when ...>
>      ...
>    </when>
>    <otherwise>
>     <!-- print nothing? Some variant of <print expr="creators_name"/>? -->
>    </otherwise>
> </choose>
>
> Results in a literal HTML comment when none of the <when ...> statements are matched:
>     <!-- print nothing? Some variant of <print expr="creators_name"/>? -->
>
> It's fairly easy to look at the source code for an abstract page and see what's in there - not so easy to spot when just viewing the webpage itself!
>
> Cheers,
> John
>
> *My reasoning for this being unexpected is that there are internal-comments in the file already e.g.
> <!--
>          Full citation for an eprint.
> -->
> I would not expect this to end up in the rendered page - and therefore not other comments!
>
> *** 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/

*** 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/

*** 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/

*** 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/