Last active
August 29, 2015 14:02
-
-
Save jonathanrobie/a43b38d8ec48f83d081e 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"; | |
(: | |
Which scene does each actor appear in? | |
- group by actors (need a variable that iterates over actors) | |
- need another variable that is bound to the scene | |
:) | |
for $scene in //div2[@type='scene'] | |
for $whoville in $scene//*[@who] | |
for $person in | |
for $s in $whoville/@who | |
return tokenize($s, " ") | |
group by $person | |
order by $person | |
return | |
<person xml:id="{$person}"> | |
{ | |
for $s in $scene/@n | |
group by $s | |
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
Query from http://xqueryinstitute.org/ workshop, June 2014. Input is Folger's edition of Julius Caesar.