I have the following XSLT:
<xsl:template match="Table">
<tr>
<td>
<font face="Verdana" color="#ffffff" size="2" style="vertical-align: top; white-space: nowrap">
<xsl:value-of select="PRG_DESCRIPTION"/>
</font>
</td>
<td>
<font face="Verdana" color="#ffffff" size="2" style="vertical-align: top; white-space: nowrap">
<xsl:value-of select="DAYS_LEFT"/>
</font>
</td>
<td>  </td>
<xsl:if test="ACTIVE = 0">
<td style="top: 2px">
<form name="myform" onsubmit="popupform(this, 'join');" action="../LogOnSection/SetCourseStart.aspx" method="post">
<input type="hidden" name="CourseID">
<xsl:attribute name="value">
<xsl:value-of select="EEDO_COURSE_ID"/>
</xsl:attribute></input>
<input type="hidden" name="UserID"><xsl:attribute name="value">
<xsl:value-of select="CLI_RID"/>
</xsl:attribute></input>
<input type="hidden" name="EventCode"><xsl:attribute name="value">
<xsl:value-of select="EVE_EVENT_CODE"/>
</xsl:attribute></input>
<input type="hidden" name="DateCreated">
<xsl:attribute name="value">
<xsl:value-of select="DATE_CREATED"/>
</xsl:attribute>
</input>
<input name="Submit" type="submit" value="Go"/>
<br>
</br>
</form>
</td>
</xsl:if>
</tr>
</xsl:template>
What I need to do is read an XML file and only show records where the code id's in the XML file are not present in the EVE_EVENT_CODE.
The XML file will be something like this:
<?xml version="1.0"?>
<program_codes>
<code id="FUN">CR</code>
<code id="HAN">CR</code>
<code id="AO">CR</code>
<code id="RME">CR</code>
<code id="AD">CR</code>
</program_codes>
XSLT is one thing that I am not even closely good at and I need help on this desperately.
Update, modified entire sheet:
Is the xsl:if
correct?
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="refDoc" value="document('ListCoursesFilter.xml')" />
<xsl:variable name="refIDs" value="$refDoc/program_codes/code/@id" />
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>National Alliance OnLine Courses</title>
<script TYPE="text/javascript">
function popupform(myform, windowname)
{
var CourseDT = myform.DateCreated.value
var CourseDTtoString = CourseDT.substr(0, 4);
if (CourseDTtoString == "2007")
{
window.open('', windowname, 'height=544,width=790,toolbar=no,menubar=no,titlebar=no,scrollbars=yes');
myform.target = windowname;
return true;
} else {
window.open('', windowname, 'height=712,width=1014,toolbar=no,menubar=no,titlebar=no,scrollbars=yes');
myform.target = windowname;
return true;
}
}
</script>
</head>
<body style="background-repeat: no-repeat; top: 0px">
<p>
<table align="center" border="0" style="; width: 569px; height: 89px">
<tbody>
<tr>
<font face="Verdana" size="2">To allow pop up windows from our site, hold down the control key and click "GO"</font><br /><br />
<!-- <font face="Verdana" size="3" color="#660000">The CISR, CSRM and William T. Hold self-paced online courses and examination site will be unavailable due to maintenance between the hours of 6:00 a.m. and 10:00 a.m. Central Time on Tuesday, June 17, 2014. If you need additional assistance please contact us at online@scic.com.</font><br /> -->
<!-- <font face="Verdana" size="3" color="#660000">Self-Paced courses will be unavailable due to maintenance June 4th, 2014 at 5:00 pm Central time till Friday morning June 6th, 2014. We are happy to extend your course timeframe to compensate for this closure. Please email <a href="mailto:cisronline@scic.com">cisronline@scic.com</a> with your request for a timeframe extension.</font> -->
</tr>
<tr>
<th>
<p align="left">
<font face="Verdana" size="2">Programs</font>
</p>
</th>
<th>
<p align="left">
<font face="Verdana" size="2">Course Available Through</font>
</p>
</th>
<th>
<p align="left">
<font face="Verdana"/>
</p>
</th>
</tr>
<xsl:apply-templates select="/NewDataSet/Table"/>
</tbody>
</table>
</p>
</body>
</html>
</xsl:template>
<xsl:template match="Table">
<tr>
<td>
<font face="Verdana" color="#ffffff" size="2" style="vertical-align: top; white-space: nowrap">
<xsl:value-of select="PRG_DESCRIPTION"/>
</font>
</td>
<td>
<font face="Verdana" color="#ffffff" size="2" style="vertical-align: top; white-space: nowrap">
<xsl:value-of select="DAYS_LEFT"/>
</font>
</td>
<td>  </td>
<xsl:if test="ACTIVE = 0 && count($refIDs[contains(current()/EVE_EVENT_CODE, .)]) = 0">
<td style="top: 2px">
<form name="myform" onsubmit="popupform(this, 'join');" action="../LogOnSection/SetCourseStart.aspx" method="post">
<input type="hidden" name="CourseID">
<xsl:attribute name="value">
<xsl:value-of select="EEDO_COURSE_ID"/>
</xsl:attribute></input>
<input type="hidden" name="UserID"><xsl:attribute name="value">
<xsl:value-of select="CLI_RID"/>
</xsl:attribute></input>
<input type="hidden" name="EventCode"><xsl:attribute name="value">
<xsl:value-of select="EVE_EVENT_CODE"/>
</xsl:attribute></input>
<input type="hidden" name="DateCreated">
<xsl:attribute name="value">
<xsl:value-of select="DATE_CREATED"/>
</xsl:attribute>
</input>
<input name="Submit" type="submit" value="Go"/>
<br>
</br>
</form>
</td>
</xsl:if>
</tr>
</xsl:template>
</xsl:stylesheet>
This is how it is "loaded" from the DB, the GM.AlasData.ActiveOLCourses
is a web service function that queries our DB for active courses for the passed ParticipantID
s = New StringReader(GM.AlasData.ActiveOLCourses(ParticipantID))
xtr = New XmlTextReader(s)
Dim XMLDoc = New XPathDocument(xtr)
Dim XSLTDoc = New XslCompiledTransform
XSLTDoc.Load(Server.MapPath("ListCourseFormat.xslt"))
'Transform XMLDoc and dump HTML results to stringwriter -> sw
XSLTDoc.Transform(XMLDoc, Nothing, sw)
BTW, looks like it is using v1.0