私が達成しようとしているのは、ノードからすべての一致 (参加者) を取得し、日付に従ってそれらを並べ替え、最も古い 2 つの一致を取得することです。これまでに達成したことは、各フィクスチャ ノードから個別に 2 つの一致をフェッチすることです。
<spocosy version="1.0">
<fixtures id="820745" ut="2011-03-01" sport="Football" template="England Premier League" tournament="2010/2011" league="Premier League">
<fixture id="839993" name="Chelsea-Manchester United" date="2011-03-01 20:45:00" round="18" status="Not started">
<participants>
<participant participantid="8455" participantname="Chelsea"/>
<participant participantid="10260" participantname="Manchester United"/>
</participants>
</fixture>
<fixture id="840142" name="Birmingham-West Bromwich" date="2011-03-05 13:45:00" round="29" status="Not started">
<participants>
<participant participantid="8658" participantname="Birmingham"/>
<participant participantid="8659" participantname="West Bromwich"/>
</participants>
</fixture>
<fixture id="840143" name="Bolton-Aston Villa" date="2011-03-05 16:00:00" round="29" status="Not started">
<participants>
<participant participantid="8559" participantname="Bolton"/>
<participant participantid="10252" participantname="Aston Villa"/>
</participants>
</fixture>
</fixtures>
<fixtures id="821290" ut="2011-03-01" sport="Football" template="Spain LIGA BBVA" tournament="2010/2011" league="LIGA BBVA">
<fixture id="875757" name="Espanyol-Mallorca" date="2011-03-01 20:00:00" round="26" status="Not started">
<participants>
<participant participantid="8558" participantname="Espanyol"/>
<participant participantid="8661" participantname="Mallorca"/>
</participants>
</fixture>
<fixture id="875739" name="Sevilla-Gijon" date="2011-03-01 22:00:00" round="26" status="Not started">
<participants>
<participant participantid="8302" participantname="Sevilla"/>
<participant participantid="9869" participantname="Gijon"/>
</participants>
</fixture>
<fixture id="875737" name="Zaragoza-Athletic Bilbao" date="2011-03-02 20:00:00" round="26" status="Not started">
<participants>
<participant participantid="8394" participantname="Zaragoza"/>
<participant participantid="8315" participantname="Athletic Bilbao"/>
</participants>
</fixture>
<fixture id="875743" name="Getafe-Atletico Madrid" date="2011-03-02 20:00:00" round="26" status="Not started">
<participants>
<participant participantid="8305" participantname="Getafe"/>
<participant participantid="9906" participantname="Atletico Madrid"/>
</participants>
</fixture>
<fixture id="875746" name="Villarreal-Hercules" date="2011-03-02 20:00:00" round="26" status="Not started">
<participants>
<participant participantid="10205" participantname="Villarreal"/>
<participant participantid="10278" participantname="Hercules"/>
</participants>
</fixture>
</fixtures>
there are 5 fixtures
<xsl:template match="fixtures">
<xsl:for-each select="//fixture">
<xsl:sort select="@date" data-type="text" order="ascending"/>
<xsl:if test="position() < 3">
<xsl:variable name="eventid" select="@id"/>
<table class="default soccer">
<tbody>
<tr class="finished livestats event_row">
<td class="status tz_field" data-format="short_datetime"><xsl:value-of select="@date"></xsl:value-of></td>
<td class="team_1">
<div class="of_wrapper">
<span />
<xsl:value-of select="//participant[position()=1]/@participantname"></xsl:value-of>
</div>
</td>
<td id="res_{$eventid}" class="result bold link popup">
-
</td>
<td class="team_2">
<div class="of_wrapper">
<span />
<xsl:value-of select="//participant[position()=2]/@participantname"></xsl:value-of>
</div>
</td>
</tr>
</tbody>
</table>
</xsl:if>
</xsl:for-each>
そして、これがその出力です
その出力では、日付は私が達成したい最も古い2ですが、各フィクスチャに対して何度も表示されます(5つのフィクスチャがあり、日付は2ではなく合計10回表示されます)チームは関係ありません日付、チームは最初の参加者ノードから表示されます。
必ずしも正確なコードが必要なわけではありません。どのようなアプローチも歓迎します。簡単に言えば、すべての一致を取得してから日付に従って並べ替え、最も古い 2 つのマッチを正確な日付で表示したいと考えています。