Hi Ben,
Am Mon, Feb 14, 2022 at 03:53:40PM +0100 schrieb Ben Engbers:
I have 2 questions: 1: Is it possible to use separate counters for the inner and the outer loop? (How should I define the $countInner?)
I learned about the `count` feature just from your example. It does not seem to do what you want; I would try the "at" in a "for" loop.
2: How can I formulate the query for getting the correct output?
Your example is not well-formed, you're probably missing a closing </spreekbeurt> in the second <handeling> around the second <spreker>.
Anyway, I think what you want is to iterate over $Turn//spreker/text(), not just use the entire sequence. Here's how I transformed your first query (I stored your example in a variable called $file for experimentation):
let $Blogs := $file let $Turns := $file
for $Blog in $file, $Turn in $file where $Turn//datum/@date = $Blog//datum/@date order by $Blog//datum/@date count $Count let $Id := $Blog/handeling/@id let $Datum := $Blog//datum/@date for $Speaker at $ct in $Turn//spreker/text() return($Id, $Datum, $Speaker, $Count, $ct)
I think you can work towards your desired output format from there.
Hope this helps, Sebastian