Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- exclude-result-prefixes="xs"
- version="2.0">
- <xsl:template match="/">
- <certmatriculation>
- <xsl:for-each select="//student">
- <xsl:variable name="programname"><xsl:value-of select="./@program"/></xsl:variable>
- <xsl:variable name="unitnr"><xsl:value-of select="./units"/></xsl:variable>
- <student>
- <xsl:copy-of select="./@program"/>
- <xsl:copy-of select="./name"/>
- <xsl:copy-of select="./studentnumber"/>
- <yearlevel><xsl:value-of select="./yearLevel"/></yearlevel>
- <term>
- <newterm><xsl:value-of select="./previousTerm + 1"/></newterm>
- </term>
- <xsl:copy-of select="./units"/>
- <courses><xsl:for-each select=".//course[position() != last()]">
- <xsl:value-of select="."/>,
- </xsl:for-each><xsl:for-each select=".//course[position() = last()]">
- <xsl:value-of select="."/>
- </xsl:for-each></courses>
- <total>
- <xsl:for-each select="//fee">
- <xsl:if test="./id = $programname">
- <xsl:value-of select="./tuition * $unitnr"/>
- </xsl:if>
- </xsl:for-each>
- </total>
- </student>
- </xsl:for-each>
- </certmatriculation>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement