XSLT Query.....

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello,
I have been tasked with trying to add a value ("Graduate") to an aspx page which I have
Bolded for clarity in the code. I was able to get the appropriate header on the table, "Graduate" but the actual values from the XML data never displays. I have tried every combination I can think of with no
luck including a for each loop.
What I have pasted below is the most straight forward method I have tried with no success. I modeled this approach after, AdvisorName, which displays fine on the page. Every other value from the XML BUT Graduate also works. The only thing
I havent been able to do is restart the web server which if my syntax is correct might be the issue........
Thanks in advance, this one isnt fun anymore!

<pre class="prettyprint XML Code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ClassList>
<Students>
<Student>
<PersonId>35614</PersonId>
<IdNumber>100000613</IdNumber>
<FirstName>She</FirstName>
<MiddleName>A.</MiddleName>
<LastName>McShe</LastName>
<EmailAddress>test@yahoo.com</EmailAddress>
<CreditType>Plus-Minus Ltr Grade</CreditType>
<Credits>1.000</Credits>
<EnrolledStatus>A</EnrolledStatus>
<Advisor>
<AdvisorId>254</AdvisorId>
<AdvisorName>Bill, Test</AdvisorName>
</Advisor>
<Grad>
<Graduate>N</Graduate>
</Grad>
<AcademicRecords>
<AcademicRecord>
<Program>Guest</Program>
<Degree>NonDegree</Degree>
<Curriculum>Maj UNDE</Curriculum>
</AcademicRecord>
</AcademicRecords>
</Student>
<Student>
<PersonId>719</PersonId>
<IdNumber>100000719</IdNumber>
<FirstName>Test</FirstName>
<MiddleName />
<LastName>Student</LastName>
<EmailAddress>test@yahoo.com</EmailAddress>
<CreditType>Plus-Minus Ltr Grade</CreditType>
<Credits>1.000</Credits>
<EnrolledStatus>A</EnrolledStatus>
<Advisor>
<AdvisorId>721</AdvisorId>
<AdvisorName>Advisor, Test</AdvisorName>
</Advisor>
<Grad>
<Graduate>N</Graduate>
</Grad>
<AcademicRecords>
<AcademicRecord>
<Program>UG</Program>
<Degree>Minor</Degree>
<Curriculum>Maj PHIL</Curriculum>
<ClassLevel>Freshman</ClassLevel>
<ClassLoad>Under Full Load</ClassLoad>
</AcademicRecord>
</AcademicRecords>
</Student>
</Students>
<Totals>
<StudentCount>2</StudentCount>
<CeuTotal>0.000</CeuTotal>
<CreditTotal>2.000</CreditTotal>
</Totals>
</ClassList>[/code]
<br/>


<pre class="prettyprint <xsl:stylesheet version="1.0
<xsl:output media-type="html" omit-xml-declaration="yes"/>
<xsl:param name="imageDir"/>
<xsl:param name="showPictures 0</xsl:param>
<xsl:param name="lang"/>
<xsl:param name="rootDir"/>
<xsl:variable name="textValue" select="document(./Localization/ClassListView.xml)/XSLData/Text[@lang=$lang] | document(./Localization/ClassListView.xml)/XSLData/Text[@lang=substring($lang,1, 2)] | document(./Localization/ClassListView.xml)/XSLData/Text[@default=true]"/>
<xsl:template match="/
<table border="0" cellpadding="6" cellspacing="0" width="100%" id="classListResults" style="clear:both;" class="defaultTableAlignTop" summary="{$textValue/SummaryTable}
<colgroup>
<col/>
<col/>
<col style="white-space:nowrap"/>
</colgroup>
<tr class="trTableHeader
<th width="1
<input type="checkbox" onclick="checkAll(classListResults)"/>
</th>
<th>
<xsl:value-of select="$textValue/NameTh"/>
</th>
<th>
<xsl:value-of select="$textValue/IDTh"/>
</th>
<th>
<xsl:value-of select="$textValue/CurriculumTh"/>
</th>
<th>
<xsl:value-of select="$textValue/ClassLevelTh"/>
</th>
<th>
<xsl:value-of select="$textValue/ClassLoadTh"/>
</th>
<th>
<xsl:value-of select="Student Advisor"/>
</th>
<th>
<xsl:value-of select="Graduate"/>
</th>
<th>
<xsl:value-of select="$textValue/CreditsTh"/>
</th>
<th>
<xsl:value-of select="$textValue/AttendanceTh"/>
</th>
<th>
<xsl:value-of select="$textValue/StatusTh"/>
</th>
</tr>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="ClassList/Students/Student
<tr>
<!-- remove seperator from last row
-->
<xsl:if test="position() = last()
<xsl:attribute name="class noBorder</xsl:attribute>
</xsl:if>
<td align="center
<xsl:choose>
<xsl:when test="normalize-space(EmailAddress)
<input type="checkbox" value="{EmailAddress}" name="recipients"/>
</xsl:when>
<xsl:otherwise>
<input type="checkbox" disabled="disabled"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="$showPictures = 0
<xsl:choose>
<xsl:when test="normalize-space(EmailAddress)
<div class="studentMenuCell
<span>
javascript:void(0);" onclick="showStudentMenu(csMenu{PersonId}, this)" onmouseover="studentMenuOver(this)" onmouseout="studentMenuOut(this);
<xsl:value-of select="LastName"/>
<xsl:value-of select="$textValue/Lbl2"/>
<xsl:value-of select="FirstName"/>
<xsl:if test="normalize-space(MiddleName)
<xsl:text/>
<xsl:value-of select="MiddleName"/>
</xsl:if>



<div class="newMenuNoImg" id="csMenu{PersonId}" onmouseout="closeStudentMenu(event)


javascript:openSingleMailWindow({EmailAddress})
<xsl:value-of select="$textValue/LblEmailStudent"/>



javascript:void(0);" onclick="OpenWin({$rootDir}/Account/DossierStudent.aspx?Id={PersonId}&token={Token}, dossier)
<xsl:value-of select="$textValue/LblViewDossier"/>




</xsl:when>
<xsl:otherwise>
<xsl:value-of select="LastName"/>
<xsl:value-of select="$textValue/Lbl2"/>
<xsl:value-of select="FirstName"/>
<xsl:if test="normalize-space(MiddleName)
<xsl:value-of select="MiddleName"/>
</xsl:if>
<div class="newMenuNoImg" id="csMenu{PersonId}" onmouseout="closeStudentMenu(event)


javascript:void(0);" onclick="OpenWin({$rootDir}/Account/DossierStudent.aspx?Id={PersonId}&token={Token}, dossier)
<xsl:value-of select="$textValue/LblViewDossier"/>




</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<div class="studentMenuCell
<span>
javascript:void(0);" onclick="showStudentMenu(csMenu{PersonId}, this)" onmouseover="studentMenuOver(this)" onmouseout="studentMenuOut(this);
<xsl:value-of select="LastName"/>
<xsl:value-of select="$textValue/Lbl2"/>
<xsl:value-of select="FirstName"/>
<xsl:if test="normalize-space(MiddleName)
<xsl:text/>
<xsl:value-of select="MiddleName"/>
</xsl:if>



<div class="newMenuImgOnly" id="csMenu{PersonId}" onmouseout="closeStudentMenu(event)
<xsl:attribute name="class newMenu</xsl:attribute>

<xsl:if test="normalize-space(EmailAddress)

javascript:openSingleMailWindow({EmailAddress})
<xsl:value-of select="$textValue/LblEmailStudent"/>


</xsl:if>

javascript:void(0);" onclick="OpenWin({$rootDir}/Account/DossierStudent.aspx?Id={PersonId}&token={Token}, dossier)
<xsl:value-of select="$textValue/LblViewDossier"/>



javascript:void(0);" onclick="OpenWin({$rootDir}/Account/DossierStudent.aspx?Id={PersonId}&token={Token}, dossier)" title="{$textValue/TitleAnch}" class="newMenuImageLink
<xsl:choose>
<xsl:when test="normalize-space(ImageFileName)
<img src="{$imageDir}/ShowStudentImage.ashx?pic={ImageFileName}&code={ImageLocation}&size=60" class="waitlistThumbnail" onclick="OpenWin({$rootDir}/Account/DossierStudent.aspx?Id={PersonId}&token={Token}, dossier)"/>
</xsl:when>
<xsl:otherwise>
<img src="{$imageDir}/ShowStudentImage.ashx?size=60" alt="" width="60" height="60" class="waitlistThumbnail" onclick="OpenWin({$rootDir}/Account/DossierStudent.aspx?Id={PersonId}&token={Token}, dossier)"/>
</xsl:otherwise>
</xsl:choose>


</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:value-of select="IdNumber"/>
</td>
<td>
<ul class="ulNoStyle
<xsl:for-each select="AcademicRecords/AcademicRecord

<xsl:value-of select="Program"/>
<xsl:value-of select="$textValue/Lbl1"/>
<xsl:value-of select="Degree"/>
<xsl:value-of select="$textValue/Lbl1"/>
<xsl:value-of select="Curriculum"/>

</xsl:for-each>

</td>
<td>
<ul class="ulNoStyle
<xsl:for-each select="AcademicRecords/AcademicRecord

<xsl:value-of select="ClassLevel"/>

</xsl:for-each>

</td>
<td>
<ul class="ulNoStyle
<xsl:for-each select="AcademicRecords/AcademicRecord

<xsl:value-of select="ClassLoad"/>

</xsl:for-each>

</td>
<td>
<xsl:value-of select="Advisor/AdvisorName"/>
</td>
<td>
<xsl:value-of select="Grad/Graduate"/>
</td>
<td>
<xsl:value-of select="Credits"/>
</td>
<td>
<xsl:value-of select="AttendanceStatus"/>
</td>
<td>
<xsl:choose>
<xsl:when test="EnrolledStatus = A
<xsl:value-of select="$textValue/LblAdd"/>
</xsl:when>
<xsl:when test="EnrolledStatus = D
<xsl:value-of select="$textValue/LblDrop"/>
</xsl:when>
<xsl:when test="EnrolledStatus = H
<xsl:value-of select="$textValue/LblHold"/>
</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:template>[/code]
<br/>





<br/>
<br/>

View the full article
 
Back
Top