Advertisement
TheocraticSoftware

Worksheet-Style 2-TWI.xsl

Dec 27th, 2016
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 17.62 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">
  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.   <xsl:template match="/">
  7.     <html xmlns="http://www.w3.org/1999/xhtml">
  8.       <head>
  9.         <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  10.         <title>
  11.           <xsl:value-of select="//Labels/ReportTitleWorksheets"/>
  12.         </title>
  13.         <style type="text/css">
  14.           .textReportTitle {
  15.           text-align: center;
  16.           font-family: Calibri;
  17.           font-size: 16pt;
  18.           color: #581845;
  19.           }
  20.           table td {
  21.           border: 1px gray solid ;
  22.           }
  23.           table tbody tr:hover td {
  24.           color: #000;
  25.           background: #efefef;
  26.           }
  27.           .tableBorders {
  28.           border: 1px solid #808080;
  29.           margin-bottom: 5mm;
  30.           }
  31.           .textItem {
  32.           font-family: Calibri;
  33.           font-size: 12pt;
  34.           }
  35.           .textItemWithPadding {
  36.           font-family: Calibri;
  37.           font-size: 12pt;
  38.           padding-left: 3mm;
  39.           }
  40.           .textTime {
  41.           text-align: center;
  42.           font-family: Calibri;
  43.           font-size: 12pt;
  44.           }
  45.           .textMargin {
  46.           padding-left: 10mm;
  47.           }
  48.           .textTFGW {
  49.           background-color: #606a70;
  50.           font-family: calibri;
  51.           color: #FFFFFF;
  52.           }
  53.           .textAYFM {
  54.           background-color: #c18626;
  55.           font-family: calibri;
  56.           color: #FFFFFF;
  57.           }
  58.           .textLAC {
  59.           background-color: #961526;
  60.           font-family: calibri;
  61.           color: #FFFFFF;
  62.           }
  63.           .textCBS {
  64.           font-family: Calibri;
  65.           font-size: 12pt;
  66.           }
  67.           .tableStudents {
  68.           border-collapse: collapse;
  69.           font-size: 10pt;
  70.           }
  71.           .tableStudents td {
  72.           border-style: none;
  73.           }
  74.         </style>
  75.       </head>
  76.       <body>
  77.  
  78.         <xsl:for-each select="MeetingWorkBook/Meeting">
  79.           <!--We only add the page breaks when we are in "Print Preview" mode-->
  80.           <xsl:if test="InsertPageBreak=1">
  81.             <!--This seems to be the only way to insert a page break-->
  82.             <br style="page-break-before: always;"/>
  83.           </xsl:if>
  84.  
  85.           <!--The report title (chairman name and date)-->
  86.           <p class="textReportTitle">
  87.             <strong>
  88.               Oguamtrani Krataasin (<xsl:value-of select="Chairman"/>) <xsl:value-of select="Date"/>
  89.             </strong>
  90.           </p>
  91.  
  92.           <!--Opening song and prayer-->
  93.           <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  94.             <colgroup>
  95.               <col width="65%" />
  96.               <col width="25%" />
  97.               <col width="10%" />
  98.             </colgroup>
  99.             <tr>
  100.               <xsl:apply-templates select="SongOpen"/>
  101.               <xsl:apply-templates select="Prayer1"/>
  102.               <td class="textTime">Wie</td>
  103.             </tr>
  104.           </table>
  105.  
  106.           <!--Opening comments-->
  107.           <xsl:apply-templates select="OpeningComments"/>
  108.  
  109.           <!--Main meeting sections-->
  110.           <xsl:call-template name="TFGW"/>
  111.           <xsl:call-template name="AYFM"/>
  112.           <xsl:call-template name="LAC"/>
  113.  
  114.           <!--Circuit Visit Item or Closing song?-->
  115.           <xsl:choose>
  116.             <xsl:when test="CircuitVisit=1">
  117.               <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  118.                 <colgroup>
  119.                   <col width="65%" />
  120.                   <col width="25%" />
  121.                   <col width="10%" />
  122.                 </colgroup>
  123.                 <tr>
  124.                   <td class="textItem">
  125.                     <xsl:text>Ɔmansin Sohwɛfoɔ Som Kasa</xsl:text>
  126.                   </td>
  127.                   <td class="textItem">
  128.                     <xsl:value-of select="//Labels/Prayer"/>
  129.                     <xsl:text> </xsl:text>
  130.                     <xsl:value-of select="Prayer2"/>
  131.                   </td>
  132.                   <td class="textTime">
  133.                     <xsl:value-of select="SongEnd/@EndTime12"/>
  134.                   </td>
  135.                 </tr>
  136.                 <tr>
  137.                   <td colspan="3">
  138.                     <xsl:value-of select="LivingAsChristians/ItemCircuitOverseer/Theme"/>
  139.                   </td>
  140.                 </tr>
  141.               </table>
  142.             </xsl:when>
  143.             <xsl:otherwise>
  144.               <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  145.                 <colgroup>
  146.                   <col width="65%" />
  147.                   <col width="25%" />
  148.                   <col width="10%" />
  149.                 </colgroup>
  150.                 <tr>
  151.                   <xsl:apply-templates select="SongEnd"/>
  152.                   <xsl:apply-templates select="Prayer2"/>
  153.                   <td class="textTime">
  154.                     <xsl:value-of select="SongEnd/@EndTime12"/>
  155.                   </td>
  156.                 </tr>
  157.               </table>
  158.             </xsl:otherwise>
  159.           </xsl:choose>
  160.         </xsl:for-each>
  161.       </body>
  162.     </html>
  163.   </xsl:template>
  164.  
  165.   <!--Treasures From God's Word-->
  166.   <xsl:template name="TFGW">
  167.     <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  168.       <colgroup>
  169.         <col width="65%" />
  170.         <col width="25%" />
  171.         <col width="10%" />
  172.       </colgroup>
  173.       <tr>
  174.         <td class="textTFGW" colspan="3">
  175.           <xsl:value-of select="//Labels/TreasuresFromGodsWord"/>
  176.         </td>
  177.       </tr>
  178.       <xsl:apply-templates select="Treasures1"/>
  179.       <xsl:apply-templates select="Treasures2"/>
  180.       <xsl:apply-templates select="BibleReadingM"/>
  181.     </table>
  182.   </xsl:template>
  183.  
  184.   <!--Apply Yourself To The Field Ministry-->
  185.   <xsl:template name="AYFM">
  186.     <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  187.       <xsl:choose>
  188.         <xsl:when test="FirstWeekOfMonth=1">
  189.           <colgroup>
  190.             <col width="65%" />
  191.             <col width="25%" />
  192.             <col width="10%" />
  193.           </colgroup>
  194.           <tr>
  195.             <td class="textAYFM" colspan="3">
  196.               <xsl:value-of select="//Labels/ApplyYourselfToTheFieldMinistry"/>
  197.             </td>
  198.           </tr>
  199.           <xsl:apply-templates select="Presentations" />
  200.         </xsl:when>
  201.         <xsl:otherwise>
  202.           <colgroup>
  203.             <col width="20%" />
  204.             <col width="45%" />
  205.             <col width="25%" />
  206.             <col width="10%" />
  207.           </colgroup>
  208.           <tr>
  209.             <td class="textAYFM" colspan="4">
  210.               <xsl:value-of select="//Labels/ApplyYourselfToTheFieldMinistry"/>
  211.             </td>
  212.           </tr>
  213.           <tr>
  214.             <td class="textItem">Afà</td>
  215.             <td class="textItem">Asuafoɔ</td>
  216.             <td class="textItem">Kwan a wɔfa so Yɛ</td>
  217.             <td class="textTime">
  218.               &#160;
  219.             </td>
  220.           </tr>
  221.           <xsl:apply-templates select="StudentTalk1M"/>
  222.           <xsl:apply-templates select="StudentTalk2M"/>
  223.           <xsl:apply-templates select="StudentTalk3M"/>
  224.         </xsl:otherwise>
  225.       </xsl:choose>
  226.     </table>
  227.   </xsl:template>
  228.  
  229.   <!--Living As Christians-->
  230.   <xsl:template name="LAC">
  231.     <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  232.       <colgroup>
  233.         <col width="90%" />
  234.         <col width="10%" />
  235.       </colgroup>
  236.       <tr>
  237.         <td class="textLAC" colspan="2">
  238.           <xsl:value-of select="//Labels/LivingAsChristians"/>
  239.         </td>
  240.       </tr>
  241.       <xsl:apply-templates select="SongMiddle"/>
  242.     </table>
  243.     <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  244.       <colgroup>
  245.         <col width="65%" />
  246.         <col width="25%" />
  247.         <col width="10%" />
  248.       </colgroup>
  249.       <xsl:apply-templates select="LivingAsChristians/Item1"/>
  250.       <xsl:apply-templates select="LivingAsChristians/Item2"/>
  251.       <xsl:choose>
  252.         <xsl:when test="CircuitVisit=1">
  253.           <xsl:apply-templates select="ClosingComments"/>
  254.         </xsl:when>
  255.         <xsl:otherwise>
  256.           <xsl:apply-templates select="LivingAsChristians/CongregationBibleStudy"/>
  257.           <xsl:apply-templates select="ClosingComments"/>
  258.         </xsl:otherwise>
  259.       </xsl:choose>
  260.     </table>
  261.   </xsl:template>
  262.  
  263.   <!--Congregation Bible Study-->
  264.   <xsl:template match="CongregationBibleStudy">
  265.     <tr>
  266.       <td class="textItemWithPadding">
  267.         <xsl:value-of select="//Labels/CongregationBibleStudy"/>
  268.         <xsl:text>: </xsl:text>
  269.         <xsl:value-of select="SourceMaterial"/>
  270.       </td>
  271.       <td class="textCBS" valign="top">
  272.         <xsl:value-of select="Conductor"/>
  273.         <xsl:text>/</xsl:text>
  274.         <xsl:value-of select="Reader"/>
  275.         <xsl:text> (</xsl:text>
  276.         <xsl:value-of select="//Labels/CBSReader"/>
  277.         <xsl:text>)</xsl:text>
  278.       </td>
  279.       <td class="textTime">
  280.         <xsl:value-of select="Time/@EndTime12"/>
  281.       </td>
  282.     </tr>
  283.   </xsl:template>
  284.  
  285.   <!--First student - Main Hall-->
  286.   <xsl:template match="StudentTalk1M">
  287.     <tr>
  288.       <td class="textItem">
  289.         <xsl:value-of select="../StudentSourceMaterial/StudentTalk1Type"/>
  290.       </td>
  291.       <td class="textItem">
  292.         <xsl:value-of select="."/>
  293.         <xsl:text> (</xsl:text>
  294.         <xsl:value-of select="@StudyPoint"/>
  295.         <xsl:text>)</xsl:text>
  296.         <xsl:text>/</xsl:text>
  297.         <xsl:value-of select="../StudentTalk1MA"/>
  298.       </td>
  299.       <td class="textItem">
  300.         &#160;
  301.       </td>
  302.       <td class="textTime">
  303.         <xsl:value-of select="../StudentTalk1Time/@EndTime12"/>
  304.       </td>
  305.     </tr>
  306.   </xsl:template>
  307.  
  308.   <!--Second student - Main Hall-->
  309.   <xsl:template match="StudentTalk2M">
  310.     <tr>
  311.       <td class="textItem">
  312.         <xsl:value-of select="../StudentSourceMaterial/StudentTalk2Type"/>
  313.       </td>
  314.       <td class="textItem">
  315.         <xsl:value-of select="."/>
  316.         <xsl:text> (</xsl:text>
  317.         <xsl:value-of select="@StudyPoint"/>
  318.         <xsl:text>)</xsl:text>
  319.         <xsl:text>/</xsl:text>
  320.         <xsl:value-of select="../StudentTalk2MA"/>
  321.       </td>
  322.       <td class="textItem">
  323.         &#160;
  324.       </td>
  325.       <td class="textTime">
  326.         <xsl:value-of select="../StudentTalk2Time/@EndTime12"/>
  327.       </td>
  328.     </tr>
  329.   </xsl:template>
  330.  
  331.   <!--Third student - Main Hall-->
  332.   <xsl:template match="StudentTalk3M">
  333.     <tr>
  334.       <td class="textItem">
  335.         <xsl:value-of select="../StudentSourceMaterial/StudentTalk3Type"/>
  336.       </td>
  337.       <td class="textItem">
  338.         <xsl:value-of select="."/>
  339.         <xsl:text> (</xsl:text>
  340.         <xsl:value-of select="@StudyPoint"/>
  341.         <xsl:text>)</xsl:text>
  342.         <!--Do we include assistant?-->
  343.         <xsl:if test="../StudentSourceMaterial/StudentTalk3Type/@IsTalk=0">
  344.           <xsl:text>/</xsl:text>
  345.           <xsl:value-of select="../StudentTalk3MA"/>
  346.         </xsl:if>
  347.       </td>
  348.       <td class="textItem">
  349.         &#160;
  350.       </td>
  351.       <td class="textTime">
  352.         <xsl:value-of select="../StudentTalk3Time/@EndTime12"/>
  353.       </td>
  354.     </tr>
  355.   </xsl:template>
  356.  
  357.   <xsl:template match="Item1|Item2|ItemCircuitOverseer|Presentations|Treasures1|Treasures2">
  358.     <tr>
  359.       <td class="textItemWithPadding">
  360.         <xsl:value-of select="Theme" disable-output-escaping="yes"/>
  361.       </td>
  362.       <td class="textItem">
  363.         <xsl:value-of select="Name"/>
  364.       </td>
  365.       <td class="textTime">
  366.         <xsl:value-of select="Time/@EndTime12"/>
  367.       </td>
  368.     </tr>
  369.   </xsl:template>
  370.  
  371.   <!--Bible Reading - Main Hall-->
  372.   <xsl:template match="BibleReadingM">
  373.     <tr>
  374.       <td class="textItemWithPadding">
  375.         <xsl:value-of select="//Labels/BibleReading"/>
  376.         <xsl:text>: </xsl:text>
  377.         <xsl:value-of select="../StudentSourceMaterial/BibleReadingMaterial"/>
  378.       </td>
  379.       <td class="textItem">
  380.         <xsl:value-of select="."/>
  381.         <xsl:text> (# </xsl:text>
  382.         <xsl:value-of select="@StudyPoint"/>
  383.         <xsl:text>)</xsl:text>
  384.       </td>
  385.       <td class="textTime">
  386.         <xsl:value-of select="../BibleReadingTime/@EndTime12"/>
  387.       </td>
  388.     </tr>
  389.   </xsl:template>
  390.  
  391.   <xsl:template match="OpeningComments">
  392.     <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  393.       <colgroup>
  394.         <col width="90%" />
  395.         <col width="10%" />
  396.       </colgroup>
  397.       <tr>
  398.         <td class="textItem">
  399.           <xsl:value-of select="../WeeklyBibleReading"/>
  400.           <xsl:text>: </xsl:text>
  401.           <xsl:value-of select ="Theme"/>
  402.           <br />
  403.           <span class="textMargin">
  404.             (1) <xsl:value-of select="../ReviewQuestion"/>
  405.           </span>
  406.           <br />
  407.           <br />
  408.           <br />
  409.           <br />
  410.         </td>
  411.         <td class="textTime">
  412.           <xsl:value-of select="Time/@EndTime12"/>
  413.         </td>
  414.       </tr>
  415.     </table>
  416.   </xsl:template>
  417.  
  418.   <xsl:template match="ClosingComments">
  419.     <xsl:variable name="AssignHistory" select="document('AssignHistory.xml')"/>
  420.     <xsl:variable name="week" select="../Date/@NextWeek"/>
  421.     <table cellpadding="1" cellspacing="0" class="tableBorders" style="width: 100%">
  422.       <colgroup>
  423.         <col width="90%" />
  424.         <col width="10%" />
  425.       </colgroup>
  426.       <tr>
  427.         <!--Concluding comments-->
  428.         <td class="textItem">
  429.           <xsl:text>Ntimu ne Nea Yebesua Nnawɔtwe a Edi Hɔ</xsl:text>
  430.           <br />
  431.           <span class="textMargin">
  432.             <xsl:text>(1) </xsl:text>
  433.             <xsl:variable name="NextReviewQuestion" select="$AssignHistory/AssignmentHistory/*[name()=$week]/ReviewQuestion"/>
  434.             <xsl:if test="normalize-space($NextReviewQuestion) != ''">
  435.               <xsl:value-of select="$NextReviewQuestion"/>
  436.             </xsl:if>
  437.           </span>
  438.           <br />
  439.           <br />
  440.         </td>
  441.         <td class="textTime" rowspan="3">
  442.           <xsl:value-of select="Time/@EndTime12"/>
  443.         </td>
  444.       </tr>
  445.       <!--Next weeks students-->
  446.       <tr>
  447.         <td class="textItem">
  448.           <xsl:text>Nnawɔtwe a Ɛdi hɔ:</xsl:text>
  449.           <br />
  450.           <table cellpadding="1" class="tableStudents" width="100%">
  451.             <colgroup>
  452.               <col width="20%" />
  453.               <col width="80%" />
  454.             </colgroup>
  455.  
  456.             <tr>
  457.               <td>&#160;</td>
  458.               <td>
  459.                 <xsl:value-of select="//Labels/MainHall"/>
  460.               </td>
  461.             </tr>
  462.             <xsl:apply-templates select="$AssignHistory/AssignmentHistory/*[name()=$week]/StudentItems">
  463.               <xsl:with-param name="MainHall" select="//Labels/MainHall"/>
  464.             </xsl:apply-templates>
  465.           </table>
  466.         </td>
  467.       </tr>
  468.       <!--Announcements/Letters-->
  469.       <tr>
  470.         <td class="textItem">
  471.           <xsl:text>Nkaebɔ/Betel Krataa</xsl:text>
  472.           <br />
  473.           <br />
  474.           <br />
  475.           <br />
  476.         </td>
  477.       </tr>
  478.     </table>
  479.   </xsl:template>
  480.  
  481.   <!--Student items - we are only catering for the Main Hall-->
  482.   <xsl:template match="StudentItems">
  483.     <xsl:param name="MainHall"/>
  484.     <xsl:for-each select="Item[contains('|1|2|4|6|', concat('|', position(), '|'))]">
  485.       <tr>
  486.         <td>
  487.           <xsl:value-of select="Description"/>
  488.         </td>
  489.         <td>
  490.           <xsl:value-of select="Name"/>
  491.           <!--Do we need to include an assistant?-->
  492.           <xsl:if test="position() &gt;= 1">
  493.             <xsl:if test="normalize-space(following-sibling::*[1]/Name) != ''">
  494.               <xsl:text>/</xsl:text>
  495.               <xsl:value-of select="following-sibling::*[1]/Name"/>
  496.             </xsl:if>
  497.           </xsl:if>
  498.         </td>
  499.       </tr>
  500.     </xsl:for-each>
  501.   </xsl:template>
  502.  
  503.   <!--Open / Close song-->
  504.   <xsl:template match="SongOpen|SongEnd">
  505.     <td class="textItemWithPadding">
  506.       <xsl:value-of select="//Labels/Song"/>
  507.       <xsl:text> </xsl:text>
  508.       <xsl:value-of select="."/>
  509.       <xsl:text> - </xsl:text>
  510.       <xsl:value-of select="@Title"/>
  511.       <xsl:variable name="ScripturesForSongs" select="document('ScripturesForSongs.xml')"/>
  512.       <xsl:variable name="SongNumber" select="."/>
  513.       &#160;
  514.       <xsl:value-of select="$ScripturesForSongs/ScripturesForSongs/Song[@Number=$SongNumber]"/>
  515.     </td>
  516.   </xsl:template>
  517.  
  518.   <!--Middle song-->
  519.   <xsl:template match="SongMiddle">
  520.     <tr>
  521.       <td class="textItemWithPadding">
  522.         <xsl:value-of select="//Labels/Song"/>
  523.         <xsl:text> </xsl:text>
  524.         <xsl:value-of select="."/>
  525.         <xsl:text> - </xsl:text>
  526.         <xsl:value-of select="@Title"/>
  527.         <xsl:variable name="ScripturesForSongs" select="document('ScripturesForSongs.xml')"/>
  528.         <xsl:variable name="SongNumber" select="."/>
  529.         &#160;
  530.         <xsl:value-of select="$ScripturesForSongs/ScripturesForSongs/Song[@Number=$SongNumber]"/>
  531.       </td>
  532.       <td class="textTime">
  533.         <xsl:value-of select="@EndTime12"/>
  534.       </td>
  535.     </tr>
  536.   </xsl:template>
  537.  
  538.   <!--Open / Close Prayer-->
  539.   <xsl:template match="Prayer1|Prayer2">
  540.     <td class="textItem">
  541.       <xsl:value-of select="//Labels/Prayer"/>
  542.       <xsl:text> </xsl:text>
  543.       <xsl:value-of select="."/>
  544.     </td>
  545.   </xsl:template>
  546.  
  547. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement