1

EPrints 是一个基于 perl 的存储库,请参阅WP 中的 EPrints

我的图书管理员要求我按以下方式设置 EPrins(仅适用于“专着”类型的文档):

  1. 如果作者不超过 3 人,则在专着标题前打印“作者”;
  2. 如果作者超过 3 位,则打印 '$title / $authors'。

例如,第一次发表的 7 位作者和第二次发表的 2 位作者:

  1. 俄罗斯维基词典/ Smirnov A.、Levashova T.、Karpov A.、Kipyatkova I.、Ronzhin A.、Krizhanovsky A.、Krizhanovsky N.计算科学研究的引用语料库分析。2012
  2. Meyer CM, Gurevych I. Worth its weight in Gold or Yet another Resource - 维基词典、OpenThesaurus 和 GermaNet 的比较研究。2010 年。
4

2 回答 2

1

我将使用以下内容,检查正在设置的 creators_name 以及有多少创建者:

<when test="type = 'monograph'">
  <choose>
    <when test="is_set(creators_name) and length(creators_name) lt 4">
      <print expr="creators_name" />
      / 
      <print expr="title" />
    </when>
    <when test="is_set(creators_name) and length(creators_name) gt 3">
      <print expr="title" />
      /
      <print expr="creators_name" />
    </when>
    <otherwise>
      <print expr="title" />
    </otherwise>
  </choose>
</when>

在 EPrints 引文文件中使用 XML 注释时,它们将出现在页面的 HTML 源中。要在引文文件中添加未出现在 html 源代码中的注释,您可以使用:

<comment>This will not appear in the html source</comment>

EPrints 引用所使用的语言记录在 EPrints Wiki 上:

一些 XML 配置文件使用不同的默认命名空间 - 因此您可能会看到以命名空间为前缀的元素,例如

<cite:citation xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://eprints.org/ep3/control" xmlns:cite="http://eprints.org/ep3/citation" >
  ...
  <epc:comment>This is a comment</epc:comment>
  ...
</cite:citation>

帮助 EPrints 的最佳地点是他们的邮件列表 - 搜索 wiki(上面链接)以获取详细信息(我没有足够的声誉来发布另一个链接!)。

于 2016-09-07T13:25:15.683 回答
1

经过我们的几次尝试和失败尝试......最大的问题是 EPrints 不是纯 Perl,并且没有太多文档......

我们需要编辑引文文件/eprints/cfg/citations/eprint/default.xml)。有以下解决方案:

<!-- Monograph: if < 4 authors then print 'authors' before title -->
<when test="type = 'monograph'">

      <if test="is_set(creators_name)"> 

          <set name='authors' expr="creators_name">
              (Debug information) Number of authors: 
              <print expr="$authors.length()"/>.

              <set name='authors_len' expr="$authors.length()">

                  <if test="$authors_len lt 4">
                      <print expr="creators_name"/>
                  </if>
              </set>
          </set>
      </if> 
</when>

<!-- Title -->
<cite:linkhere><xhtml:em><print expr="title"/>:</xhtml:em></cite:linkhere>


<!-- "/ authors" after Title for monography if len(authors)>3 -->
<choose>
  <when test="type = 'monograph'">

      <if test="is_set(creators_name)"> 

          <set name='authors' expr="creators_name">
              <set name='authors_len' expr="$authors.length()">

                  <if test="$authors_len gt 3">
                     / <print expr="creators_name"/>
                  </if>

              </set>
          </set>
      </if>
  </when>

  <otherwise>
  </otherwise>
</choose>

它有效,但是......我计算了两次相同的变量“authors_len”。而且我不知道如何重用这个变量并只计算一次。

我尝试了 EPrints 函数“is_set(authors_len)”并尝试了“is_set($authors_len)”,但 EPrints 会抛出不同的错误消息 o_O

于 2016-01-25T15:03:10.743 回答