Created
June 15, 2014 19:24
-
-
Save fordmadox/72e7e548c9e5f64f84ef 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 namespace tei="http://www.tei-c.org/ns/1.0"; | |
<results> | |
{ | |
for $actor-list in //tei:stage/@who, | |
$actor in $actor-list/tokenize(., ' ') | |
group by $actor | |
order by $actor | |
return | |
<actor> { | |
attribute name { substring-after($actor, '#') }, | |
attribute total-speeches {count(//tei:sp/@who[. eq $actor])}, | |
for $actor in $actor-list | |
let $key := $actor/concat(ancestor::tei:div1/@n,'.',ancestor::tei:div2/@n) | |
group by $key | |
order by $key | |
return | |
<act_scene>{ attribute speech-count {count($actor/ancestor::tei:div2//tei:sp/@who[. = $actor-list])}, $key }</act_scene> | |
} | |
</actor> | |
} | |
</results> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment