Count the number of times a player plays a game in a different difficulty level
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Thu Oct 13, 2016 8:04 pm
Count the number of times a player plays a game in a different difficulty level
I have a xml and xslt files like below. And Im showing in a table the gamename and the player name. But now Im trying to do one thing and Im not see how.
I want to show how many times a player played a game in a novice, easy, medium, hard, legend level and the total. For example I want each row like this:
GameName | Player Name | NoviceLevels | EasyLevels | MediumLevels | HardLevels | Total
Game Title 1 John 1 1 0 0 2
I already try a lot of alternatives but Im not having success put this working like this. Do you see how to achieve this?
This is the xml:
This is the XSL:
What I have is here: http://xsltransform.net/pPJ8LVb/1
What Im trying now is here: http://xsltransform.net/pPJ8LVb/4
Do you know if its possible do this with xsl and what is missing in http://xsltransform.net/pPJ8LVb/4?
I want to show how many times a player played a game in a novice, easy, medium, hard, legend level and the total. For example I want each row like this:
GameName | Player Name | NoviceLevels | EasyLevels | MediumLevels | HardLevels | Total
Game Title 1 John 1 1 0 0 2
I already try a lot of alternatives but Im not having success put this working like this. Do you see how to achieve this?
This is the xml:
Code: Select all
<games>
<game>
<gamename>GameTitle 1</gamename>
<players>
<player>
<playername>John</playername>
<difficultlevel>Novice</difficultlevel>
<duration>130</duration>
</player>
<player>
<playername>John</playername>
<difficultlevel>Easy</difficultlevel>
<duration>210</duration>
</player>
<player>
<playername>Zed</playername>
<difficultlevel>Medium</difficultlevel>
<duration>300</duration>
</player>
</players>
</game>
</games>
Code: Select all
<table>
<xsl:for-each select="//games">
<tr>
<th>GameName</th>
<th>Player</th>
<th>Beginner</th>
<th>Beginner</th>
<th>Medium</th>
<th>Hard</th>
<th>Legend</th>
<th>Total</th>
</tr>
<xsl:for-each select="game">
<tr>
<td><xsl:value-of select="gamename"/></td>
<td><xsl:value-of select="players/player/playername"/></td>
....???
</tr>
</xsl:for-each>
</table>
What Im trying now is here: http://xsltransform.net/pPJ8LVb/4
Do you know if its possible do this with xsl and what is missing in http://xsltransform.net/pPJ8LVb/4?
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service