Advertisement
TheocraticSoftware

Advanced XSL Scripting

Aug 7th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.94 KB | None | 0 0
  1. <tr>
  2.   <td class="cellComments" colspan="4">
  3.     <xsl:variable name="AssignHistory" select="document('AssignHistory.xml')"/>
  4.     <xsl:variable name="week" select="Date/@NextWeek"/>
  5.     <xsl:variable name="history-week" select="$AssignHistory/AssignmentHistory/*[name()=$week]"/>
  6.     <xsl:choose>
  7.       <xsl:when test="$history-week/node()">
  8.         <!--We have history content for the specified week-->
  9.         <xsl:variable name="NextReviewQuestion" select="$history-week/ReviewQuestion"/>
  10.         <xsl:if test="normalize-space($NextReviewQuestion) != ''">
  11.           <xsl:text>Question: </xsl:text>
  12.           <xsl:value-of select="$NextReviewQuestion"/>
  13.         </xsl:if>
  14.         <br />
  15.         <br />
  16.         <br />
  17.         <span style="font-size: 8pt;">
  18.           <xsl:apply-templates select="$AssignHistory/AssignmentHistory/*[name()=$week]/StudentItems">
  19.             <xsl:with-param name="MainHall" select="//Labels/MainHall"/>
  20.             <xsl:with-param name="AuxClass1" select="//Labels/AuxClass1"/>
  21.             <xsl:with-param name="AuxClass2" select="//Labels/AuxClass2"/>
  22.           </xsl:apply-templates>
  23.         </span>
  24.       </xsl:when>
  25.       <xsl:otherwise>
  26.         <!--There was no history. Assume it was a special event (no meeting) so move to the subsequent week-->
  27.         <xsl:variable name="NextReviewQuestion" select="$history-week/following-sibling::*/ReviewQuestion"/>
  28.         <xsl:if test="normalize-space($NextReviewQuestion) != ''">
  29.           <xsl:text>Next week is a special event. Below is the details for the week after.</xsl:text>
  30.           <br />
  31.           <xsl:text>Question: </xsl:text>
  32.           <xsl:value-of select="$NextReviewQuestion"/>
  33.         </xsl:if>
  34.         <br />
  35.         <br />
  36.         <br />
  37.         <span style="font-size: 8pt;">
  38.           <xsl:apply-templates select="$history-week/following-sibling::*/StudentItems">
  39.             <xsl:with-param name="MainHall" select="//Labels/MainHall"/>
  40.             <xsl:with-param name="AuxClass1" select="//Labels/AuxClass1"/>
  41.             <xsl:with-param name="AuxClass2" select="//Labels/AuxClass2"/>
  42.           </xsl:apply-templates>
  43.         </span>
  44.       </xsl:otherwise>
  45.     </xsl:choose>
  46.   </td>
  47. </tr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement