I want to change the output order of the elements. He currently displays them as follows: "Maths: English: Science: ABA (GCSE); (GCSE); (GCSE)"; I need a way to arrange it so that I can display it like this: "Mathematics: A (GCSE), English: B (GCSE), science: A (GCSE)"; I am new to XML, so please try not to show redundant solutions!
XSL Code:
<xsl:template match="education">
<div style="float:left;">
<xsl:apply-templates select="qualifications/qual"/>
<xsl:apply-templates select="qualifications/grade"/>
<xsl:apply-templates select="qualifications/level"/>
</div>
</xsl:template>
<xsl:template match="qual"><span style="color:grey; font-size:15px; font-family:verdana;">
<xsl:value-of select="."/></span><p1>:</p1></xsl:template>
<xsl:template match="grade"><span style="color:grey; font-size:15px; font-family:verdana;"><xsl:value-of select="."/></span><p1> </p1></xsl:template>
<xsl:template match="level"><p1> (</p1><span style="color:grey; font-size:15px; font-family:verdana;"><xsl:value-of select="."/></span><p1>);</p1></xsl:template>
XML Code:
<qualifications>
<qual>Mathematics</qual> <grade>A</grade> <level>GCSE</level>
<qual>English</qual> <grade>B</grade> <level>GCSE</level>
<qual>Science</qual> <grade>A</grade> <level>GCSE</level>
</qualifications>
source
share