Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <CYCLING>
- <xsl:apply-templates select="/CYCLISME/COURSES/COURSE" />
- </CYCLING>
- </xsl:template>
- <!-- COURSE -->
- <xsl:template match="COURSE">
- <xsl:element name="{@nom}">
- <PODIUM year="{PODIUM/@annee}">
- <xsl:apply-templates select="PODIUM"/>
- </PODIUM>
- </xsl:element>
- </xsl:template>
- <!-- WINNER -->
- <xsl:template match="PODIUM">
- <WINNER>
- <xsl:attribute name="nat">
- <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[1]/@id]/@nat"/>
- </xsl:attribute>
- <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[1]/@id]/text()"/>
- </WINNER>
- <SECOND>
- <xsl:attribute name="nat">
- <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[2]/@id]/@nat"/>
- </xsl:attribute>
- <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[2]/@id]/text()"/>
- </SECOND>
- <THIRD>
- <xsl:attribute name="nat">
- <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[3]/@id]/@nat"/>
- </xsl:attribute>
- <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[3]/@id]/text()"/>
- </THIRD>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement