Problem: Print the name of the students and averages greater than 70
XML Input file (students.xml):
XSL Style Sheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="course">
<xsl:apply-templates select="student"/>
</xsl:template>
<xsl:template match="student">
<xsl:variable name="ave">
<xsl:value-of select="(hw1 + hw2 + project + final) div 4"/>
</xsl:variable>
<xsl:if test="$ave > 70">
Student name="<xsl:value-of select="name"/>"
average="<xsl:value-of select="$ave"/>"
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Output file (grades70.txt):
Student name="George Lucas"
average="77.5"
Student name="Elizabeth Roberts"
average="73.75"