Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidamichelson/6b39951410f424023e5e to your computer and use it in GitHub Desktop.
Save davidamichelson/6b39951410f424023e5e to your computer and use it in GitHub Desktop.
declare default element namespace "http://www.tei-c.org/ns/1.0";
(: Which scene does each actor appear in?
Group by actor ($person)
Variable bound to scene, do not group
:)
for $scene in //div2[@type="scene"]
for $speech in $scene//sp
for $whoville in $speech//*[@who]
for $person in
for $s in $whoville/@who
return fn:tokenize($s, " ")
group by $person
order by $person
return
<person xml:id="{$person}">
{
for $s in $scene/@n
order by $s
return xs:integer($s)
}
</person>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment