I'm trying to render the $respStmt entries in this TEI Header:
<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>
In a list that looks like this:
<li class="list-unstyled">Transcription and correction: Elizabeth Ricketts, Tonya Howe</li>
<li class="list-unstyled">Correctionm editorial commentary, and markup: Incomplete</li>
I have added this code to a larger function, and it works with multiple $name items, but I get a cardinality issue with more than one $resp item:
for $resp in $header
return
<li class="list-unstyled">
{concat($titleStmt/tei:respStmt/tei:resp, ': ' , string-join($titleStmt/tei:respStmt/tei:name, ', ')) }
</li>
I've spelled out the elements in the concat as part of my learning process. Many, many thanks to Martin Honnen and milijan!
Here is the XQL file as a whole--I know it's not pretty: https://gist.github.com/tonyahowe/9ec27e9261116bdb11b0cfc2cecc5ea7
UPDATE: Progress! Now I'm getting a weird kind of repetition, though. With this code:
{
let $respStmt := $header//tei:respStmt
for $resps in $respStmt
return
<li class="list-unstyled">
{concat($resps, ': ' , string-join($names, ', ')) }
</li>
}
I'm getting the following result:
Transcription and correctionElizabeth RickettsTonya Howe: Elizabeth Ricketts, Tonya Howe, Incomplete
Correction, editorial commentary, and markupIncomplete: Elizabeth Ricketts, Tonya Howe, Incomplete
It looks like the $resp cardinality issue has been solved, but now each $name in each $respStmt is being duplicated--the information on the left side of the colon is correct, but on the right side of the colon, all the $names are being reproduced. Arg!