Я новичок в XSLT и застрял в проблеме. Я сделал некоторые поиски, которые я прочитал о мюнхенской группировке, но я не знаю, как использовать это в этой проблеме.
Я пытаюсь написать код в XSLT для чтения каждого teamName и суммирования целей каждой команды. Я использую XML v 1.0
Ниже приведен мой текущий файл данных в XML:
<footballLeague>
<round num="1">
<match>
<local>
<teamName>AA</teamName>
<goals>0</goals>
</local>
<visitor>
<teamName>BB</teamName>
<goals>1</goals>
</visitor>
</match>
<match>
<local>
<teamName>CC</teamName>
<goals>1</goals>
</local>
<visitor>
<teamName>DD</teamName>
<goals>0</goals>
</visitor>
</match>
</round>
<round num="2">
<match>
<local>
<teamName>DD</teamName>
<goals>1</goals>
</local>
<visitor>
<teamName>AA</teamName>
<goals>1</goals>
</visitor>
</match>
<match>
<local>
<teamName>BB</teamName>
<goals>0</goals>
</local>
<visitor>
<teamName>CC</teamName>
<goals>1</goals>
</visitor>
</match>
</round>
<round num="3">
<match>
<local>
<teamName>DD</teamName>
<goals>0</goals>
</local>
<visitor>
<teamName>BB</teamName>
<goals>1</goals>
</visitor>
</match>
<match>
<local>
<teamName>CC</teamName>
<goals>0</goals>
</local>
<visitor>
<teamName>AA</teamName>
<goals>1</goals>
</visitor>
</match>
</round>
<round num="4">
<match>
<local>
<teamName>BB</teamName>
<goals>1</goals>
</local>
<visitor>
<teamName>AA</teamName>
<goals>0</goals>
</visitor>
</match>
<match>
<local>
<teamName>DD</teamName>
<goals>0</goals>
</local>
<visitor>
<teamName>CC</teamName>
<goals>1</goals>
</visitor>
</match>
</round>
<round num="5">
<match>
<local>
<teamName>AA</teamName>
<goals>1</goals>
</local>
<visitor>
<teamName>DD</teamName>
<goals>1</goals>
</visitor>
</match>
<match>
<local>
<teamName>CC</teamName>
<goals>1</goals>
</local>
<visitor>
<teamName>BB</teamName>
<goals>1</goals>
</visitor>
</match>
</round>
<round num="6">
<match>
<local>
<teamName>BB</teamName>
<goals>1</goals>
</local>
<visitor>
<teamName>DD</teamName>
<goals>0</goals>
</visitor>
</match>
<match>
<local>
<teamName>AA</teamName>
<goals>1</goals>
</local>
<visitor>
<teamName>CC</teamName>
<goals>0</goals>
</visitor>
</match>
</round>
</footballLeague>
Результат, который я хотел бы получить после запуска XSLT:
Team Name | Goals For | Goals against | Games Won | Tied Matches
AA | 4 | 4 | 2 | 2
BB | 5 | 2 | 4 | 1
CC | 4 | 3 | 3 | 1
DD | 2 | 6 | 0 | 2
Любая помощь, с которой я мог бы начать, была бы фантастична c!