Project

Profile

Help

Support #6384 » substring-after.xquery

Mircea Enachescu, 2024-04-08 14:16

 
declare namespace tei = "http://www.tei-c.org/ns/1.0";

declare default collation "http://www.w3.org/2013/collation/UCA?lang=cs-CZ";


let $sps := //tei:sp
let $whos := distinct-values($sps/@who)
let $persons :=
for $who in $whos
order by $who
let $speakers := $sps[@who = $who]/tei:speaker
return

(:
returns 'GA' and 'IO' with Saxon-HE XQuery 12.3, but 'GA' and 'IO' with Saxon-PE and Saxon-EE
:)
<person xmlns="http://www.tei-c.org/ns/1.0" xml:id="{substring-after($who, '#')}" />

return
<listPerson xmlns="http://www.tei-c.org/ns/1.0">
<head>List of characters</head>
{$persons}
</listPerson>
(1-1/3)