Advertisement
TheocraticSoftware

Workbook-S-140-Personal.xsl

Mar 27th, 2018
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 28.28 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:msa="http://www.publictalksoftware.co.uk/msa">
  3.   <xsl:output method="html" indent="yes" version="4.01"
  4.    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  5.    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
  6.  
  7.   <xsl:template match="/">
  8.     <html xmlns="http://www.w3.org/1999/xhtml">
  9.       <xsl:attribute name="lang">
  10.         <xsl:value-of select="//Settings//LanguageCode"/>
  11.       </xsl:attribute>
  12.       <xsl:attribute name="dir">
  13.         <xsl:value-of select="//Settings/Direction"/>
  14.       </xsl:attribute>
  15.       <head>
  16.         <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  17.         <link rel="stylesheet" type="text/css" href="Workbook-S-140-Personal.css"/>
  18.         <title>
  19.           <xsl:value-of select="//Labels/Congregation"/>&#160;<xsl:value-of select="//Labels/Title" />
  20.         </title>
  21.       </head>
  22.       <body>
  23.         <xsl:for-each select="//NamesToHighlight/Name">
  24.           <xsl:variable name="NameToHighlight" select="."/>
  25.           <div class="containerPage">
  26.             <xsl:for-each select="//MeetingWorkBook/Meeting">
  27.               <div class="containerMeeting">
  28.                 <xsl:if test="@PageBreak=1">
  29.                   <br style="page-break-before: always;"/>
  30.                 </xsl:if>
  31.                 <xsl:if test="@PageBreak=1 or position()=1">
  32.                   <xsl:call-template name="HEADING"/>
  33.                 </xsl:if>
  34.                 <xsl:if test="@BookmarkId">
  35.                   <a>
  36.                     <xsl:attribute name="name">
  37.                       <xsl:value-of select="concat('week', @BookmarkId)"/>
  38.                     </xsl:attribute>
  39.                     <![CDATA[ ]]>
  40.                   </a>
  41.                 </xsl:if>
  42.                 <xsl:call-template name="WEEK">
  43.                   <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  44.                 </xsl:call-template>
  45.  
  46.                 <xsl:apply-templates select="TFGW">                  
  47.                   <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  48.                 </xsl:apply-templates>
  49.                 <xsl:apply-templates select="AYFM">
  50.                   <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  51.                 </xsl:apply-templates>
  52.                 <xsl:apply-templates select="LAC">
  53.                   <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  54.                 </xsl:apply-templates>
  55.               </div>
  56.             </xsl:for-each>
  57.             <xsl:if test="not(position() = last())" >
  58.               <br style="page-break-before: always;"/>
  59.             </xsl:if>
  60.           </div>
  61.         </xsl:for-each>
  62.       </body>
  63.     </html>
  64.   </xsl:template>
  65.  
  66.   <xsl:template name="WEEK">
  67.     <xsl:param name ="NameToHighlight"/>
  68.     <table class="tableDATE" cellspacing="0" cellpadding="0">
  69.       <xsl:call-template name="SetColumnWidths"/>
  70.       <xsl:if test="@SpecialEvent=1">
  71.         <tr>
  72.           <td class="cellBibleReading" colspan="4">
  73.             <xsl:value-of select="Date"/>&#160;|&#160;<xsl:value-of select="WeeklyBibleReading"/>
  74.           </td>
  75.         </tr>
  76.         <xsl:apply-templates select="SpecialEvent"/>
  77.       </xsl:if>
  78.       <xsl:if test="@SpecialEvent=0">
  79.         <tr>
  80.           <td class="cellBibleReading" colspan="3">
  81.             <div class="floatRight">
  82.               <xsl:value-of select="//Labels/Chairman"/>
  83.               <xsl:if test="@NumberClasses = 2">
  84.                 <br/>
  85.                 <xsl:value-of select="//Labels/AuxCounsellor"/>
  86.               </xsl:if>
  87.               <xsl:if test="@NumberClasses = 3">
  88.                 <br/>
  89.                 <xsl:value-of select="//Labels/AuxCounsellor1"/>
  90.                 <br/>
  91.                 <xsl:value-of select="//Labels/AuxCounsellor2"/>
  92.               </xsl:if>
  93.             </div>
  94.             <xsl:value-of select="Date"/>&#160;|&#160;<xsl:value-of select="WeeklyBibleReading"/>
  95.           </td>
  96.           <td class="cellName">
  97.             <xsl:choose>
  98.               <xsl:when test="Chairman/@Duplicate=1">
  99.                 <span class="textDuplicate">
  100.                   <xsl:value-of select="Chairman"/>&#160;
  101.                 </span>
  102.               </xsl:when>
  103.               <xsl:when test="Chairman=$NameToHighlight">
  104.                 <span class="textHighlight">
  105.                   <xsl:value-of select="Chairman"/>&#160;
  106.                 </span>
  107.               </xsl:when>
  108.               <xsl:otherwise>
  109.                 <xsl:value-of select="Chairman"/>&#160;
  110.               </xsl:otherwise>
  111.             </xsl:choose>
  112.             <xsl:if test="@NumberClasses &gt;= 2">
  113.               <br/>
  114.               <xsl:choose>
  115.                 <xsl:when test="AuxCounsellor1/@Duplicate=1">
  116.                   <span class="textDuplicate">
  117.                     <xsl:value-of select="AuxCounsellor1"/>&#160;
  118.                   </span>
  119.                 </xsl:when>
  120.                 <xsl:when test="AuxCounsellor1=$NameToHighlight">
  121.                   <span class="textHighlight">
  122.                     <xsl:value-of select="AuxCounsellor1"/>&#160;
  123.                   </span>
  124.                 </xsl:when>
  125.                 <xsl:otherwise>
  126.                   <xsl:value-of select="AuxCounsellor1"/>&#160;
  127.                 </xsl:otherwise>
  128.               </xsl:choose>
  129.             </xsl:if>
  130.             <xsl:if test="@NumberClasses = 3">
  131.               <br/>
  132.               <xsl:choose>
  133.                 <xsl:when test="AuxCounsellor2/@Duplicate=1">
  134.                   <span class="textDuplicate">
  135.                     <xsl:value-of select="AuxCounsellor2"/>&#160;
  136.                   </span>
  137.                 </xsl:when>
  138.                 <xsl:when test="AuxCounsellor2=$NameToHighlight">
  139.                   <span class="textHighlight">
  140.                     <xsl:value-of select="AuxCounsellor2"/>&#160;
  141.                   </span>
  142.                 </xsl:when>
  143.                 <xsl:otherwise>
  144.                   <xsl:value-of select="AuxCounsellor2"/>&#160;
  145.                 </xsl:otherwise>
  146.               </xsl:choose>
  147.             </xsl:if>
  148.           </td>
  149.         </tr>
  150.         <xsl:apply-templates select="Note"/>
  151.         <tr>
  152.           <td colspan="4">&#160;</td>
  153.         </tr>
  154.         <tr>
  155.           <xsl:apply-templates select="SongOpen" />
  156.           <xsl:apply-templates select="PrayerOpen">
  157.             <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  158.           </xsl:apply-templates>
  159.         </tr>
  160.         <xsl:apply-templates select="OpeningComments" />
  161.       </xsl:if>
  162.     </table>
  163.   </xsl:template>
  164.  
  165.   <!--Displays the notes (if any)-->
  166.   <xsl:template match="Note">
  167.     <xsl:if test="normalize-space(.) != ''">
  168.       <tr>
  169.         <td class="cellNotes" colspan="4">
  170.           <xsl:value-of select="//Labels/Note"/>:&#160;<xsl:value-of select="."/>
  171.         </td>
  172.       </tr>
  173.     </xsl:if>
  174.   </xsl:template>
  175.  
  176.   <xsl:template match="SpecialEvent">
  177.     <tr>
  178.       <td class="textSpecialEvent" colspan="4">
  179.         <xsl:value-of select="Event"/> [<xsl:value-of select="Date"/>]
  180.       </td>
  181.     </tr>
  182.     <xsl:if test="normalize-space(Location) != ''">
  183.       <tr>
  184.         <td class="textSpecialEventLocation" colspan="4">
  185.           <xsl:value-of select="Location"/>
  186.         </td>
  187.       </tr>
  188.     </xsl:if>
  189.   </xsl:template>
  190.  
  191.   <!--Displays heading with a nice double underline-->
  192.   <xsl:template name="HEADING">
  193.     <div class="borderHEADINGOuter">
  194.       <div class="borderHEADINGInner">
  195.         <table class="tableHEADING">
  196.           <tr>
  197.             <td class="textCongregation">
  198.               <xsl:value-of select="//Labels/Congregation"/>
  199.             </td>
  200.             <td class="textTitle">
  201.               <xsl:value-of select="//Labels/Title"/>
  202.             </td>
  203.           </tr>
  204.         </table>
  205.       </div>
  206.     </div>
  207.   </xsl:template>
  208.  
  209.   <!--Display the end time (using 24 hour format)-->
  210.   <xsl:template match="Time" mode="End">
  211.     <td class="cellTime">
  212.       <xsl:value-of select="@EndTime24"/>
  213.     </td>
  214.   </xsl:template>
  215.  
  216.   <!--Display the start time (using 24 hour format)-->
  217.   <xsl:template match="Time" mode="Start">
  218.     <td class="cellTime">
  219.       <xsl:value-of select="@StartTime24"/>
  220.     </td>
  221.   </xsl:template>
  222.  
  223.   <!--Displays the duration of the item in minutes-->
  224.   <xsl:template match="Time" mode="Duration">
  225.     <span class="textDuration">
  226.       (<xsl:value-of select="."/>)
  227.     </span>
  228.   </xsl:template>
  229.  
  230.   <!--Display the name of the brother assigned-->
  231.   <xsl:template match="Name | PrayerOpen | PrayerEnd">
  232.     <xsl:param name="NameToHighlight"/>
  233.     <td class="cellName">
  234.       <xsl:choose>
  235.         <xsl:when test="@Duplicate=1">
  236.           <span class="textDuplicate">
  237.             <xsl:value-of select="."/>
  238.           </span>
  239.         </xsl:when>
  240.         <xsl:when test=".=$NameToHighlight">
  241.           <span class="textHighlight">
  242.             <xsl:value-of select="."/>&#160;
  243.           </span>
  244.         </xsl:when>
  245.         <xsl:otherwise>
  246.           <xsl:value-of select="."/>
  247.         </xsl:otherwise>
  248.       </xsl:choose>
  249.     </td>
  250.   </xsl:template>
  251.  
  252.   <!--Displays the theme for the assignment-->
  253.   <xsl:template match="Theme">
  254.     <span class="textTheme">
  255.       <xsl:value-of select="." disable-output-escaping="yes"/>
  256.     </span>
  257.   </xsl:template>
  258.  
  259.   <!--Displays the chairman label-->
  260.   <xsl:template name="Chairman">
  261.     <td class="cellName">
  262.       <!--Trims the " :" from the end of the chairman label-->
  263.       <xsl:value-of select="normalize-space(translate(//Labels/Chairman,':',''))"/>
  264.     </td>
  265.   </xsl:template>
  266.  
  267.   <xsl:template match="Method">
  268.     <span class="textMethod">
  269.       <xsl:value-of select="." disable-output-escaping="yes"/>
  270.     </span>
  271.   </xsl:template>
  272.  
  273.   <!--Treasures From God's Word-->
  274.   <xsl:template match="TFGW">
  275.     <xsl:param name="NameToHighlight"/>
  276.     <table class="tableTFGW" cellspacing="0" cellpadding="0">
  277.       <xsl:call-template name="SetColumnWidths"/>
  278.  
  279.       <xsl:call-template name="SectionHeading">
  280.         <xsl:with-param name="strSection">TFGW</xsl:with-param>
  281.         <xsl:with-param name="iSpanColumns">3</xsl:with-param>
  282.       </xsl:call-template>
  283.  
  284.       <xsl:apply-templates select="TFGWItem">
  285.         <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  286.         <xsl:with-param name="iSpanCols">
  287.           <xsl:value-of select="@NumberClasses"/>
  288.         </xsl:with-param>
  289.       </xsl:apply-templates>
  290.       <xsl:apply-templates select="BibleReadingItem">
  291.         <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  292.       </xsl:apply-templates>
  293.     </table>
  294.   </xsl:template>
  295.  
  296.   <!--Bible talk and Digging for Spiritual Gems-->
  297.   <xsl:template match="TFGWItem">
  298.     <xsl:param name="NameToHighlight"/>
  299.     <xsl:param name="iSpanCols"/>
  300.     <tr>
  301.       <xsl:apply-templates select="Time" mode="End"/>
  302.       <td colspan="{$iSpanCols+1}">
  303.         <span class="bulletTFGW">&#8226;</span>
  304.         <xsl:apply-templates select="Theme"/>
  305.         <xsl:apply-templates select="Time" mode="Duration"/>
  306.         <xsl:apply-templates select="Method"/>
  307.       </td>
  308.       <xsl:apply-templates select="Name">
  309.         <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  310.       </xsl:apply-templates>
  311.     </tr>
  312.   </xsl:template>
  313.  
  314.   <!--Displays all of the bible reading students for each class-->
  315.   <xsl:template match="BibleReadingItem">
  316.     <xsl:param name="NameToHighlight"/>
  317.     <tr>
  318.       <xsl:apply-templates select="Time" mode="End"/>
  319.       <td class="cellTheme">
  320.         <span class="bulletTFGW">&#8226;</span>
  321.         <span class="textTheme">
  322.           <xsl:value-of select="Type"/>
  323.         </span>
  324.         <xsl:apply-templates select="Time" mode="Duration"/>
  325.         <xsl:apply-templates select="Material"/>
  326.       </td>
  327.       <td class="cellPosition">
  328.         <xsl:value-of select="//Labels/Student"/>
  329.       </td>
  330.       <xsl:for-each select="Readers/Reader">
  331.         <td class="cellName">
  332.           <xsl:choose>
  333.             <xsl:when test="@Duplicate=1">
  334.               <span class="textDuplicate">
  335.                 <xsl:value-of select="."/>
  336.               </span>
  337.             </xsl:when>
  338.             <xsl:when test=".=$NameToHighlight">
  339.               <span class="textHighlight">
  340.                 <xsl:value-of select="."/>
  341.               </span>
  342.             </xsl:when>
  343.             <xsl:otherwise>
  344.               <xsl:value-of select="."/>
  345.             </xsl:otherwise>
  346.           </xsl:choose>
  347.         </td>
  348.       </xsl:for-each>
  349.     </tr>
  350.   </xsl:template>
  351.  
  352.   <!--Apply Yourself To The Field Ministry-->
  353.   <xsl:template match="AYFM">
  354.     <xsl:param name ="NameToHighlight"/>
  355.     <table class="tableAYFM" cellspacing="0" cellpadding="0">
  356.       <xsl:call-template name="SetColumnWidths"/>
  357.  
  358.       <xsl:call-template name="SectionHeading">
  359.         <xsl:with-param name="strSection">AYFM</xsl:with-param>
  360.         <xsl:with-param name="iSpanColumns">3</xsl:with-param>
  361.       </xsl:call-template>
  362.  
  363.       <xsl:apply-templates select="Presentations" />
  364.       <xsl:apply-templates select="StudentItem">
  365.         <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  366.       </xsl:apply-templates>
  367.     </table>
  368.   </xsl:template>
  369.  
  370.  
  371.   <!--Displays all the information for a student item.
  372.  This includes all the students from each class.-->
  373.   <xsl:template match="StudentItem">
  374.     <xsl:param name="NameToHighlight"/>
  375.     <tr>
  376.       <xsl:apply-templates select="Time" mode="End"/>
  377.       <td class="cellTheme">
  378.         <span class="bulletAYFM">&#8226;</span>
  379.         <span class="textTheme">
  380.           <xsl:value-of select="Type"/>
  381.         </span>
  382.         <xsl:apply-templates select="Time" mode="Duration"/>
  383.         <xsl:apply-templates select="Material"/>
  384.       </td>
  385.       <td class="cellPosition">
  386.         <xsl:choose>
  387.           <xsl:when test="@IsSampleVideo=1">
  388.             <!--We need an empty cell-->
  389.             <xsl:text> </xsl:text>
  390.           </xsl:when>
  391.           <xsl:otherwise>
  392.             <xsl:value-of select="//Labels/Student"/>
  393.             <xsl:if test="@IsTalk=0">
  394.               <br/>
  395.               <xsl:value-of select="//Labels/Assistant"/>
  396.             </xsl:if>
  397.           </xsl:otherwise>
  398.         </xsl:choose>
  399.       </td>
  400.       <xsl:apply-templates select="Students">
  401.         <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  402.       </xsl:apply-templates>
  403.     </tr>
  404.   </xsl:template>
  405.  
  406.   <xsl:template match="Material | SourceMaterial">
  407.     <span class="textMaterial">
  408.       <xsl:value-of select="." disable-output-escaping="yes"/>
  409.     </span>
  410.   </xsl:template>
  411.  
  412.   <!--Displays the student and assistant for the current student item-->
  413.   <xsl:template match="Students">
  414.     <xsl:param name="NameToHighlight"/>
  415.     <td class="cellName">
  416.       <xsl:choose>
  417.         <xsl:when test="../@IsSampleVideo=1">
  418.           <xsl:choose>
  419.             <xsl:when test="@ChairmanHandleSampleVideo=0">
  420.               <xsl:value-of select="//Labels/Counsellor"/>
  421.             </xsl:when>
  422.             <xsl:otherwise>
  423.               <!--Trims the " :" from the end of the chairman label-->
  424.               <xsl:value-of select="normalize-space(translate(//Labels/Chairman,':',''))"/>
  425.             </xsl:otherwise>
  426.           </xsl:choose>
  427.         </xsl:when>
  428.         <xsl:otherwise>
  429.           <xsl:choose>
  430.             <xsl:when test="Student/@Duplicate=1">
  431.               <span class="textDuplicate">
  432.                 <xsl:value-of select="Student"/>
  433.               </span>
  434.             </xsl:when>
  435.             <xsl:when test="Student=$NameToHighlight">
  436.               <span class="textHighlight">
  437.                 <xsl:value-of select="Student"/>
  438.               </span>
  439.             </xsl:when>
  440.             <xsl:otherwise>
  441.               <xsl:value-of select="Student"/>
  442.             </xsl:otherwise>
  443.           </xsl:choose>
  444.           <xsl:if test="../@IsTalk=0">
  445.             <br/>
  446.             <xsl:choose>
  447.               <xsl:when test="Assistant/@Duplicate=1">
  448.                 <span class="textDuplicate">
  449.                   <xsl:value-of select="Assistant"/>
  450.                 </span>
  451.               </xsl:when>
  452.               <xsl:when test="Assistant=$NameToHighlight">
  453.                 <span class="textHighlight">
  454.                   <xsl:value-of select="Assistant"/>
  455.                 </span>
  456.               </xsl:when>
  457.               <xsl:otherwise>
  458.                 <xsl:value-of select="Assistant"/>
  459.               </xsl:otherwise>
  460.             </xsl:choose>
  461.           </xsl:if>
  462.         </xsl:otherwise>
  463.       </xsl:choose>
  464.     </td>
  465.   </xsl:template>
  466.  
  467.   <!--First week of month item-->
  468.   <xsl:template match="Presentations">
  469.     <tr>
  470.       <xsl:apply-templates select="Time" mode="End"/>
  471.       <td colspan="2">
  472.         <span class="bulletAYFM">&#8226;</span>
  473.         <xsl:apply-templates select="Theme"/>
  474.         <xsl:apply-templates select="Time" mode="Duration"/>
  475.         <xsl:apply-templates select="Method"/>
  476.       </td>
  477.       <xsl:apply-templates select="Name"/>
  478.     </tr>
  479.   </xsl:template>
  480.  
  481.   <!--Define the column widths for the schedule-->
  482.   <xsl:template name="SetColumnWidths">
  483.     <!--The widths in the column classes will add up to 100%-->
  484.     <xsl:choose>
  485.       <xsl:when test="not(@NumberClasses) or @NumberClasses=1 or self::Meeting">
  486.         <colgroup>
  487.           <col class="columnTime"/>
  488.           <col class="columnTheme1ClassB"/>
  489.           <col class="columnPosition"/>
  490.           <col class="columnName"/>
  491.         </colgroup>
  492.       </xsl:when>
  493.       <xsl:when test="@NumberClasses=2">
  494.         <colgroup>
  495.           <col class="columnTime"/>
  496.           <col class="columnTheme2ClassB"/>
  497.           <col class="columnPosition"/>
  498.           <col class="columnName"/>
  499.           <col class="columnName"/>
  500.         </colgroup>
  501.       </xsl:when>
  502.       <xsl:when test="@NumberClasses=3">
  503.         <colgroup>
  504.           <col class="columnTime"/>
  505.           <col class="columnTheme3ClassB"/>
  506.           <col class="columnPosition"/>
  507.           <col class="columnName"/>
  508.           <col class="columnName"/>
  509.           <col class="columnName"/>
  510.         </colgroup>
  511.       </xsl:when>
  512.     </xsl:choose>
  513.   </xsl:template>
  514.  
  515.   <!--Living As Christians-->
  516.   <xsl:template match="LAC">
  517.     <xsl:param name ="NameToHighlight"/>
  518.     <table class="tableLAC" cellspacing="0" cellpadding="0">
  519.       <xsl:call-template name="SetColumnWidths"/>
  520.  
  521.       <xsl:call-template name="SectionHeading">
  522.         <xsl:with-param name="strSection">LAC</xsl:with-param>
  523.         <xsl:with-param name="iSpanColumns">4</xsl:with-param>
  524.       </xsl:call-template>
  525.  
  526.       <tr>
  527.         <xsl:apply-templates select="SongMiddle" />
  528.       </tr>
  529.       <xsl:apply-templates select="LACItem">
  530.         <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  531.       </xsl:apply-templates>
  532.  
  533.       <xsl:choose>
  534.         <xsl:when test="@CircuitVisit=0">
  535.           <xsl:apply-templates select="CongregationBibleStudy">
  536.             <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  537.           </xsl:apply-templates>
  538.           <xsl:apply-templates select="ClosingComments"/>
  539.         </xsl:when>
  540.         <xsl:otherwise>
  541.           <xsl:apply-templates select="ClosingComments"/>
  542.           <xsl:apply-templates select="CircuitVisit/LACItem">
  543.             <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  544.           </xsl:apply-templates>
  545.         </xsl:otherwise>
  546.       </xsl:choose>
  547.  
  548.       <tr>
  549.         <xsl:apply-templates select="SongEnd"/>
  550.         <xsl:apply-templates select="PrayerEnd">
  551.           <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  552.         </xsl:apply-templates>
  553.       </tr>
  554.     </table>
  555.   </xsl:template>
  556.  
  557.   <xsl:template name="SectionHeading">
  558.     <xsl:param name="strSection"/>
  559.     <xsl:param name="iSpanColumns"/>
  560.     <tr>
  561.       <td class="cell{$strSection}" colspan="{$iSpanColumns}">
  562.         <div class="text{$strSection}">
  563.           <xsl:value-of select="//Labels/*[name() = $strSection]"/>
  564.         </div>
  565.       </td>
  566.       <xsl:if test="@NumberClasses = 3">
  567.         <td class="cellClass">
  568.           <xsl:value-of select="//Labels/AuxClass1"/>
  569.         </td>
  570.         <td class="cellClass">
  571.           <xsl:value-of select="//Labels/AuxClass2"/>
  572.         </td>
  573.       </xsl:if>
  574.       <xsl:if test="@NumberClasses = 2">
  575.         <td class="cellClass">
  576.           <xsl:value-of select="//Labels/AuxClass"/>
  577.         </td>
  578.       </xsl:if>
  579.       <xsl:if test="@NumberClasses &gt;= 1">
  580.         <td class="cellClass">
  581.           <xsl:value-of select ="//Labels/MainHall"/>
  582.         </td>
  583.       </xsl:if>
  584.     </tr>
  585.   </xsl:template>
  586.  
  587.   <xsl:template match="LACItem">
  588.     <xsl:param name ="NameToHighlight"/>
  589.     <tr>
  590.       <xsl:apply-templates select="Time" mode="End"/>
  591.       <td class="cellTheme" colspan="2">
  592.         <span class="bulletLAC">&#8226;</span>
  593.         <xsl:apply-templates select="Theme"/>
  594.         <xsl:apply-templates select="Time" mode="Duration"/>
  595.         <xsl:apply-templates select="Method"/>
  596.       </td>
  597.       <xsl:apply-templates select="Name">
  598.         <xsl:with-param name="NameToHighlight" select="$NameToHighlight"/>
  599.       </xsl:apply-templates>
  600.     </tr>
  601.   </xsl:template>
  602.  
  603.   <!--Displays the congregation bible study information-->
  604.   <xsl:template match="CongregationBibleStudy">
  605.     <xsl:param name ="NameToHighlight"/>
  606.     <tr>
  607.       <xsl:apply-templates select="Time" mode="End"/>
  608.       <td class="cellTheme">
  609.         <span class="bulletLAC">&#8226;</span>
  610.         <span class="textTheme">
  611.           <xsl:value-of select="//Labels/CBS"/>
  612.         </span>
  613.         <xsl:apply-templates select="Time" mode="Duration"/>
  614.         <xsl:apply-templates select="SourceMaterial" />
  615.       </td>
  616.       <td class="cellPosition">
  617.         <xsl:value-of select="//Labels/Conductor"/>
  618.         <br/>
  619.         <xsl:value-of select="//Labels/Reader"/>
  620.       </td>
  621.       <td class="cellName">
  622.         <xsl:choose>
  623.           <xsl:when test="Conductor/@Duplicate=1">
  624.             <span class="textDuplicate">
  625.               <xsl:value-of select="Conductor"/>
  626.             </span>
  627.           </xsl:when>
  628.           <xsl:when test="Conductor=$NameToHighlight">
  629.             <span class="textHighlight">
  630.               <xsl:value-of select="Conductor"/>
  631.             </span>
  632.           </xsl:when>
  633.           <xsl:otherwise>
  634.             <xsl:value-of select="Conductor"/>
  635.           </xsl:otherwise>
  636.         </xsl:choose>
  637.         <br/>
  638.         <xsl:choose>
  639.           <xsl:when test="Reader/@Duplicate=1">
  640.             <span class="textDuplicate">
  641.               <xsl:value-of select="Reader"/>
  642.             </span>
  643.           </xsl:when>
  644.           <xsl:when test="Reader=$NameToHighlight">
  645.             <span class="textHighlight">
  646.               <xsl:value-of select="Reader"/>
  647.             </span>
  648.           </xsl:when>
  649.           <xsl:otherwise>
  650.             <xsl:value-of select="Reader"/>
  651.           </xsl:otherwise>
  652.         </xsl:choose>
  653.       </td>
  654.     </tr>
  655.   </xsl:template>
  656.  
  657.   <!--Displays the song information-->
  658.   <xsl:template match="SongOpen | SongMiddle | SongEnd">
  659.     <td class="cellTime">
  660.       <xsl:value-of select="@EndTime24"/>
  661.     </td>
  662.     <td class="cellTheme">
  663.       <xsl:if test="self::SongMiddle">
  664.         <xsl:attribute name="colspan">3</xsl:attribute>
  665.         <xsl:attribute name="class"></xsl:attribute>
  666.       </xsl:if>
  667.       <span>
  668.         <xsl:attribute name="class">
  669.           <xsl:choose>
  670.             <xsl:when test="self::SongOpen">bulletTFGW</xsl:when>
  671.             <xsl:otherwise>bulletLAC</xsl:otherwise>
  672.           </xsl:choose>
  673.         </xsl:attribute>
  674.         <xsl:text>&#8226;</xsl:text>
  675.       </span>
  676.       <span class="textSongLabel">
  677.         <xsl:value-of select="//Labels/Song"/>
  678.       </span>
  679.       <span class="textSongNumber">
  680.         <xsl:value-of select="."/>
  681.       </span>
  682.       <span class="textSongTitle">
  683.         <xsl:value-of select="@Title"/>
  684.       </span>
  685.     </td>
  686.     <xsl:if test="self::SongOpen or self::SongEnd">
  687.       <td class="cellPosition">
  688.         <xsl:value-of select="//Labels/Prayer"/>
  689.       </td>
  690.     </xsl:if>
  691.   </xsl:template>
  692.  
  693.   <!--Displays the comments-->
  694.   <xsl:template name="Comments">
  695.     <xsl:param name="bulletClass" />
  696.     <tr>
  697.       <xsl:apply-templates select="Time" mode="End"/>
  698.       <td class="cellTheme" colspan="2">
  699.         <span class="{ $bulletClass }">&#8226;</span>
  700.         <xsl:apply-templates select="Theme"/>
  701.         <xsl:apply-templates select="Time" mode="Duration"/>
  702.       </td>
  703.       <xsl:call-template name="Chairman"/>
  704.     </tr>
  705.   </xsl:template>
  706.  
  707.   <xsl:template match="OpeningComments">
  708.     <xsl:call-template name="Comments">
  709.       <xsl:with-param name="bulletClass">bulletTFGW</xsl:with-param>
  710.     </xsl:call-template>
  711.   </xsl:template>
  712.  
  713.   <xsl:template match="ClosingComments">
  714.     <xsl:call-template name="Comments">
  715.       <xsl:with-param name="bulletClass">bulletLAC</xsl:with-param>
  716.     </xsl:call-template>
  717.   </xsl:template>
  718.  
  719.   <xsl:template match="PUBLICTALK">
  720.     <table class="tableWeekend">
  721.       <tr>
  722.         <td class ="cellWEEKEND" colspan="2">
  723.           <div class="textWEEKEND" style="float:left">
  724.             <xsl:value-of select="//Labels/PTS_WeekendMeeting"/>
  725.           </div>
  726.           <div style="float:right">
  727.             <span class="textPTSLabel">
  728.               <xsl:value-of select="//Labels/PTS_Chairman"/>:
  729.             </span>
  730.             &#160;<span class="textPTSValue">
  731.               <xsl:value-of select="Assignments/Chairman"/>
  732.             </span>
  733.           </div>
  734.         </td>
  735.       </tr>
  736.       <xsl:apply-templates select="HomeTalk"/>
  737.       <xsl:apply-templates select="AwayTalk"/>
  738.       <xsl:apply-templates select="Assignments"/>
  739.     </table>
  740.   </xsl:template>
  741.  
  742.   <!--Displays the home talk speaker details-->
  743.   <xsl:template match="HomeTalk">
  744.     <tr>
  745.       <td class="cellWEEKENDText">
  746.         <span class="textPTSLabel">
  747.           <xsl:value-of select="//Labels/PTS_Speaker"/>:
  748.         </span>
  749.         &#160;<span class="textPTSValue">
  750.           <xsl:value-of select="Speaker"/>
  751.         </span>
  752.       </td>
  753.       <td>
  754.         <span class="textPTSLabel">
  755.           <xsl:value-of select="//Labels/PTS_Congregation"/>:
  756.         </span>
  757.         &#160;<span class="textPTSValue">
  758.           <xsl:value-of select="Congregation"/>
  759.         </span>
  760.       </td>
  761.     </tr>
  762.     <tr>
  763.       <td class="cellWEEKENDText" colspan="2">
  764.         <span class="textPTSLabel">
  765.           <xsl:value-of select="//Labels/PTS_Theme"/>:
  766.         </span>
  767.         &#160;<span class="textPTSValue">
  768.           <xsl:value-of select="Theme"/>
  769.         </span>
  770.       </td>
  771.     </tr>
  772.   </xsl:template>
  773.  
  774.   <xsl:template match="AwayTalk">
  775.     <tr>
  776.       <td class="cellWEEKENDText" colspan="2">
  777.         <span class="textPTSLabel">
  778.           <xsl:choose>
  779.             <!--We only support 2 away speakers. We could just use one label-->
  780.             <xsl:when test="position()=1">
  781.               <xsl:value-of select="//Labels/PTS_AwaySpeaker1"/>:
  782.             </xsl:when>
  783.             <xsl:otherwise>
  784.               <xsl:value-of select="//Labels/PTS_AwaySpeaker2"/>:
  785.             </xsl:otherwise>
  786.           </xsl:choose>
  787.         </span>
  788.         &#160;<span class="textPTSValue">
  789.           <xsl:value-of select="Speaker"/>&#160;(<xsl:value-of select="Congregation"/>)
  790.         </span>
  791.       </td>
  792.     </tr>
  793.   </xsl:template>
  794.  
  795.   <!--Displays the Watchtower conductor and reader-->
  796.   <xsl:template match="Assignments">
  797.     <tr>
  798.       <td class="cellWEEKENDText">
  799.         <span class="textPTSLabel">
  800.           <xsl:value-of select="//Labels/PTS_WTConductor"/>:
  801.         </span>
  802.         &#160;<span class="textPTSValue">
  803.           <xsl:value-of select="Conductor"/>
  804.         </span>
  805.       </td>
  806.       <td>
  807.         <span class="textPTSLabel">
  808.           <xsl:value-of select="//Labels/PTS_WTReader"/>:
  809.         </span>
  810.         &#160;<span class="textPTSValue">
  811.           <xsl:value-of select="Reader"/>
  812.         </span>
  813.       </td>
  814.     </tr>
  815.   </xsl:template>
  816. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement