Showing posts with label Computer Programming. Show all posts
Showing posts with label Computer Programming. Show all posts

Tuesday, January 12, 2010

A Proposed Improvement to the Cooperative Program

The Executive Committee of the Southern Baptist Convention should develop an online "bill-pay" application and provide it for free to Southern Baptist Churches. It should interface with the major church management software packages. It should enable churches to send CP dollars with a single click. The application should, in cooperation with the state conventions, know the respective CP budget in effect for each church. When the church clicks the button to authorize the payment, the funds should transfer immediately to their final destinations (e.g., IMB, NAMB, seminaries, state Baptist university, etc.).

Ideally, the convention should provide for the churches' discretionary use an additional, compatible piece of software, an application that would track contributions for the local congregation. This software should give churches the option, if they choose to utilize it, to forward CP gifts automatically when each batch of contributions is posted.

Thus, if I give $1000 to FBC Farmersville on Sunday, by Tuesday the funds are already in Richmond, Alpharetta, Fort Worth, Grapevine, etc.

The interest earnings gained by having the funds available on a weekly basis to our cooperative enterprises would be more than enough to fund the development and hosting costs to the convention. Furthermore, harried volunteer Treasurers and Finance Committees in smaller SBC churches would appreciate something from the SBC to make their lives easier.

Saturday, March 14, 2009

An XML Schema Declaration for a Sermon

Just something I've been working on for a project (I DO do more than blog, you know). Anyway, the following is code I've developed to try to put together an XML schema defining a sermon. Any ideas?

I know that, theoretically, OSIS could be employed to encode a sermon, but that's not a very satisfying solution. Sermons have elements peculiar to sermons. A good XML representation of a sermon should know the difference between a point and a conclusion.

I only took two preaching classes in seminary, and they were a long time ago. I may very well have missed something important. So if this code is helpful to you, then I'm glad for you to use it so long as you give me credit. And if you can help me make this code better, I welcome the help.


<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Sermon"
    targetNamespace="http://tempuri.org/Sermon.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/Sermon.xsd"
    xmlns:mstns="http://tempuri.org/Sermon.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:osis="http://www.bibletechnologies.net/2003/OSIS/namespace"
>
  <xs:import id="osis" namespace="http://www.bibletechnologies.net/2003/OSIS/namespace" 
             schemaLocation="http://www.bibletechnologies.net/osisCore.2.1.1 - 06March2006.xsd"
             />
  
  
  <!--Definition of simple elements-->
  <xs:element name="author" type="xs:token"/>
  <xs:element name="version" type="xs:positiveInteger"/>
  <xs:element name="decisions" type="xs:nonNegativeInteger"/>
  <xs:element name="title" type="xs:token"/>
  <xs:element name="text" type="xs:token"/>
  <xs:element name="centralIdeaOfText" type="xs:string"/>
  <xs:element name="thesis" type="xs:string"/>
  <xs:element name="objective">
    <xs:complexType mixed="true">
      <xs:attribute ref="majorObjective"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="createdDate" type="xs:date"/>
  <xs:element name="occasionStart" type="xs:dateTime"/>
  <xs:element name="location" type="xs:token"/>
  <xs:element name="description" type="xs:string"/>
  <xs:element name="occasionsPreached" type="preachingOccasion"/>
  
  <!--Definition of attributes-->
  <xs:attribute name="majorObjective" default="Evangelistic">
    <xs:simpleType>
      <xs:restriction base="xs:token">
        <xs:enumeration value="Evangelistic"/>
        <xs:enumeration value="Consecrative"/>
        <xs:enumeration value="Ethical"/>
        <xs:enumeration value="Doctrinal"/>
        <xs:enumeration value="Supportive"/>
        <xs:enumeration value="Devotional"/>
        <xs:enumeration value="Programmatic"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>

  <xs:attribute name="reference" type="xs:token"/>
  <xs:attribute name="translation" type="xs:token" default="NASB"/>
  
  <!--Definition of complex elements-->
  <!--Sermon Header-->
  <xs:element name="head">
    <xs:complexType mixed="true">
      <xs:sequence minOccurs="1" maxOccurs="1">
        <xs:element ref="author" maxOccurs="1" minOccurs="1"/>
        <xs:element ref="text" maxOccurs="1" minOccurs="1"/>
        <xs:element ref="title" maxOccurs="1" minOccurs="0"/>
        <xs:element ref="centralIdeaOfText" maxOccurs="1" minOccurs="0"/>
        <xs:element ref="thesis" maxOccurs="1" minOccurs="0"/>
        <xs:element ref="objective" maxOccurs="1" minOccurs="0"/>
        <xs:element ref="createdDate" maxOccurs="1" minOccurs="1"/>
        <xs:element ref="occasionsPreached" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <!--Abstract Elements-->
  <xs:element name="inlineElement" abstract="true">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="inlineElement"/>
        <xs:element ref="blockElement"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element name="blockElement" abstract="true">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="inlineElement"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  
  <!--Content Elements-->
  <xs:element name="p" substitutionGroup="blockElement"/>
  <xs:element name="em" substitutionGroup="inlineElement"/>
  <xs:element name="i" substitutionGroup="inlineElement"/>
  <xs:element name="strong" substitutionGroup="inlineElement"/>
  <xs:element name="b" substitutionGroup="inlineElement"/>

  <xs:element name="blockquote">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="blockElement"/>
        <xs:element ref="inlineElement"/>
        <xs:element ref="ul"/>
        <xs:element ref="ol"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element name="li">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="blockElement"/>
        <xs:element ref="blockquote"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element name="ul">
    <xs:complexType mixed="false">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="li"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element name="ol">
    <xs:complexType mixed="false">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="li"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element name="explanation">
    <xs:complexType mixed="true">
      <xs:complexContent>
        <xs:extension base="blockElementContainer">
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="inlineElement"/>
          </xs:choice>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="illustration">
    <xs:complexType mixed="true">
      <xs:complexContent>
        <xs:extension base="blockElementContainer">
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="inlineElement"/>
          </xs:choice>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="application">
    <xs:complexType mixed="true">
      <xs:complexContent>
        <xs:extension base="blockElementContainer">
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="inlineElement"/>
          </xs:choice>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="transition">
    <xs:complexType mixed="true">
      <xs:complexContent>
        <xs:extension base="blockElementContainer">
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="inlineElement"/>
            <xs:element ref="application"/>
            <xs:element ref="explanation"/>
            <xs:element ref="illustration"/>
            <xs:element ref="scriptureReference"/>
          </xs:choice>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="point">
    <xs:complexType mixed="true">
      <xs:sequence minOccurs ="1" maxOccurs="1">
        <xs:element ref="pointStatement"/>
        <xs:choice minOccurs ="0" maxOccurs="unbounded">
          <xs:element ref="blockElement"/>
          <xs:element ref="inlineElement"/>
          <xs:element ref="pointGroup"/>
          <xs:element ref="explanation"/>
          <xs:element ref="illustration"/>
          <xs:element ref="application"/>
          <xs:element ref="transition"/>
          <xs:element ref="ol"/>
          <xs:element ref="ul"/>
        </xs:choice>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="pointStatement" type="xs:string"/>

  <xs:element name="pointGroup">
    <xs:complexType mixed="false">
      <xs:choice minOccurs ="0" maxOccurs="unbounded">
        <xs:element ref="point"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element type="osis:osisCT" name="scriptureReference" />
  
  <xs:element name="introduction" substitutionGroup="transition"/>
  <xs:element name="conclusion" substitutionGroup="transition"/>

  <xs:element name="body">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="transition"/>
        <xs:element ref="pointGroup"/>
        <xs:element ref="inlineElement"/>
        <xs:element ref="blockElement"/>
        <xs:element ref="ol"/>
        <xs:element ref="ul"/>
        <xs:element ref="scriptureReference"/>
        <xs:element ref="explanation"/>
        <xs:element ref="illustration"/>
        <xs:element ref="application"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element name="sermonBody" substitutionGroup="body"/>

  <!--Definition of complex types-->
  <xs:complexType name="preachingOccasion">
    <xs:all>
      <xs:element ref="description"/>
      <xs:element ref="location"/>
      <xs:element ref="occasionStart"/>
      <xs:element ref="decisions"/>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="blockElementContainer" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="blockElement"/>
      <xs:element ref="blockquote"/>
      <xs:element ref="ul"/>
      <xs:element ref="ol"/>
      <xs:element ref="pointGroup"/>
    </xs:choice>
  </xs:complexType>
  
  <!--Definition of root element-->
  <xs:element name="sermon">
    <xs:complexType mixed="true">
      <xs:sequence minOccurs="1" maxOccurs="1">
        <xs:element ref="head"/>
        <xs:element ref="body"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

©2009 C. Bart barber