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

John Salter J.Salter at leeds.ac.uk
Mon Oct 15 14:18:23 BST 2012


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!



More information about the Eprints-tech mailing list