Advertisement
Guest User

Untitled

a guest
Apr 19th, 2020
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. exclude-result-prefixes="xs"
  5. version="2.0">
  6. <xsl:template match="/">
  7. <certmatriculation>
  8. <xsl:for-each select="//student">
  9. <xsl:variable name="programname"><xsl:value-of select="./@program"/></xsl:variable>
  10. <xsl:variable name="unitnr"><xsl:value-of select="./units"/></xsl:variable>
  11. <student>
  12. <xsl:copy-of select="./@program"/>
  13. <xsl:copy-of select="./name"/>
  14. <xsl:copy-of select="./studentnumber"/>
  15. <yearlevel><xsl:value-of select="./yearLevel"/></yearlevel>
  16. <term>
  17. <newterm><xsl:value-of select="./previousTerm + 1"/></newterm>
  18. </term>
  19. <xsl:copy-of select="./units"/>
  20. <courses><xsl:for-each select=".//course[position() != last()]">
  21. <xsl:value-of select="."/>,
  22. </xsl:for-each><xsl:for-each select=".//course[position() = last()]">
  23. <xsl:value-of select="."/>
  24. </xsl:for-each></courses>
  25. <total>
  26. <xsl:for-each select="//fee">
  27. <xsl:if test="./id = $programname">
  28. <xsl:value-of select="./tuition * $unitnr"/>
  29. </xsl:if>
  30. </xsl:for-each>
  31. </total>
  32. </student>
  33. </xsl:for-each>
  34. </certmatriculation>
  35. </xsl:template>
  36. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement