<xsl:for-each select="class/student">
ID: <xsl:value-of select="id"/><br/>
Name: <xsl:value-of select="lastName"/>,<xsl:value-of select="firstName"/><br/>
Date: <xsl:value-of select="date"/><br/>
Major: <xsl:if test="major[@Year > 2008]">
<xsl:value-of select="major"/> ,
declared in: <xsl:value-of select="major[@Year]"/>
</xsl:if><br/><br/>
</xsl:for-each>
XML code`:
<student>
<id>1000001</id>
<lastName>john</lastName>
<firstName>Doe</firstName>
<date format="d">08/25/2006</date>
<major Year="2006">CS:BS</major>
</student>
output:
ID: 1000001 Name: Doe,John Date-enrolled: August 25, 2006 Major: CS:BS , declared in: CS:BS
the xml code above is just a sample of the actual xml code, there are more 'Year' values/elements.
Hi guys,
Im trying to get only majors whose Year is greater than 2008, for some reason im getting the wrong output.
thanks