TheocraticSoftware

Workbook-S-140-Simplified-ITA.xsl

Dec 27th, 2016
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 13.48 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.       <xsl:attribute name="lang">
  9.         <xsl:value-of select="//Settings//LanguageCode"/>
  10.       </xsl:attribute>
  11.       <xsl:attribute name="dir">
  12.         <xsl:value-of select="//Settings/Direction"/>
  13.       </xsl:attribute>
  14.       <head>
  15.         <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  16.         <title>Programma Adunanze</title>
  17.         <style type="text/css">
  18.           .Page {
  19.           background: #666;
  20.           font-family: Calibri;
  21.           font-size: 12pt;
  22.           width: 100%;
  23.           margin-left: 0mm;
  24.           margin-right: 0mm;
  25.           }
  26.  
  27.           .containerPage {
  28.           background: #fff;
  29.           margin-left:25mm;
  30.           margin-right:25mm;
  31.           }
  32.  
  33.           .containerMeetingOdd {
  34.           margin-bottom: 6mm;
  35.           }
  36.  
  37.           .containerMeetingEven {
  38.           padding-top:10mm;
  39.           border-top: 1px #000 dashed;
  40.           }
  41.  
  42.           .HeadingPage {
  43.           width: 100%;
  44.           color: #fff;
  45.           background-color: #0070C0;
  46.           text-transform: uppercase;
  47.           text-align: center;
  48.           margin-bottom: 2mm;
  49.           font-size: 16pt;
  50.           font-weight: 700;
  51.           }
  52.  
  53.           .HeadingDate {
  54.           width: 100%;
  55.           color: #fff;
  56.           background-color: #366092;
  57.           text-transform: uppercase;
  58.           text-align: center;
  59.           margin-bottom: 2mm;
  60.           font-weight: 700;
  61.           font-size: 12pt;
  62.           }
  63.  
  64.           .HeadingMidweekMeeting {
  65.           width: 100%;
  66.           color: #fff;
  67.           background-color: #44546A;
  68.           text-transform: uppercase;
  69.           text-align: center;
  70.           margin-bottom: 2mm;
  71.           font-weight: 700;
  72.           }
  73.  
  74.           .HeadingTFGW {
  75.           width: 100%;
  76.           color: #fff;
  77.           background-color: #606a70;
  78.           text-transform: uppercase;
  79.           text-align: center;
  80.           margin-bottom: 2mm;
  81.           font-weight: 700;
  82.           }
  83.  
  84.           .HeadingAYFM {
  85.           width: 100%;
  86.           color: #fff;
  87.           background-color: #c18626;
  88.           text-transform: uppercase;
  89.           text-align: center;
  90.           margin-bottom: 2mm;
  91.           font-weight: 700;
  92.           }
  93.  
  94.           .HeadingLAC {
  95.           width: 100%;
  96.           color: #fff;
  97.           background-color: #961526;
  98.           text-transform: uppercase;
  99.           text-align: center;
  100.           margin-bottom: 2mm;
  101.           font-weight: 700;
  102.           }
  103.  
  104.           .HeadingWEEKEND {
  105.           width: 100%;
  106.           color: #fff;
  107.           background-color: #44546A;
  108.           text-transform: uppercase;
  109.           text-align: center;
  110.           margin-top: 2mm;
  111.           margin-bottom: 2mm;
  112.           font-weight: 700;
  113.           }
  114.  
  115.           .HeadingPUBLICTALK {
  116.           width: 100%;
  117.           color: #fff;
  118.           background-color: #A9D08E;
  119.           text-transform: uppercase;
  120.           text-align: center;
  121.           margin-bottom: 2mm;
  122.           font-weight: 700;
  123.           }
  124.  
  125.           .HeadingWATCHTOWER {
  126.           width: 100%;
  127.           color: #fff;
  128.           background-color: #8EA9DB;
  129.           text-transform: uppercase;
  130.           text-align: center;
  131.           margin-bottom: 2mm;
  132.           font-weight: 700;
  133.           }
  134.  
  135.           .HeadingSERVICETALK {
  136.           width: 100%;
  137.           color: #fff;
  138.           background-color: #8EA9DB;
  139.           text-transform: uppercase;
  140.           text-align: center;
  141.           margin-bottom: 2mm;
  142.           font-weight: 700;
  143.           }
  144.  
  145.           .Items {
  146.           width: 100%;
  147.           margin-bottom: 2mm;
  148.           border-collapse: collapse;
  149.           }
  150.  
  151.           .Items tbody tr:hover td {
  152.           color: #000;
  153.           background: #efefef;
  154.           }
  155.  
  156.           .ItemTheme {
  157.           }
  158.  
  159.           .ItemName {
  160.           text-align: right;
  161.           }
  162.  
  163.           .ItemNotes{
  164.           font-size: 10pt;
  165.           text-align: center;
  166.           }
  167.  
  168.  
  169.           .textDuplicate {
  170.           background: #ff0000;
  171.           }
  172.  
  173.           @media print {
  174.           .Page {
  175.           background: #fff;
  176.           }
  177.  
  178.           .containerPage {
  179.           margin-left:0mm;
  180.           margin-right:0mm;
  181.           }
  182.           }
  183.  
  184.         </style>
  185.       </head>
  186.       <body class="Page">
  187.         <div class="containerPage">
  188.  
  189.           <xsl:for-each select="MeetingWorkBook/Meeting">
  190.             <xsl:if test="@PageBreak=1">
  191.               <br style="page-break-before: always;"/>
  192.             </xsl:if>
  193.             <xsl:if test="@PageBreak=1 or position()=1">
  194.               <xsl:apply-templates select="MeetingDate"/>
  195.             </xsl:if>
  196.             <div class="containerMeetingOdd">
  197.               <xsl:if test="(position() mod 2) != 1">
  198.                 <xsl:attribute name="class">containerMeetingEven</xsl:attribute>
  199.               </xsl:if>
  200.               <xsl:call-template name="MEETING"/>
  201.               <xsl:apply-templates select="TFGW"/>
  202.               <xsl:apply-templates select="AYFM"/>
  203.               <xsl:apply-templates select="LAC"/>
  204.               <xsl:apply-templates select="PUBLICTALK"/>
  205.             </div>
  206.           </xsl:for-each>
  207.         </div>
  208.       </body>
  209.     </html>
  210.   </xsl:template>
  211.  
  212.   <!--Assignment Theme-->
  213.   <xsl:template match="Theme">
  214.     <td class="ItemTheme">
  215.       <xsl:value-of select="." disable-output-escaping="yes"/>
  216.     </td>
  217.   </xsl:template>
  218.  
  219.   <!--Assignment Name-->
  220.   <xsl:template match="Chairman|Conductor|Name|PrayerOpen|PrayerEnd|Reader|Speaker">
  221.     <td class="ItemName">
  222.       <xsl:choose>
  223.         <xsl:when test="@Duplicate=1">
  224.           <span class="textDuplicate">
  225.             <xsl:value-of select="."/>
  226.           </span>
  227.         </xsl:when>
  228.         <xsl:otherwise>
  229.           <xsl:value-of select="."/>
  230.         </xsl:otherwise>
  231.       </xsl:choose>
  232.     </td>
  233.   </xsl:template>
  234.  
  235.   <xsl:template match="MeetingDate">
  236.     <div class="HeadingPage">
  237.       <xsl:text>Adunanze </xsl:text>
  238.       <xsl:value-of select="@MonthFull"/>
  239.       <xsl:text> </xsl:text>
  240.       <xsl:value-of select="@Year"/>
  241.     </div>
  242.   </xsl:template>
  243.  
  244.   <xsl:template name="MEETING">
  245.     <div class="HeadingDate">
  246.       <xsl:value-of select="Date" />
  247.       <xsl:text> | </xsl:text>
  248.       <xsl:value-of select="WeeklyBibleReading"/>
  249.     </div>
  250.     <!--TODO: We do not have a label for this-->
  251.     <div class="HeadingMidweekMeeting">Adunanza Infrasettimanale</div>
  252.     <table class="Items">
  253.       <xsl:apply-templates select="Note"/>
  254.       <tr>
  255.         <!--TODO: We do not have a label for this-->
  256.         <td class="ItemTheme">Presidente Vita e Ministero</td>
  257.         <xsl:apply-templates select="Chairman"/>
  258.       </tr>
  259.       <tr>
  260.         <td class="ItemTheme">
  261.           <xsl:value-of select="//Labels/Song"/>
  262.           <xsl:text> </xsl:text>
  263.           <xsl:value-of select="SongOpen"/>
  264.           <!--TODO: We not have labels for these-->
  265.           <xsl:text> e preghiera</xsl:text>
  266.         </td>
  267.         <xsl:apply-templates select="PrayerOpen"/>
  268.       </tr>
  269.     </table>
  270.   </xsl:template>
  271.  
  272.   <!--Treasures From God's Word-->
  273.   <xsl:template match="TFGW">
  274.     <div class="HeadingTFGW">
  275.       <xsl:value-of select="//Labels/TFGW"/>
  276.     </div>
  277.     <table class="Items">
  278.       <xsl:apply-templates select="TFGWItem" />
  279.       <xsl:apply-templates select="BibleReadingItem"/>
  280.     </table>
  281.   </xsl:template>
  282.  
  283.   <!--Item-->
  284.   <xsl:template match="LACItem|Presentations|TFGWItem">
  285.     <tr>
  286.       <xsl:apply-templates select="Theme"/>
  287.       <xsl:apply-templates select="Name" />
  288.     </tr>
  289.  
  290.     <xsl:if test="name()='Presentations'">
  291.       <tr>
  292.         <td>&#160;</td>
  293.         <td>&#160;</td>
  294.       </tr>
  295.       <tr>
  296.         <td>&#160;</td>
  297.         <td>&#160;</td>
  298.       </tr>
  299.     </xsl:if>
  300.   </xsl:template>
  301.  
  302.  
  303.   <xsl:template match="BibleReadingItem">
  304.     <tr>
  305.       <td class="ItemTheme">
  306.         <xsl:text>Lettura biblica: </xsl:text>
  307.         <xsl:value-of select="Material"/>
  308.       </td>
  309.       <td class="ItemName">
  310.         <xsl:value-of select="Readers[1]/Reader"/>
  311.       </td>
  312.     </tr>
  313.   </xsl:template>
  314.  
  315.   <!--Apply Yourself To The Field Ministry-->
  316.   <xsl:template match="AYFM">
  317.     <div class="HeadingAYFM">
  318.       <xsl:value-of select="//Labels/AYFM"/>
  319.     </div>
  320.     <table class="Items">
  321.       <xsl:apply-templates select="Presentations" />
  322.       <xsl:apply-templates select="StudentItem"/>
  323.     </table>
  324.   </xsl:template>
  325.  
  326.   <xsl:template match="StudentItem">
  327.     <tr>
  328.       <td class="ItemTheme">
  329.         <xsl:value-of select="Type"/>
  330.         <!--TODO: What about the theme if it is a talk?-->
  331.       </td>
  332.       <td class="ItemName">
  333.         <!--We want position 1-->
  334.         <xsl:value-of select="Students[1]/Student"/>
  335.         <xsl:if test="@IsTalk=0">
  336.           <xsl:text> / </xsl:text>
  337.           <xsl:value-of select="Students[1]/Assistant"/>
  338.         </xsl:if>
  339.       </td>
  340.     </tr>
  341.   </xsl:template>
  342.  
  343.   <xsl:template match="LAC">
  344.     <div class="HeadingLAC">
  345.       <xsl:value-of select="//Labels/LAC"/>
  346.     </div>
  347.     <table class="Items">
  348.       <tr>
  349.         <td class="ItemTheme" colspan="2">
  350.           <xsl:value-of select="//Labels/Song"/>
  351.           <xsl:text> </xsl:text>
  352.           <xsl:value-of select="SongMiddle"/>
  353.         </td>
  354.       </tr>
  355.       <xsl:apply-templates select="LACItem"/>
  356.       <xsl:choose>
  357.         <xsl:when test="@CircuitVisit=0">
  358.           <xsl:apply-templates select="CongregationBibleStudy"/>
  359.         </xsl:when>
  360.         <xsl:otherwise>
  361.           <xsl:apply-templates select="CircuitVisit/LACItem"/>
  362.         </xsl:otherwise>
  363.       </xsl:choose>
  364.       <tr>
  365.         <td class="ItemTheme">
  366.           <xsl:value-of select="//Labels/Song"/>
  367.           <xsl:text> </xsl:text>
  368.           <xsl:value-of select="SongEnd"/>
  369.           <!--We do not have labels for these-->
  370.           <xsl:text> e preghiera</xsl:text>
  371.         </td>
  372.         <xsl:apply-templates select="PrayerEnd"/>
  373.       </tr>
  374.     </table>
  375.   </xsl:template>
  376.  
  377.   <xsl:template match="CongregationBibleStudy">
  378.     <tr>
  379.       <td class="ItemTheme">
  380.         <xsl:value-of select="//Labels/CBS"/>
  381.       </td>
  382.       <xsl:apply-templates select="Conductor"/>
  383.     </tr>
  384.     <tr>
  385.       <xsl:call-template name="ReaderLabel"/>
  386.       <xsl:apply-templates select="Reader"/>
  387.     </tr>
  388.   </xsl:template>
  389.  
  390.   <xsl:template name="ReaderLabel">
  391.     <td class="ItemTheme">
  392.       <!--Trims the " :" from the end of the reader label-->
  393.       <xsl:value-of select="normalize-space(translate(//Labels/Reader,':',''))"/>
  394.     </td>
  395.   </xsl:template>
  396.  
  397.   <xsl:template match="PUBLICTALK">
  398.     <div class="Gap"></div>
  399.     <div class="HeadingWEEKEND">
  400.       <xsl:value-of select="//Labels/PTS_WeekendMeeting"/>
  401.     </div>
  402.     <table class="Items">
  403.       <tr>
  404.         <!--Do not have a label for this-->
  405.         <td class="ItemTheme">Presidente Adunanza del fine settimana</td>
  406.         <xsl:apply-templates select="Assignments/Chairman"/>
  407.       </tr>
  408.     </table>
  409.     <div class="HeadingPUBLICTALK">
  410.       <xsl:value-of select="//Labels/PTS_Talk"/>
  411.     </div>
  412.     <table class="Items">
  413.       <tr>
  414.         <xsl:apply-templates select="HomeTalk/Theme"/>
  415.         <xsl:apply-templates select="HomeTalk/Speaker"/>
  416.         <!--We do not display the congregation name ?-->
  417.       </tr>
  418.     </table>
  419.     <div class="HeadingWATCHTOWER">
  420.       <xsl:value-of select="//Labels/PTS_WTStudy"/>
  421.     </div>
  422.     <table class="Items">
  423.       <tr>
  424.         <xsl:apply-templates select="Assignments/WatchtowerStudy/Theme"/>
  425.         <xsl:apply-templates select="Assignments/Conductor"/>
  426.       </tr>
  427.       <!--This is not a circuit visit so show the reader-->
  428.       <xsl:if test="preceding-sibling::*[1]/@CircuitVisit=0">
  429.         <tr>
  430.           <xsl:call-template name="ReaderLabel"/>
  431.           <xsl:apply-templates select="Assignments/Reader"/>
  432.         </tr>
  433.       </xsl:if>
  434.     </table>
  435.     <!--This is circuit visit - show final service talk-->
  436.     <xsl:if test="preceding-sibling::*[1]/@CircuitVisit=1">
  437.       <div class="HeadingSERVICETALK">
  438.         <xsl:value-of select="//Labels/PTS_ServiceTalk"/>
  439.       </div>
  440.       <table class="Items">
  441.         <tr>
  442.           <xsl:apply-templates select="Assignments/ServiceTalk/Theme"/>
  443.           <xsl:apply-templates select="preceding-sibling::*[1]/CircuitVisit/LACItem/Name"/>
  444.         </tr>
  445.       </table>
  446.     </xsl:if>
  447.   </xsl:template>
  448.  
  449.   <!--Displays the notes (if any)-->
  450.   <xsl:template match="Note">
  451.     <xsl:if test="normalize-space(.) != ''">
  452.       <tr>
  453.         <td class="ItemNotes" colspan="2">
  454.           <xsl:value-of select="//Labels/Note"/>:&#160;<xsl:value-of select="."/>
  455.         </td>
  456.       </tr>
  457.     </xsl:if>
  458.   </xsl:template>
  459.  
  460.   <!--<xsl:template match="SpecialEvent">
  461.    <tr>
  462.      <td class="textSpecialEvent" colspan="4">
  463.        <xsl:value-of select="Event"/> [<xsl:value-of select="Date"/>]
  464.      </td>
  465.    </tr>
  466.    <xsl:if test="normalize-space(Location) != ''">
  467.      <tr>
  468.        <td class="textSpecialEventLocation" colspan="4">
  469.          <xsl:value-of select="Location"/>
  470.        </td>
  471.      </tr>
  472.    </xsl:if>
  473.  </xsl:template>-->
  474. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment