我正在尝试在此 TEI 标头中呈现 $respStmt 条目:
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:id="reeve-prog">
<teiHeader>
<fileDesc>
<titleStmt>
<title type="statusBar">The Progress of Romance</title>
<author>
<person xml:id="CR" sex="F" href="http://en.wikipedia.org/wiki/Clara_Reeve">
<forename>Clara</forename>
<surname>Reeve</surname>
<born when="1729">1729</born>
<died when="1807-12-03">3 December 1807</died>
<occupation>Writer</occupation>
<occupation>Novelist</occupation>
<trait type="Marital Status">Unmarried</trait>
<nationality>English</nationality>
</person>
</author>
<respStmt>
<resp>Transcription and correction</resp>
<name>Elizabeth Ricketts</name>
<name>Tonya Howe</name>
</respStmt>
<respStmt>
<resp>Correction, editorial commentary, and markup</resp>
<name>Incomplete</name>
</respStmt>
</titleStmt>
</filedesc>
</teiHeader>
</TEI>
在如下所示的列表中:
<li class="list-unstyled">Transcription and correction: Elizabeth Ricketts, Tonya Howe</li>
<li class="list-unstyled">Correctionm editorial commentary, and markup: Incomplete</li>
我已将此代码添加到一个更大的函数中,它适用于多个 $name 项目,但我遇到了一个与多个 $resp 项目有关的基数问题:
for $resp in $header
return
<li class="list-unstyled">
{concat($titleStmt/tei:respStmt/tei:resp, ': ' , string-join($titleStmt/tei:respStmt/tei:name, ', ')) }
</li>
作为学习过程的一部分,我已经详细说明了 concat 中的元素。非常感谢 Martin Honnen 和 milijan!
这是整个 XQL 文件——我知道它不漂亮:https ://gist.github.com/tonyahowe/9ec27e9261116bdb11b0cfc2cecc5ea7
更新: 进步!不过,现在我得到了一种奇怪的重复。使用此代码:
{
let $respStmt := $header//tei:respStmt
for $resps in $respStmt
return
<li class="list-unstyled">
{concat($resps, ': ' , string-join($names, ', ')) }
</li>
}
我得到以下结果:
Transcription and correctionElizabeth RickettsTonya Howe: Elizabeth Ricketts, Tonya Howe, Incomplete
Correction, editorial commentary, and markupIncomplete: Elizabeth Ricketts, Tonya Howe, Incomplete
看起来 $resp 基数问题已经解决了,但是现在每个 $respStmt 中的每个 $name 都被重复了——冒号左侧的信息是正确的,但是冒号右侧的所有 $名称正在被复制。精氨酸!