Предположим, я хочу посчитать количество эпизодов. Подробно я хочу получить количество эпизодов, в которых только женщины или мужчины в качестве гостей. Я надеюсь, что мой вопрос ясен и несколько правдоподобен.
Ввод:
<pc:podcast url="https://forschergeist.de/" version="0.3" xmlns:pc="https://purl.org/net/hbuschme/teaching/2019ws-infostruk/podcast/0.3" xmlns:pt="https://purl.org/net/hbuschme/teaching/2019ws-infostruk/podcast-transcript/0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" https://purl.org/net/hbuschme/teaching/2019ws-infostruk/podcast/0.3 podcast.xsd https://purl.org/net/hbuschme/teaching/2019ws-infostruk/podcast-transcript/0.1 podcast-transcript.xsd">
<pc:title>Forschergeist</pc:title>
<pc:persons>
<pc:person gender="male" pid="timpritlove">Tim Pritlove</pc:person>
<pc:person gender="male" pid="michaelsonnabend">Michael Sonnabend</pc:person>
<pc:person gender="female" pid="annettevogt">Annette Vogt</pc:person>
<pc:person gender="male" pid="peterfinke">Peter Finke</pc:person>
<pc:person gender="female" pid="barbaralenz">Barbara Lenz</pc:person>
<pc:person gender="male" pid="suatyilmaz">Suat Yilmaz</pc:person>
<pc:person gender="male" pid="onurgüntürkün">Onur Güntürkün</pc:person>
<pc:person gender="male" pid="martinlindner">Martin Lindner</pc:person>
<pc:person gender="male" pid="petereisenberg">Peter Eisenberg</pc:person>
<pc:person gender="male" pid="michaelschermann">Michael Schermann</pc:person>
<pc:person gender="male" pid="henrikmüller">Henrik Müller</pc:person>
<pc:person gender="female" pid="antjeboetius">Antje Boetius</pc:person>
<pc:person gender="male" pid="gunterdueck">Gunter Dueck</pc:person>
<pc:person gender="male" pid="ferdischüth">Ferdi Schüth</pc:person>
<pc:person gender="female" pid="claudiaeggert">Claudia Eggert</pc:person>
<pc:person gender="female" pid="dagmarschäfer">Dagmar Schäfer</pc:person>
<pc:person gender="female" pid="murielhelbig">Muriel Helbig</pc:person>
<pc:person gender="male" pid="nikolauskriegeskorte">Nikolaus Kriegeskorte</pc:person>
<pc:person gender="female" pid="ulinkarublak">Ulinka Rublack</pc:person>
<pc:person gender="male" pid="michaelbraungart">Michael Braungart</pc:person>
<pc:person gender="male" pid="pascalhetze">Pascal Hetze</pc:person>
<pc:person gender="female" pid="lindabreitlauch">Linda Breitlauch</pc:person>
<pc:person gender="male" pid="jürgenhandke">Jürgen Handke</pc:person>
<pc:person gender="male" pid="franzjosefradermacher">Franz Josef Radermacher</pc:person>
<pc:person gender="male" pid="klauskümmerer">Klaus Kümmerer</pc:person>
<pc:person gender="male" pid="uweschneidewind">Uwe Schneidewind</pc:person>
<pc:person gender="male" pid="eberhardknobloch">Eberhard Knobloch</pc:person>
<pc:person gender="male" pid="ulrichdirnagl">Ulrich Dirnagl</pc:person>
<pc:person gender="male" pid="hansjoosten">Hans Joosten</pc:person>
<pc:person gender="female" pid="angelikabrandt">Angelika Brandt</pc:person>
<pc:person gender="male" pid="andreaszick">Andreas Zick</pc:person>
<pc:person gender="male" pid="güntherziegler">Günther Ziegler</pc:person>
<pc:person gender="male" pid="michaelvogel">Michael Vogel</pc:person>
<pc:person gender="female" pid="siljagraupe">Silja Graupe</pc:person>
<pc:person gender="male" pid="ernstpeterfischer">Ernst Peter Fischer</pc:person>
<pc:person gender="female" pid="juliaoffe">Julia Offe</pc:person>
<pc:person gender="male" pid="pavelrichter">Pavel Richter</pc:person>
<pc:person gender="male" pid="benjaminlahusen">Benjamin Lahusen</pc:person>
<pc:person gender="male" pid="reinholdleinfelder">Reinhold Leinfelder</pc:person>
<pc:person gender="female" pid="claudiahornberg">Claudia Hornberg</pc:person>
<pc:person gender="female" pid="monikatrümper">Monika Trümper</pc:person>
<pc:person gender="male" pid="jörnloviscach">Jörn Loviscach</pc:person>
<pc:person gender="female" pid="lisarosa">Lisa Rosa</pc:person>
<pc:person gender="male" pid="ralfstockmann">Ralf Stockmann</pc:person>
<pc:person gender="female" pid="lyndalroper">Lyndal Roper</pc:person>
<pc:person gender="male" pid="jürgentautz">Jürgen Tautz</pc:person>
<pc:person gender="male" pid="stefankröpelin">Stefan Kröpelin</pc:person>
<pc:person gender="male" pid="christophcorves">Christoph Corves</pc:person>
<pc:person gender="male" pid="jöranmuußmerholz">Jöran Muußmerholz</pc:person>
<pc:person gender="male" pid="hannshatt">Hanns Hatt</pc:person>
<pc:person gender="female" pid="carolinbock">Carolin Bock</pc:person>
<pc:person gender="female" pid="andreaniehaus">Andrea Niehaus</pc:person>
<pc:person gender="male" pid="volkerquaschning">Volker Quaschning</pc:person>
<pc:person gender="male" pid="jochenrabe">Jochen Rabe</pc:person>
<pc:person gender="male" pid="haraldlesch">Harald Lesch</pc:person>
<pc:person gender="male" pid="sebastiankuhn">Sebastian Kuhn</pc:person>
<pc:person gender="male" pid="manfredniekisch">Manfred Niekisch</pc:person>
<pc:person gender="male" pid="christopherzimmermann">Christopher Zimmermann</pc:person>
<pc:person gender="male" pid="philippewampfler">Philippe Wampfler</pc:person>
<pc:person gender="male" pid="stefanrahmstorf">Stefan Rahmstorf</pc:person>
<pc:person gender="female" pid="julespecht">Jule Specht</pc:person>
<pc:person gender="female" pid="isabelrink">Isabel Rink</pc:person>
<pc:person gender="male" pid="ingosass">Ingo Sass</pc:person>
<pc:person gender="male" pid="robertranisch">Robert Ranisch</pc:person>
<pc:person gender="female" pid="anitagohdes">Anita Gohdes</pc:person>
<pc:person gender="male" pid="gerdgigerenzer">Gerd Gigerenzer</pc:person>
<pc:person gender="female" pid="alinakokoschka">Alina Kokoschka</pc:person>
<pc:person gender="male" pid="oliverparodi">Oliver Parodi</pc:person>
<pc:person gender="male" pid="justushaukap">Justus Haukap</pc:person>
<pc:person gender="male" pid="peterpurgathofer">Peter Purgathofer</pc:person>
</pc:persons>
<pc:episode date="2019-10-01T11:00:00" duration="01:53:23" episode="72" title="Verantwortung in der Informatik" url="https://forschergeist.de/podcast/fg072-verantwortung-in-der-informatik/">
<pc:contributor pid="timpritlove" role="host"/>
<pc:contributor pid="peterpurgathofer" role="guest"/>
</pc:episode>
<pc:episode date="2019-09-05T14:48:00" duration="02:29:05" episode="71" title="Wirtschaft und Wettbewerb" url="https://forschergeist.de/podcast/fg071-wirtschaft-und-wettbewerb/">
<pc:contributor pid="timpritlove" role="host"/>
<pc:contributor pid="justushaucap" role="guest"/>
</pc:episode>
<pc:episode date="2019-07-29T11:00:00" duration="01:28:03" episode="70" title="Nachhaltigkeit und die Stadt" url="https://forschergeist.de/podcast/fg070-nachhaltigkeit-und-die-stadt/">
<pc:contributor pid="timpritlove" role="host"/>
<pc:contributor pid="oliverparodi" role="guest"/>
</pc:episode>
<pc:episode date="2020-01-01T00:00:00" duration="0" episode="043" title="Schule und Lernen in der digitalen Welt" url="https://forschergeist.de/podcast/fg043-schule-und-lernen-in-der-digitalen-welt/">
<pc:contributor pid="timpritlove" role="host"/>
<pc:contributor pid="lisarosa" role="guest"/>
</pc:epsiode>
Мой xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:pc="https://purl.org/net/hbuschme/teaching/2019ws-infostruk/podcast/0.3"
xmlns:pt="https://purl.org/net/hbuschme/teaching/2019ws-infostruk/podcast-transcript/0.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xhtml"/>
<xsl:key name="person-name" match="pc:person" use="@pid"/>
<xsl:key name="geschlecht" match="pc:person" use="@gender"/>
<xsl:template match="pc:podcast">
<html>
<body>
<h1>Episoden, in welchen der Guest Männlich ode weiblich war.<i><xsl:value-of select="pc:title"/></i></h1>
<ul>
<xsl:apply-templates select="pc:episode" />
</ul>
</body>
</html>
</xsl:template>
<xsl:template match="pc:episode">
<li>
<xsl:value-of select="@episode" />: <xsl:value-of select="@title" />
<ul>
<xsl:apply-templates select="pc:contributor" />
</ul>
</li>
</xsl:template>
<xsl:template match="pc:contributor">
<xsl:for-each select="key('person-name', @pid,)">
<li>
<xsl:value-of select="."/>
</li>
</xsl:for-each>
<!-- <xsl:value-of select="key('person-name', @pid)"/> -->
</xsl:template>
</xsl:stylesheet>
Желаемый вывод:
4 episode where guest is male
1 Episode where guest is female
Как правильно использовать ключ () и считать () функцию? Заранее спасибо за ответы на мои вопросы.