Example XML:

<DutyAssignmentEntry Date="2018-01-04" Week="W20180101" Template="0" Mode="Midweek">
 <Assignment Index="2" IndexType="Fixed">Name 1</Assignment>
 <Assignment Index="5" IndexType="Fixed">Name 2</Assignment>
 <Assignment Index="7" IndexType="Fixed">Name 3</Assignment>
 <Assignment Index="8" IndexType="Fixed">Name 4</Assignment>
 <Assignment Index="13" IndexType="Fixed">Name 5</Assignment>
 <Assignment Index="14" IndexType="Fixed">Name 6</Assignment>
</DutyAssignmentEntry>

Date

This is the value of the Date cell on the row in the Sound Rota Schedule.

Week

This is the Monday for the week. This value is your lookup cross-reference if you want to read in assignment information from the Midweek Editor.

Template

This is the template (schedule type) that was in use at the time the schedule was saved. The default schedule is 0. The template is changed in the Program Settings.

Mode

This is one of three values:

  1. Midweek
  2. Weekend
  3. Weekly

This value is based on the Report Mode in the program settings and as a result reflects the status of each row in the schedule.

By using selective criteria in the XSL scripts you will be able to isolate any history that you want to display.

For each DutyAssignmentEntry there will be one or more Assignment objects. Each of these represents a column that was used on the schedule.

IndexType

This is one of 3 values:

  1. Fixed
  2. CustomFixed
  3. Custom

This value affects the meaning of the Index value.

Index

The value of this is based on the following:

IndexType: Fixed

This will be a value of 1 to 16. These are the mandatory assignments and their values never change.

1

Sound 1

2

Sound 2

3

Sound 3

4

Sound 4

5

Platform

6

Platform Mike

7

Mike 1

8

Mike 2

9

Mike 3

10

Mike 4

11

Mike 5

12

Mike 6

13

Attendant 1

14

Attendant 2

15

Attendant 3

16

Attendant 4

IndexType: CustomFixed

This will be a value of 0 to 3. There are the 4 mandatory custom assignments that were introduced into the program and these values never change:

0

Congregation Bible Study Conductor

1

Congregation Bible Study Reader

2

Midweek Chairman

3

Midweek Prayer

Please note that the LabelsInfo.XML file will contain additional information (see below).

IndexType: Custom

This can be any value and it never changes. It matches all the custom assignments that you have personally added into the program.

It is not possible to inform you here what each index will mean.

However, I can direct you to the LabelsInfo.XML file which contains extra information (see below).

LabelsInfo.XML

This document is located in the user application data folder (%appdata%\Meeting Schedule Assistant) and has been around for some time and is used when preparing Midweek Schedules. It has been updated to include extra information to assist you should you want to do any advanced XSL scripting. Here is an example:

<?xml version="1.0" encoding="UTF-8"?>
 <Labels Version="180900">
 <Name>Name</Name>
 <Gender>Gender</Gender>
 <AppointedAs>Appointed As</AppointedAs>
 <ServingAs>Serving As</ServingAs>
 <Sound>Sound</Sound>
 <Platform>Platform</Platform>
 <Microphone>Microphone</Microphone>
 <Attendant>Attendant</Attendant>
 <MidweekMeeting>Midweek Meeting</MidweekMeeting>
 <ConductorCBS CustomFixedIndex="0">CBS Conductor</ConductorCBS>
 <ReaderCBS CustomFixedIndex="1">CBS Reader</ReaderCBS>
 <MidweekChairman CustomFixedIndex="2">Midweek Chairman</MidweekChairman>
 <MidweekPrayer CustomFixedIndex="3">Midweek Prayer</MidweekPrayer>
 <Student>Student</Student>
 <Demonstrations>Demonstrations</Demonstrations>
 <Publisher>Publisher</Publisher>
 <RegularPioneer>Regular pioneer</RegularPioneer>
 <UnbaptisedPublisher>Unbaptised Publisher</UnbaptisedPublisher>
 <Elder>Elder</Elder>
 <MinisterialServant>Ministerial servant</MinisterialServant>
 <NotAppointed>Not appointed</NotAppointed>
 <Other>Other</Other>
 <Male>Brother</Male>
 <Female>Sister</Female>
 <Custom Index="4">Chairman</Custom>
 <Custom Index="5">Watchtower Reader</Custom>
</Labels>

Note iconAs you can see the meaning of the CustomFixed and Custom values are clearly stated in this file. So this is useful for two reasons:
1. You know what combination of Index / IndexType values to use to find information in the history file.
2. You can optionally use the label provided on the schedule.

Example customized script

Here is an example script that shows how to display assignment information on your Midweek schedule. This script is provided to convey the principles involved.

Notice the code that is highlighted in yellow? It is important that this is in your script.

Notice the code that is highlighted in magenta? This is an example of how you lookup the required assignment history.

Notice the code that is highlighted in lime? This is an example of how you display the details for a specific assignment.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:msa="http://www.publictalksoftware.co.uk/msa">
 <xsl:output method="html" indent="yes" version="4.01"
   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
   doctype-public="//W3C//DTD XHTML 1.0 Transitional//EN"/>
 <xsl:variable name="DutyHistory" select="document('DutyAssignHistory.XML')"/>
 <xsl:template match="/">
   <html>
     <head>
       <title>Test</title>
     </head>
     <body>
       <xsl:for-each select="MeetingWorkBook/Meeting">
         <p>
           <xsl:value-of select ="Date/@ThisWeek"/>
         </p>
         <xsl:variable name="Week" select="Date/@ThisWeek"/>
         <xsl:variable name="weekend-assignments"
                      select="$DutyHistory/msa:DutyAssignmentHistory/msa:DutyAssignments
                         /msa:DutyAssignmentEntry[@Week=$Week and @Mode='Weekend']/msa:Assignment"/>
         <table>
           <tr>
             <td>Sound</td>
             <td>
               <xsl:value-of select="$weekend-assignments[@Index='1' and @IndexType='Fixed']"/>
             </td>
           </tr>
           <tr>
             <td>Platform</td>
             <td>
               <xsl:value-of select="$weekend-assignments[@Index='5' and @IndexType='Fixed']"/>
             </td>
           </tr>
           <tr>
             <td>Left Mike</td>
             <td>
               <xsl:value-of select="$weekend-assignments[@Index='7' and @IndexType='Fixed']"/>
             </td>
           </tr>
           <tr>
             <td>Right Mike</td>
             <td>
               <xsl:value-of select="$weekend-assignments[@Index='8' and @IndexType='Fixed']"/>
             </td>
           </tr>
           <tr>
             <td>Public Talk Chairman</td>
             <td>
               <xsl:value-of select="$weekend-assignments[@Index='4' and @IndexType='Custom']"/>
             </td>
           </tr>
           <tr>
             <td>Watchtower Reader</td>
             <td>
               <xsl:value-of select="$weekend-assignments[@Index='5' and @IndexType='Custom']"/>
             </td>
           </tr>
         </table>
       </xsl:for-each>
     </body>
   </html>
 </xsl:template>
</xsl:stylesheet>

Further Clarification

This is how you create the lookup reference. It is up to you what you call the variable. I decided on using Week. The key principle here is that the information we need to obtain is the Date/@ThisWeek attribute value. This value is in the form WYYYYMMDD.

<xsl:variable name="Week" select="Date/@ThisWeek"/>

This is how you extract a list of all the assignments for a specific week. It uses all the filtering that has been described in this article. We need to be answer the following questions:

  1. What Report Mode are we using in Meeting Schedule Assistant?

    - Weekly: Then use a Mode value of Weekly.
    - Meeting: Then use a Mode value of Midweek or Weekend as required.

  2. What Template (Schedule Type) are we using in Meeting Schedule Assistant?

    If you are not using the Schedule Types setting then you don't need to worry about using it in filtering. You only need to use it if you do use one or more schedule types. If you do you them then you can examine the history file yourself to work it out what the value should be.

    <xsl:variable name="weekend-assignments"
                 select="$DutyHistory/
                         msa:DutyAssignmentHistory/
                         msa:DutyAssignments/
                         msa:DutyAssignmentEntry[@Week=$Week and @Mode='Weekend']/msa:Assignment"/>

The the above example:

  • I am not using Schedule Types so I did not need to specify the Template value.
  • I am using Meeting Report Mode and wanted to get the Weekend assignments.

This is how you display the name for a specific assignment from the list:

<xsl:value-of select="$weekend-assignments[@Index='1' and @IndexType='Fixed']"/>


Closing Comments

You can make use of the apply-templates feature of XSL scripting to simply your code. Here is one example that introduces this principle. See the code highlighted in yellow.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:msa="http://www.publictalksoftware.co.uk/msa">
 <xsl:output method="html" indent="yes" version="4.01"
   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
   doctype-public="//W3C//DTD XHTML 1.0 Transitional//EN"/>
 <xsl:variable name="DutyHistory" select="document('DutyAssignHistory.XML')"/>
 <xsl:template match="/">
   <html>
     <head>
       <title>Test</title>
     </head>
     <body>
       <xsl:for-each select="MeetingWorkBook/Meeting">
         <p>
           <xsl:value-of select ="Date/@ThisWeek"/>
         </p>
         <xsl:variable name="Week" select="Date/@ThisWeek"/>
         <xsl:variable name="weekend-assignments"
                      select="$DutyHistory/msa:DutyAssignmentHistory/msa:DutyAssignments
                         /msa:DutyAssignmentEntry[@Week=$Week and @Mode='Weekend']/msa:Assignment"/>
         <table>
           <tr>
             <td>Sound</td>
             <xsl:apply-templates select="$weekend-assignments[@Index='1' and @IndexType='Fixed']"/>
           </tr>
           <tr>
             <td>Platform</td>
             <xsl:apply-templates select="$weekend-assignments[@Index='5' and @IndexType='Fixed']"/>
           </tr>
           <tr>
             <td>Left Mike</td>
             <xsl:apply-templates select="$weekend-assignments[@Index='7' and @IndexType='Fixed']"/>
           </tr>
           <tr>
             <td>Right Mike</td>
             <xsl:apply-templates select="$weekend-assignments[@Index='8' and @IndexType='Fixed']"/>
           </tr>
           <tr>
             <td>Public Talk Chairman</td>
             <xsl:apply-templates select="$weekend-assignments[@Index='4' and @IndexType='Custom']"/>
           </tr>
           <tr>
             <td>Watchtower Reader</td>
             <xsl:apply-templates select="$weekend-assignments[@Index='5' and @IndexType='Custom']"/>
           </tr>
         </table>
       </xsl:for-each>
     </body>
   </html>
 </xsl:template>

 <xsl:template match="msa:Assignment">
   <td>
     <xsl:value-of select="."/>
   </td>
 </xsl:template>
</xsl:stylesheet>

The information provided in thus tutorial only conveys basic information to assist you with how to include the Duty Assignment History on your schedules.

Notes IconXSL Scripting is very powerful and it is beyond the scope of this help topic to provide more examples. However, please note that a new version of the Compact schedule has been added to this PTS Blog post.