XSLT Creation
Basically, I'm trying to create a grade book view for my site which contains the XML data. I want to list the assignments (AssignmentDescription) in a column and have the User ID to the Left, just like the HTML i pasted. What am i doing wrong with my XLST sheet.
<html dir="ltr">
<head runat="server">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled 1</title>
<meta name="Microsoft Theme" content="Lichen 1011, default">
</head>
<body>
<form id="form1" runat="server">
</form>
<table style="width: 100%">
<tr>
<td> </td>
<td>Assignment 1 from DB</td>
<td>Assignment 2 from DB</td>
<td>Assignment 3 from DB</td>
<td>Assignment 4 from DB</td>
<td>Total Score</td>
</tr>
<tr>
<td>John Smith</td>
<td>21</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Joe Dumars</td>
<td>58</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
XSLT
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<!--<font face="Arial, Helvetica, sans-serif" size="3">Announcements</font>-->
<table border="0" width="100%" cellpadding="4" cellspacing="1">
<tr height="50"><xsl:for-each select="NewDataSet/Data">
<xsl:choose>
<xsl:when test="node()">
<td width="150" bgcolor="#FAF9E4"><br/><xsl:value-of select="AssignmentDescription"/>
</td>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each> </tr>
<xsl:for-each select="NewDataSet/Data">
<tr height="50">
<xsl:choose>
<xsl:when test="node()">
<td width="25" bgcolor="#CCCCCC" ><br/><b><xsl:value-of select="StudentUID"/></b></td>
<td width="25" bgcolor="#F7B182" valign="top"><br/><xsl:value-of select="StudentPointsEarned"/></td>
<td width="25" bgcolor="#F7B182" valign="top"><br/><xsl:value-of select="StudentEarnedEC"/></td>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
XML Fil e
<NewDataSet>
- <Data>
<StudentUID>9996766666</StudentUID>
<FaculytRemarks>Did great</FaculytRemarks>
<CategoryDescription>Class Participation</CategoryDescription>
<CategoryWeight>10.0000</CategoryWeight>
<AssignmentDescription>Participation</AssignmentDescription>
<AssignmentPoints>10.0000</AssignmentPoints>
<AssignmentEC>0.0000</AssignmentEC>
<AssignmentTotal>10.0000</AssignmentTotal>
<StudentPointsEarned>45.00</StudentPointsEarned>
<StudentEarnedEC>2</StudentEarnedEC>
<StudentWeightedScore>6.714290</StudentWeightedScore>
</Data>
- <Data>
<StudentUID>9996766666</StudentUID>
<FaculytRemarks>Horrible job.</FaculytRemarks>
<CategoryDescription>Class Participation</CategoryDescription>
<CategoryWeight>10.0000</CategoryWeight>
<AssignmentDescription>Ch. 4 Team Time</AssignmentDescription>
<AssignmentPoints>10.0000</AssignmentPoints>
<AssignmentEC>0.0000</AssignmentEC>
<AssignmentTotal>10.0000</AssignmentTotal>
<StudentPointsEarned>31.00</StudentPointsEarned>
<StudentEarnedEC>3</StudentEarnedEC>
<StudentWeightedScore>4.857140</StudentWeightedScore>
</Data>
- <Data>
<StudentUID>99967633666</StudentUID>
<FaculytRemarks>Enter Faculty Remarks</FaculytRemarks>
<CategoryDescription>Class Participation</CategoryDescription>
<CategoryWeight>10.0000</CategoryWeight>
<AssignmentDescription>Ch. 7 Buzz Word and Self-Test</AssignmentDescription>
<AssignmentPoints>10.0000</AssignmentPoints>
<AssignmentEC>0.0000</AssignmentEC>
<AssignmentTotal>10.0000</AssignmentTotal>
<StudentPointsEarned>9.00</StudentPointsEarned>
<StudentEarnedEC>1</StudentEarnedEC>
<StudentWeightedScore>1.428570</StudentWeightedScore>
</Data>
- <Data>
|