rotzooischaap
Technical User
I'm trying to sort number data from multiple xml documents. I've tried a couple of possibilities like putting sort in a for-each loop and in a apply-templates. Every time the numbers come up, but the data won't sort.
Example:
<xsl:template match="talents">
<xsl:for-each select="talent">
<xsl:variable name="talent" select="concat(.,'.xml')"/>
<xsl:apply-templates select="document($talent)//cv/studieverleden/master/cijfer">
<xsl:sort data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:for-each>
<br/>
<xsl:apply-templates select="talent">
<xsl:sort order="ascending"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="cijfer">
<xsl:value-of select="."/><br/>
</xsl:template>
<xsl:template match="talent">
<xsl:value-of select="."/><br/>
</xsl:template>
In this, the talent data is from 1 xml document ans id sorted, but the "cijfer" data is from multiple documents and there's no way to get it sorted.
Another example:
<xsl:template match="talents">
<table border='1'>
<thead><tr><td colspan = '3' align='center' bgcolor='orange'>
Master Cijfers</td></tr>
</thead>
<xsl:for-each select="talent">
<xsl:variable name="talent" select="concat(.,'.xml')"/>
<tr><td>
<xsl:value-of select="document($talent)//cv/studieverleden/master/cijfer" />
</td><td>
<xsl:value-of select="." />
</td></tr>
</xsl:for-each>
</table>
</xsl:template>
Hopefully one of you knows an answer to this problem.
Example:
<xsl:template match="talents">
<xsl:for-each select="talent">
<xsl:variable name="talent" select="concat(.,'.xml')"/>
<xsl:apply-templates select="document($talent)//cv/studieverleden/master/cijfer">
<xsl:sort data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:for-each>
<br/>
<xsl:apply-templates select="talent">
<xsl:sort order="ascending"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="cijfer">
<xsl:value-of select="."/><br/>
</xsl:template>
<xsl:template match="talent">
<xsl:value-of select="."/><br/>
</xsl:template>
In this, the talent data is from 1 xml document ans id sorted, but the "cijfer" data is from multiple documents and there's no way to get it sorted.
Another example:
<xsl:template match="talents">
<table border='1'>
<thead><tr><td colspan = '3' align='center' bgcolor='orange'>
Master Cijfers</td></tr>
</thead>
<xsl:for-each select="talent">
<xsl:variable name="talent" select="concat(.,'.xml')"/>
<tr><td>
<xsl:value-of select="document($talent)//cv/studieverleden/master/cijfer" />
</td><td>
<xsl:value-of select="." />
</td></tr>
</xsl:for-each>
</table>
</xsl:template>
Hopefully one of you knows an answer to this problem.