Advertisement
Jobjob

BDDII - Q6 2013

May 26th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.51 KB | None | 0 0
  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.     <xsl:template match="/">
  3.         <CYCLING>
  4.             <xsl:apply-templates select="/CYCLISME/COURSES/COURSE" />
  5.         </CYCLING>
  6.     </xsl:template>
  7.     <!-- COURSE -->
  8.     <xsl:template match="COURSE">
  9.         <xsl:element name="{@nom}">
  10.             <PODIUM year="{PODIUM/@annee}">
  11.                 <xsl:apply-templates select="PODIUM"/>
  12.             </PODIUM>
  13.         </xsl:element>
  14.     </xsl:template>
  15.     <!-- WINNER -->
  16.     <xsl:template match="PODIUM">
  17.         <WINNER>
  18.             <xsl:attribute name="nat">
  19.                 <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[1]/@id]/@nat"/>
  20.             </xsl:attribute>
  21.             <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[1]/@id]/text()"/>
  22.         </WINNER>
  23.         <SECOND>
  24.             <xsl:attribute name="nat">
  25.                 <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[2]/@id]/@nat"/>
  26.             </xsl:attribute>
  27.             <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[2]/@id]/text()"/>
  28.         </SECOND>
  29.         <THIRD>
  30.             <xsl:attribute name="nat">
  31.                 <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[3]/@id]/@nat"/>
  32.             </xsl:attribute>
  33.             <xsl:value-of select="/CYCLISME/COUREURS/COUREUR[@id = current()/COUREUR[3]/@id]/text()"/>
  34.         </THIRD>
  35.     </xsl:template>
  36. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement