Tuesday, 11 October 2016

XML : Order table by level difficult

I have a table with games in this format:

  ID | GameName | EasyLevels | HardLevels | TotalLevels    1    Stakeboard  32           28          60    ....    

This table was generated by a xslt file that contains:

  <xsl:for-each select="//games">      <tr>              <th>GameID</th>              <th>GameName</th>              <th>EasyLevels</th>              <th>HardLevels</th>              <th>TotalLevels</th>      </tr>        <xsl:for-each select="game">          <tr>              <td><xsl:value-of select="GameId"/></td>              <td><xsl:value-of select="GameName"/></td>              <td><xsl:value-of select="count(levels/level[leveldifficult='Easy'])"/></td>              <td><xsl:value-of select="count(levels/level[leveldifficult='Hard'])"/></td>              <td><xsl:value-of select="count(levels/level)"/></td>          </tr>      </xsl:for-each>    </xsl:for-each>    

And I also have 2 buttons the xslt file. Because I want that be possible to order the table by the number of each level difficult when the button is clicked. But Im not see how to do that in xslt. Do you know how this is possible?

  <button>Order By Number Of EasyLevels</button>  <button>Order By Number Of HardLevels</button>    

No comments:

Post a Comment