Created
June 17, 2014 01:13
-
-
Save jonathanrobie/76c0d91c6539074185ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare default element namespace "http://www.tei-c.org/ns/1.0"; | |
(: | |
Call List: Which actors appear in each scene? | |
- group by scenes | |
- show unique actors in each scene | |
:) | |
for $act in //div1[@type='act'] | |
for $act-number in $act/@n | |
for $scene in $act//div2[@type='scene'] | |
for $scene-number in $scene/@n | |
for $whoville in $scene//*[@who] | |
for $person in | |
for $s in $whoville/@who | |
return tokenize($s, "(#)|( #)") | |
group by $act-number, $scene-number | |
order by $act-number, $scene-number | |
return | |
<scene act="{$act-number}" scene="{$scene-number}"> | |
{ | |
for $p in $person | |
group by $p | |
order by $p | |
return $p | |
} | |
</scene> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Query from http://xqueryinstitute.org/ workshop, June 2014. Input is Folger's edition of Julius Caesar.