[Tynstep-svn] r122 - in trunk: . .settings step-web-app step-web-app/.settings step-web-app/src step-web-app/src/main step-web-app/src/main/java/com/tyndalehouse/step/web step-web-app/src/main/resources step-web-app/src/main/resources/com step-web-app/src/main/resources/com/tyndalehouse step-web-app/src/main/resources/com/tyndalehouse/step step-web-app/src/main/resources/com/tyndalehouse/step/web step-web-app/src/main/resources/com/tyndalehouse/step/web/server step-web-app/src/main/resources/com/tyndalehouse/step/web/server/config step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/maps step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline step-web-app/src/main/resources/xsl step-web-app/src/main/resources/xsl/cswing step-web-app/src/main/webapp step-web-app/src/main/webapp/com step-web-app/src/main/webapp/com/tyndalehouse step-web-app/src/main/webapp/com/tyndalehouse/step step-web-app/src/test step-web-app/src/test/java step-web-app/src/test/java/com step-web-app/src/test/java/com/tyndalehouse step-web-app/src/test/java/com/tyndalehouse/step step-web-app/src/test/java/com/tyndalehouse/step/db step-web-app/src/test/java/com/tyndalehouse/step/web step-web-app/src/test/java/com/tyndalehouse/step/web/client step-web-app/src/test/java/com/tyndalehouse/step/web/client/service step-web-app/src/test/java/com/tyndalehouse/step/web/client/toolkit step-web-app/src/test/java/com/tyndalehouse/step/web/server step-web-app/src/test/java/com/tyndalehouse/step/web/server/db step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers step-web-app/src/test/resources step-web-app/src/test/resources/com step-web-app/src/test/resources/com/tyndalehouse step-web-app/src/test/resources/com/tyndalehouse/step step-web-app/src/test/resources/com/tyndalehouse/step/web step-web-app/src/test/resources/com/tyndalehouse/step/web/server step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/queries step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/queries/tests step-web-app/war step-web-app/war/WEB-INF

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Wed Apr 14 15:17:05 MST 2010


Author: ChrisBurrell
Date: 2010-04-14 15:17:04 -0700 (Wed, 14 Apr 2010)
New Revision: 122

Added:
   trunk/.project
   trunk/.settings/
   trunk/.settings/org.maven.ide.eclipse.prefs
   trunk/pom.xml
   trunk/step-checks.xml
   trunk/step-web-app/.settings/com.google.appengine.eclipse.core.prefs
   trunk/step-web-app/.settings/com.google.gdt.eclipse.core.prefs
   trunk/step-web-app/.settings/com.google.gwt.eclipse.core.prefs
   trunk/step-web-app/.settings/org.eclipse.jdt.core.prefs
   trunk/step-web-app/.settings/org.maven.ide.eclipse.prefs
   trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/step.gwt.xml
   trunk/step-web-app/src/main/resources/
   trunk/step-web-app/src/main/resources/com/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/config/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/config/environment.properties
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/maps/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/maps/get_locations_for_passage.sql
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/get_events_for_date_range.sql
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/get_timeline_setup_data.sql
   trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/lookup_timeline_origin.sql
   trunk/step-web-app/src/main/resources/log4j.properties
   trunk/step-web-app/src/main/resources/xsl/
   trunk/step-web-app/src/main/resources/xsl/cswing/
   trunk/step-web-app/src/main/resources/xsl/cswing/cutandpaste.xsl
   trunk/step-web-app/src/main/resources/xsl/cswing/cutandpaste2.xsl
   trunk/step-web-app/src/main/resources/xsl/cswing/index.txt
   trunk/step-web-app/src/main/resources/xsl/cswing/simple.xsl
   trunk/step-web-app/src/main/resources/xsl/cswing/simple2.xsl
   trunk/step-web-app/src/main/webapp/
   trunk/step-web-app/src/main/webapp/com/
   trunk/step-web-app/src/main/webapp/com/tyndalehouse/
   trunk/step-web-app/src/main/webapp/com/tyndalehouse/step/
   trunk/step-web-app/src/main/webapp/com/tyndalehouse/step/web/
   trunk/step-web-app/src/test/
   trunk/step-web-app/src/test/java/
   trunk/step-web-app/src/test/java/com/
   trunk/step-web-app/src/test/java/com/tyndalehouse/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/db/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/db/queries/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/tests/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/ModuleRefDataServiceTest.java
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/toolkit/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/toolkit/timeline/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/StepQueryRunnerImplTest.java
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/TestProcessor.java
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/TestQueryImpl.java
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetCurrentBibleTextHandlerTest.java
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetDictionaryDefinitionHandlerTest.java
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetTimelineUISetupHandlerTest.java
   trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/JSwordInstallTest.java
   trunk/step-web-app/src/test/resources/
   trunk/step-web-app/src/test/resources/com/
   trunk/step-web-app/src/test/resources/com/tyndalehouse/
   trunk/step-web-app/src/test/resources/com/tyndalehouse/step/
   trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/
   trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/server/
   trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/
   trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/queries/
   trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/queries/tests/
   trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/queries/tests/test_query_params_different_types.sql
   trunk/step-web-app/war/
   trunk/step-web-app/war/WEB-INF/
   trunk/step-web-app/war/WEB-INF/web.xml
Log:
now that repository is smaller, i can commit without having SSL error

Added: trunk/.project
===================================================================
--- trunk/.project	                        (rev 0)
+++ trunk/.project	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>step-parent</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>

Added: trunk/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- trunk/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ trunk/.settings/org.maven.ide.eclipse.prefs	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,9 @@
+#Sun Apr 04 22:29:56 BST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: trunk/pom.xml
===================================================================
--- trunk/pom.xml	                        (rev 0)
+++ trunk/pom.xml	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,199 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.tyndalehouse</groupId>
+	<artifactId>step-parent</artifactId>
+	<packaging>pom</packaging>
+	<version>1.0-SNAPSHOT</version>
+	<name>step-parent</name>
+	
+	<properties>
+		<project.build.sourceEncoding>iso-8859-1
+		</project.build.sourceEncoding>
+		<project.reporting.outputEncoding>iso-8859-1
+		</project.reporting.outputEncoding>
+		<java.version>1.5</java.version>
+		<gwt.version>2.0.3</gwt.version>
+		<db.directory>${user.home}/TyndaleStep/StepDB</db.directory>
+		<derby.version>10.5.3.0_1</derby.version>
+		<db.driver>org.apache.derby.jdbc.EmbeddedDriver</db.driver>
+		<db.connection.string>jdbc:derby:${db.directory}</db.connection.string>
+	</properties>
+
+	<scm>
+		<connection>scm:svn:https://crosswire.org/svn/tynstep/trunk</connection>
+		<developerConnection>scm:svn:https://crosswire.org/svn/tynstep/trunk</developerConnection>
+		<url>https://crosswire.org/svn/tynstep/trunk/</url>
+	</scm>
+
+
+	<modules>
+		<module>step-web-app</module>
+		<module>step-dataloader</module>
+		<module>step-server</module>
+		<module>step-tools</module>
+	</modules>
+
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>org.crosswire</groupId>
+				<artifactId>jsword</artifactId>
+				<version>1.6.1-SNAPSHOT</version>
+			</dependency>
+
+			<dependency>
+				<groupId>com.google.gwt</groupId>
+				<artifactId>gwt-servlet</artifactId>
+				<version>${gwt.version}</version>
+				<scope>compile</scope>
+			</dependency>
+			<dependency>
+				<groupId>com.google.gwt</groupId>
+				<artifactId>gwt-user</artifactId>
+				<version>${gwt.version}</version>
+				<scope>provided</scope>
+			</dependency>
+
+			<dependency>
+				<groupId>com.googlecode.gwt.inject
+				</groupId>
+				<artifactId>gin</artifactId>
+				<version>1.0</version>
+			</dependency>
+			<dependency>
+				<groupId>com.google.inject</groupId>
+				<artifactId>guice</artifactId>
+				<version>2.0</version>
+			</dependency>
+
+			<dependency>
+				<groupId>com.google.inject.extensions
+				</groupId>
+				<artifactId>guice-servlet</artifactId>
+				<version>2.0</version>
+			</dependency>
+
+			<dependency>
+				<groupId>net.customware.gwt.dispatch
+				</groupId>
+				<artifactId>gwt-dispatch</artifactId>
+				<version>1.0.0</version>
+			</dependency>
+
+			<dependency>
+				<groupId>net.customware.gwt.presenter
+				</groupId>
+				<artifactId>gwt-presenter</artifactId>
+				<version>1.0.0</version>
+			</dependency>
+
+			<dependency>
+				<groupId>com.google.code.gwt-log</groupId>
+				<artifactId>gwt-log</artifactId>
+				<version>2.6.2</version>
+			</dependency>
+
+			<dependency>
+				<groupId>com.extjs</groupId>
+				<artifactId>gxt</artifactId>
+				<version>2.1.1</version>
+			</dependency>
+
+			<dependency>
+				<groupId>commons-logging</groupId>
+				<artifactId>commons-logging</artifactId>
+				<version>1.1.1</version>
+			</dependency>
+
+			<dependency>
+				<groupId>commons-dbcp</groupId>
+				<artifactId>commons-dbcp</artifactId>
+				<version>1.3</version>
+			</dependency>
+
+			<dependency>
+				<groupId>commons-io</groupId>
+				<artifactId>commons-io</artifactId>
+				<version>1.4</version>
+			</dependency>
+
+			<dependency>
+				<groupId>commons-dbutils</groupId>
+				<artifactId>commons-dbutils</artifactId>
+				<version>1.3</version>
+			</dependency>
+
+			<dependency>
+				<groupId>commons-lang</groupId>
+				<artifactId>commons-lang</artifactId>
+				<version>2.5</version>
+			</dependency>
+
+			<dependency>
+				<groupId>org.jmock</groupId>
+				<artifactId>jmock</artifactId>
+				<version>2.5.1</version>
+				<scope>test</scope>
+			</dependency>
+
+			<dependency>
+				<groupId>org.jmock</groupId>
+				<artifactId>jmock-junit4</artifactId>
+				<version>2.5.1</version>
+				<scope>test</scope>
+			</dependency>
+
+			<dependency>
+				<groupId>org.apache.derby</groupId>
+				<artifactId>derbyclient</artifactId>
+				<version>${derby.version}</version>
+				<scope>runtime</scope>
+			</dependency>
+
+			<dependency>
+				<groupId>org.apache.derby</groupId>
+				<artifactId>derby</artifactId>
+				<version>${derby.version}</version>
+				<scope>runtime</scope>
+			</dependency>
+
+			<dependency>
+				<groupId>net.sf.opencsv</groupId>
+				<artifactId>opencsv</artifactId>
+				<version>2.1</version>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+
+
+	<build>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-compiler-plugin</artifactId>
+					<configuration>
+						<encoding>iso-8859-1</encoding>
+						<source>${java.version}</source>
+						<target>${java.version}</target>
+					</configuration>
+				</plugin>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-surefire-plugin</artifactId>
+					<configuration>
+						<junitArtifactName>junit:junit-dep
+						</junitArtifactName>
+					</configuration>
+				</plugin>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-eclipse-plugin</artifactId>
+					<version>2.5</version>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+</project>

Added: trunk/step-checks.xml
===================================================================
--- trunk/step-checks.xml	                        (rev 0)
+++ trunk/step-checks.xml	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--
+    This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+    Checkstyle-Configuration: step-checks
+    Description: none
+-->
+<module name="Checker">
+  <property name="severity" value="warning"/>
+  <module name="TreeWalker">
+    <property name="tabWidth" value="4"/>
+    <module name="FileContentsHolder"/>
+    <module name="JavadocMethod">
+      <property name="logLoadErrors" value="true"/>
+      <property name="suppressLoadErrors" value="true"/>
+    </module>
+    <module name="JavadocType"/>
+    <module name="JavadocVariable"/>
+    <module name="JavadocStyle">
+      <property name="checkFirstSentence" value="false"/>
+    </module>
+    <module name="ConstantName"/>
+    <module name="LocalFinalVariableName"/>
+    <module name="LocalVariableName"/>
+    <module name="MemberName"/>
+    <module name="MethodName"/>
+    <module name="PackageName"/>
+    <module name="ParameterName"/>
+    <module name="StaticVariableName"/>
+    <module name="TypeName"/>
+    <module name="AvoidStarImport"/>
+    <module name="IllegalImport"/>
+    <module name="RedundantImport"/>
+    <module name="UnusedImports"/>
+    <module name="FileLength"/>
+    <module name="MethodLength"/>
+    <module name="ParameterNumber"/>
+    <module name="EmptyForIteratorPad"/>
+    <module name="MethodParamPad"/>
+    <module name="NoWhitespaceAfter">
+      <property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
+    </module>
+    <module name="NoWhitespaceBefore"/>
+    <module name="OperatorWrap"/>
+    <module name="ParenPad">
+      <property name="severity" value="ignore"/>
+    </module>
+    <module name="TypecastParenPad"/>
+    <module name="TabCharacter">
+      <property name="severity" value="ignore"/>
+    </module>
+    <module name="WhitespaceAfter"/>
+    <module name="WhitespaceAround"/>
+    <module name="ModifierOrder"/>
+    <module name="RedundantModifier"/>
+    <module name="AvoidNestedBlocks"/>
+    <module name="EmptyBlock"/>
+    <module name="LeftCurly"/>
+    <module name="NeedBraces"/>
+    <module name="RightCurly"/>
+    <module name="AvoidInlineConditionals">
+      <property name="severity" value="ignore"/>
+    </module>
+    <module name="DoubleCheckedLocking"/>
+    <module name="EmptyStatement"/>
+    <module name="EqualsHashCode"/>
+    <module name="HiddenField">
+      <property name="severity" value="ignore"/>
+    </module>
+    <module name="IllegalInstantiation"/>
+    <module name="InnerAssignment"/>
+    <module name="MagicNumber"/>
+    <module name="MissingSwitchDefault"/>
+    <module name="RedundantThrows">
+      <property name="logLoadErrors" value="true"/>
+      <property name="suppressLoadErrors" value="true"/>
+    </module>
+    <module name="SimplifyBooleanExpression"/>
+    <module name="SimplifyBooleanReturn"/>
+    <module name="DesignForExtension">
+      <property name="severity" value="ignore"/>
+    </module>
+    <module name="FinalClass"/>
+    <module name="HideUtilityClassConstructor"/>
+    <module name="InterfaceIsType"/>
+    <module name="VisibilityModifier"/>
+    <module name="ArrayTypeStyle"/>
+    <module name="FinalParameters"/>
+    <module name="GenericIllegalRegexp">
+      <property name="severity" value="ignore"/>
+      <property name="format" value="\s+$"/>
+      <property name="message" value="Line has trailing spaces."/>
+    </module>
+    <module name="TodoComment">
+      <property name="severity" value="ignore"/>
+    </module>
+    <module name="UpperEll"/>
+    <module name="CyclomaticComplexity">
+      <metadata name="net.sf.eclipsecs.core.comment" value="Cyclomatic Complexity"/>
+    </module>
+  </module>
+  <module name="JavadocPackage">
+    <property name="severity" value="ignore"/>
+  </module>
+  <module name="NewlineAtEndOfFile"/>
+  <module name="Translation"/>
+  <module name="SuppressionCommentFilter">
+    <metadata name="net.sf.eclipsecs.core.comment" value="ignore checkstyle"/>
+  </module>
+</module>

Added: trunk/step-web-app/.settings/com.google.appengine.eclipse.core.prefs
===================================================================
--- trunk/step-web-app/.settings/com.google.appengine.eclipse.core.prefs	                        (rev 0)
+++ trunk/step-web-app/.settings/com.google.appengine.eclipse.core.prefs	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,3 @@
+#Fri Apr 02 23:41:38 BST 2010
+eclipse.preferences.version=1
+filesCopiedToWebInfLib=

Added: trunk/step-web-app/.settings/com.google.gdt.eclipse.core.prefs
===================================================================
--- trunk/step-web-app/.settings/com.google.gdt.eclipse.core.prefs	                        (rev 0)
+++ trunk/step-web-app/.settings/com.google.gdt.eclipse.core.prefs	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,5 @@
+#Sat Apr 03 19:38:49 BST 2010
+eclipse.preferences.version=1
+jarsExcludedFromWebInfLib=
+warSrcDir=war
+warSrcDirIsOutput=true

Added: trunk/step-web-app/.settings/com.google.gwt.eclipse.core.prefs
===================================================================
--- trunk/step-web-app/.settings/com.google.gwt.eclipse.core.prefs	                        (rev 0)
+++ trunk/step-web-app/.settings/com.google.gwt.eclipse.core.prefs	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,4 @@
+#Sat Apr 03 19:49:33 BST 2010
+eclipse.preferences.version=1
+entryPointModules=
+filesCopiedToWebInfLib=gwt-servlet.jar

Added: trunk/step-web-app/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/step-web-app/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ trunk/step-web-app/.settings/org.eclipse.jdt.core.prefs	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,73 @@
+#Mon Apr 05 12:08:26 BST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,BUG

Added: trunk/step-web-app/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- trunk/step-web-app/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ trunk/step-web-app/.settings/org.maven.ide.eclipse.prefs	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,9 @@
+#Sun Apr 04 22:29:56 BST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/step.gwt.xml
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/step.gwt.xml	                        (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/step.gwt.xml	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
+<module rename-to='step'>
+ <!-- Inherit the core Web Toolkit stuff.                        -->
+ <inherits name="com.google.gwt.user.User" />
+ <inherits name="com.google.gwt.inject.Inject" />
+ <inherits name='net.customware.gwt.dispatch.Dispatch' />
+ <inherits name='net.customware.gwt.presenter.Presenter' />
+
+
+ <!-- Inherit the default GWT style sheet.  You can change       -->
+ <!-- the theme of your GWT application by uncommenting          -->
+ <!-- any one of the following lines.                            -->
+ <inherits name='com.google.gwt.user.theme.standard.Standard' />
+ <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+ <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
+
+ <!-- Specify the app entry point class.                         -->
+ <entry-point class='com.tyndalehouse.step.web.client.StepEntryPoint' />
+
+ <!-- Add gwt-log support, default level `OFF` - check for 
+      extended property 'log_level' to see if this is overridden -->
+ <inherits name="com.allen_sauer.gwt.log.gwt-log-OFF" />
+
+<!-- including GWT-EXT for timeline module -->
+<inherits name='com.google.gwt.json.JSON'/>
+<inherits name='com.extjs.gxt.ui.GXT'/>
+
+ <!-- Also compile Logger at `INFO` level -->
+ <extend-property name="log_level" values="DEBUG,INFO" />
+ <set-property name="log_level" value="INFO" />
+ 
+ <!-- Turn off the floating logger - output will be shown in the 
+   hosted mode console -->
+ <set-property name="log_DivLogger" value="DISABLED" />
+ 
+ 
+ <source path="shared" />
+ <source path="client" />
+
+<!--   <stylesheet src="js/api/ext/resources/css/ext-all.css" /> -->
+<stylesheet src="gwtext/css/gxt-all.css" />
+
+
+<!--  DEV MODE SETTINGS -->
+
+ 
+</module>

Added: trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/config/environment.properties
===================================================================
--- trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/config/environment.properties	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/config/environment.properties	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,20 @@
+#some simple set up parameters for the database pool
+db.user=step
+db.password=step
+db.pool.initialSize=10
+db.pool.maxSize=20
+db.pool.validation.query=SELECT * FROM STEP.EVENT_TYPE
+db.pool.prepared.size=10
+
+#STEP can be be run with an embedded database, for e.g.
+#connection.string=jdbc:derby:c:\\documents and settings\\<username>\\TyndaleStep\\StepDB
+#db.driver=org.apache.derby.jdbc.EmbeddedDriver
+
+#or with a network server database, for e.g.
+#connection.string=jdbc:derby://localhost:1999/c:\\documents and settings\\<username>\\TyndaleStep\\StepDB
+#db.driver=org.apache.derby.jdbc.ClientDriver
+
+
+#some definitions for the query framework
+query.repository.path=com/tyndalehouse/step/web/server/db/queries/
+query.runner.cache=false

Added: trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/maps/get_locations_for_passage.sql
===================================================================
--- trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/maps/get_locations_for_passage.sql	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/maps/get_locations_for_passage.sql	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,22 @@
+--------------------------------------------------------
+-- Gets all the location for a given passage (qry_start, qry_end)
+--------------------------------------------------------
+define qry_start as integer
+define qry_end as integer
+
+select 
+	location_name,
+	lat,
+	long
+from 
+                   step.scripture_reference sr 
+        inner join step.location loc on sr.TARGET_ID = loc.location_id 
+		inner join step.lat_long ll on loc.location_id = ll.location_id
+where target_type = 2 
+  and 
+		((#qry_start# between start_verse_id and end_verse_id)    -- the query start is between the event range
+		or (#qry_end# between start_verse_id and end_verse_id)  -- the query end is between the event range
+		or (#qry_start# <= start_verse_id and #qry_end# >= start_verse_id)  -- the query start is before the event start, but the end is after the event start
+		or (#qry_end# >= end_verse_id and #qry_start# <= end_verse_id))     -- the end of the range is greater than event end, but the start is before the end
+  order by (end_verse_id - start_verse_id) asc
+ fetch first row only

Added: trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/get_events_for_date_range.sql
===================================================================
--- trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/get_events_for_date_range.sql	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/get_events_for_date_range.sql	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,31 @@
+--------------------------------------------------------
+-- Query get_events_for_date_range.sql
+-- This looks up the events that should be displayed
+-- in a certain time period 
+--------------------------------------------------------
+define min_date as bigint
+define max_date as bigint
+define timeband_id as integer
+
+select 
+	event_id, 
+	from_date, 
+	to_date, 
+	from_precision, 
+	to_precision, 
+	name, 
+	timeband_id, 
+	importance_id,
+	certainty, 
+	event_type_id 
+from 
+	step.event 
+where 
+	(
+			from_date between #min_date# and #max_date#
+		or 	to_date between #min_date# and #max_date#
+		or 	from_date < #min_date# and to_date > #max_date#
+	)
+and 
+	timeband_id = #timeband_id#
+order by from_date

Added: trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/get_timeline_setup_data.sql
===================================================================
--- trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/get_timeline_setup_data.sql	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/get_timeline_setup_data.sql	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,12 @@
+--------------------------------------------------------
+-- Query get_timeline_setup_data
+-- This looks up the main definitions for the timebands, 
+-- to initialise the timeline component
+--------------------------------------------------------
+
+select 
+	t.timeband_id, 
+	t.timeband_description,
+	t.timeband_unit
+from 
+	step.timeband t

Added: trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/lookup_timeline_origin.sql
===================================================================
--- trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/lookup_timeline_origin.sql	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/com/tyndalehouse/step/web/server/db/queries/timeline/lookup_timeline_origin.sql	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,26 @@
+--------------------------------------------------------
+-- Query lookupTimelineOrigin.sql
+-- This lookups up the origin given a particular passage
+-- then joins on the importance sub_timeband_id field
+-- to work out what the best scale is going to be
+--------------------------------------------------------
+define qry_start as integer
+define qry_end as integer
+
+select 
+    ev.from_date as origin, 
+    ev.TIMEBAND_ID,  
+    case when ev.IMPORTANCE_ID is NULL then st.sub_timeband_unit else imp.sub_timeband_unit end as unit
+from 
+                   step.scripture_reference sr 
+        inner join step.event ev on sr.TARGET_ID = ev.EVENT_ID
+        left join sub_timeband imp on imp.sub_timeband_id = ev.SUB_TIMEBAND_ID
+        left join sub_timeband st on st.SUB_TIMEBAND_ID = ev.SUB_TIMEBAND_ID
+where target_type = 1 
+  and 
+		((#qry_start# between start_verse_id and end_verse_id)    -- the query start is between the event range
+		or (#qry_end# between start_verse_id and end_verse_id)  -- the query end is between the event range
+		or (#qry_start# <= start_verse_id and #qry_end# >= start_verse_id)  -- the query start is before the event start, but the end is after the event start
+		or (#qry_end# >= end_verse_id and #qry_start# <= end_verse_id))     -- the end of the range is greater than event end, but the start is before the end
+  order by (end_verse_id - start_verse_id) asc
+ fetch first row only

Added: trunk/step-web-app/src/main/resources/log4j.properties
===================================================================
--- trunk/step-web-app/src/main/resources/log4j.properties	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/log4j.properties	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,17 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, A1, A2
+
+# A1 is set to be a ConsoleAppender.
+# A1 uses PatternLayout.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
+
+# messages on second appender
+log4j.appender.A2=org.apache.log4j.RollingFileAppender
+log4j.appender.A2.File=../logs/step-server.log
+log4j.appender.A2.MaxFileSize=100KB
+log4j.appender.A2.MaxBackupIndex=1
+log4j.appender.A2.layout=org.apache.log4j.PatternLayout
+log4j.appender.A2.layout.ConversionPattern=%p %t %c - %m%n

Added: trunk/step-web-app/src/main/resources/xsl/cswing/cutandpaste.xsl
===================================================================
--- trunk/step-web-app/src/main/resources/xsl/cswing/cutandpaste.xsl	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/xsl/cswing/cutandpaste.xsl	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,601 @@
+<?xml version="1.0"?>
+<!--
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: cutandpaste.xsl 772 2005-08-14 16:06:17Z dmsmith $
+ -->
+ <!--
+ * Transforms OSIS to HTML for viewing within JSword browsers.
+ * Note: There are custom protocols which the browser must handle.
+ * 
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+<!--
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: cutandpaste.xsl 772 2005-08-14 16:06:17Z dmsmith $
+ -->
+ <!--
+ * Transforms OSIS to HTML for viewing within JSword browsers.
+ * Note: There are custom protocols which the browser must handle.
+ * 
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ -->
+<xsl:stylesheet xmlns="http://www.w3.org/TR/REC-html40" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <xsl:output method="html" omit-xml-declaration="yes" indent="no"/>
+  <xsl:strip-space elements="*"/>
+
+  <xsl:param name="strongs.hebrew.url" select="'dict:'"/>
+  <xsl:param name="strongs.greek.url" select="'dict:'"/>
+
+  <!-- Whether to show Strongs or not -->
+  <xsl:param name="strongs" select="'true'"/>
+
+  <!-- The CSS stylesheet to use. The url must be absolute. -->
+  <xsl:param name="css"/>
+  
+  <!-- The order of display. Hebrew is rtl (right to left) -->
+  <xsl:param name="direction" select="'ltr'"/>
+
+  <!--
+  The font that is passed in is of the form: font or font,style,size 
+  where style is a bit mask with 1 being bold and 2 being italic.
+  This needs to be changed into a style="xxx" specification
+  -->
+  <xsl:param name="font" select="Serif"/>
+  <xsl:variable name="aFont">
+    <xsl:choose>
+      <xsl:when test="substring-before($font, ',') = ''"><xsl:value-of select="$font"/>,0,16</xsl:when>
+      <xsl:otherwise><xsl:value-of select="$font"/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:variable name="fontfamily" select='concat("font-family: &apos;", substring-before($aFont, ","), "&apos;;")' />
+  <xsl:variable name="fontsize" select="concat(' font-size: ', substring-after(substring-after($aFont, ','), ','), 'pt;')" />
+  <xsl:variable name="styling" select="substring-before(substring-after($aFont, ','), ',')" />
+  <xsl:variable name="fontweight">
+    <xsl:if test="$styling = '1' or $styling = '3'"><xsl:text> font-weight: bold;</xsl:text></xsl:if>
+  </xsl:variable>
+  <xsl:variable name="fontstyle">
+    <xsl:if test="$styling = '2' or $styling = '3'"> font-style: italic;</xsl:if>
+  </xsl:variable>
+  <xsl:variable name="fontspec" select="concat($fontfamily, $fontsize, $fontweight, $fontstyle)"/>
+
+  <!--
+  For now, we assume that all the works inside a corpus are of the
+  same type.
+  -->
+  <xsl:variable name="osis-id-type" select="substring-before((//osisText)[1]/@osisIDWork, '.')"/>
+
+  <xsl:variable name="page-div-type">
+    <xsl:choose>
+      <!--
+      KJV is a special case. It should be Bible.KJV, but some OSIS
+      transcriptions just use KJV instead.
+      -->
+      <xsl:when test="$osis-id-type = 'Bible' or $osis-id-type = 'KJV'">
+        <xsl:text>chapter</xsl:text>
+      </xsl:when>
+      <xsl:when test="$osis-id-type = 'Dictionary'">
+        <xsl:text>x-lexeme</xsl:text>
+      </xsl:when>
+      <xsl:when test="$osis-id-type = 'Lexicon'">
+        <xsl:text>x-lemma</xsl:text>
+      </xsl:when>
+      <xsl:when test="$osis-id-type = 'Morph'">
+        <xsl:text>x-tag</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>FIXME</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <!--=======================================================================-->
+  <xsl:template match="/osis">
+    <html dir="{$direction}">
+      <body>
+        <xsl:apply-templates/>
+      </body>
+    </html>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="osisCorpus">
+    <xsl:for-each select="osisText">
+      <!-- If this text has a header, apply templates to the header. -->
+      <xsl:if test="preceding-sibling::*[1][self::header]">
+        <div class="corpus-text-header">
+          <xsl:apply-templates select="preceding-sibling::*[1][self::header]"/>
+        </div>
+      </xsl:if>
+      <xsl:apply-templates select="."/>
+    </xsl:for-each>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="osisText">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="div">
+    <xsl:if test="@divTitle">
+      <h1><xsl:value-of select="@divTitle"/></h1>
+    </xsl:if>
+    <xsl:if test="@type = 'testament'">
+      <h2>
+        <xsl:choose>
+          <xsl:when test="preceding::div[@type = 'testament']">
+           <xsl:text>New Testament</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>Old Testament</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </h2>
+    </xsl:if>
+    <xsl:apply-templates/>
+    <xsl:if test="@divTitle">
+      <p>&#0160;</p>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="verse">
+    <p>
+      <xsl:value-of select="substring-after(substring-after(@osisID, '.'), '.')"/>
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="a">
+    <a href="{@href}">
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="note">
+    <!-- ignore notes -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="p">
+    <p><xsl:apply-templates/></p>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="p" mode="print-notes">
+    <!-- don't put para's in notes -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="seg">
+    <xsl:choose>
+      <xsl:when test="@type='font-style: italic;'">
+        <i><xsl:apply-templates/></i>
+      </xsl:when>
+      <xsl:when test="@type='font-weight: bold;'">
+        <b><xsl:apply-templates/></b>
+      </xsl:when>
+      <xsl:when test="@type='text-decoration: underline;'">
+        <u><xsl:apply-templates/></u>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'color:')">
+        <font color="substring-before(substring-after(@type, 'color: '), ';')">
+          <xsl:apply-templates/>
+        </font>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'font-size:')">
+        <font size="substring-before(substring-after(@type, 'font-size: '), ';')">
+          <xsl:apply-templates/>
+        </font>
+      </xsl:when>
+      <xsl:otherwise>
+        <p><xsl:apply-templates/></p>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="abbr">
+    <abbr class="abbr">
+      <xsl:if test="@expansion">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expansion"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </abbr>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="speaker">
+    <xsl:choose>
+      <xsl:when test="@who='Jesus'">
+        <font color="red">
+          <xsl:apply-templates/>
+        </font>
+      </xsl:when>
+      <xsl:otherwise>
+        <font color="blue">
+          <xsl:apply-templates/>
+        </font>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title">
+    <p align="right">
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title[@type='section']">
+  <!-- Done by a line in [verse]
+    <h3>
+      <xsl:apply-templates/>
+    </h3>
+  -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="reference">
+    <a href="bible://{@osisRef}">
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+
+  <xsl:template match="caption">
+    <div class="caption">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="catchWord">
+    <span class="catchWord">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <!--
+      <cell> is handled shortly after <table> below and thus does not appear
+      here.
+  -->
+  
+  <xsl:template match="closer">
+    <div class="closer">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="date">
+    <span class="date">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <xsl:template match="divineName">
+    <span class="divineName">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <xsl:template match="figure">
+    <div class="figure">
+      <img src="@src"/>  <!-- FIXME: Not necessarily an image... -->
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="foreign">
+    <em class="foreign">
+      <xsl:apply-templates/>
+    </em>
+  </xsl:template>
+  
+  <!-- This is a subheading. -->
+  <xsl:template match="head//head">
+    <h5 class="head">
+      <xsl:apply-templates/>
+    </h5>
+  </xsl:template>
+  
+  <!-- This is a top-level heading. -->
+  <xsl:template match="head">
+    <h4 class="head">
+      <xsl:apply-templates/>
+    </h4>
+  </xsl:template>
+  
+  <xsl:template match="hi">
+    <span class="hi">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+
+  <xsl:template match="index">
+    <a name="index{@id}" class="index"/>
+  </xsl:template>
+  
+  <xsl:template match="inscription">
+    <span class="inscription">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <xsl:template match="item">
+    <li class="item">
+      <xsl:apply-templates/>
+    </li>
+  </xsl:template>
+  
+  <!--
+      <item> and <label> are covered by <list> below and so do not appear here.
+  -->
+  
+  <xsl:template match="l">
+    <div class="l">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="lg">
+    <div class="lg">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="list">
+    <xsl:choose>
+      <xsl:when test="label">
+        <!-- If there are <label>s in the list, it's a <dl>. -->
+        <dl class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::label">
+                <dt class="label">
+                  <xsl:apply-templates/>
+                </dt>
+              </xsl:when>
+              <xsl:when test="self::item">
+                <dd class="item">
+                  <xsl:apply-templates/>
+                </dd>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <dd class="list-wrapper">
+                  <xsl:apply-templates select="."/>
+                </dd>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </dl>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- If there are no <label>s in the list, it's a plain old <ul>. -->
+        <ul class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::item">
+                <li class="item">
+                  <xsl:apply-templates/>
+                </li>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <li class="list-wrapper">
+                  <xsl:apply-templates select="."/>
+                </li>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="mentioned">
+    <span class="mentioned">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <!--
+      Note: I have not covered <milestone>, <milestoneStart>, or
+            <milestoneEnd> here, since I have no idea what they are supposed
+            to do, based on the spec.
+  -->
+  
+  <xsl:template match="name">
+    <span class="name">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <xsl:template match="q">
+    <!--
+        FIXME: Should I use <span> here?  The spec says that this can be used
+               as an embedded quote or a block quote, but there seems to be no
+               way to figure out which it is based on context.  Currently I've
+               got it as a <blockquote> because it has block-level elements in
+               it.
+        
+        FIXME: Should I include the speaker in the text, e.g.:
+               
+                   {@who}: {text()}
+               
+               ?  I'm not sure.  Currently I've just got it as a "title"
+               attribute on the <span>.
+    -->
+    <blockquote class="q">
+      <xsl:if test="@who">
+        <xsl:attribute name="title"><xsl:value-of select="@who"/></xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </blockquote>
+  </xsl:template>
+  
+  <xsl:template match="rdg">
+    <div class="rdg">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!--
+      <row> is handled near <table> below and so does not appear here.
+  -->
+  
+  <xsl:template match="salute">
+    <div class="salute">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="signed">
+    <span class="signed">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+
+  <xsl:template match="speech">
+    <div class="speech">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="table">
+    <table class="table">
+      <xsl:copy-of select="@rows|@cols"/>
+      <xsl:if test="head">
+        <thead class="head">
+          <xsl:apply-templates select="head"/>
+        </thead>
+      </xsl:if>
+      <tbody>
+        <xsl:apply-templates select="row"/>
+      </tbody>
+    </table>
+  </xsl:template>
+  
+  <xsl:template match="row">
+    <tr class="row">
+      <xsl:apply-templates/>
+    </tr>
+  </xsl:template>
+  
+  <xsl:template match="cell">
+    <xsl:variable name="element-name">
+      <xsl:choose>
+        <xsl:when test="@role = 'label'">
+          <xsl:text>th</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>td</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:element name="{$element-name}">
+      <xsl:attribute name="class">cell</xsl:attribute>
+      <xsl:if test="@rows">
+        <xsl:attribute name="rowspan">
+          <xsl:value-of select="@rows"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@cols">
+        <xsl:attribute name="colspan">
+          <xsl:value-of select="@cols"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="transChange">
+    <span class="transChange">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+      Named templates
+   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  
+  <xsl:template name="trim-zeros-from-number">
+    <xsl:param name="number" select="'0'"/>
+    <xsl:value-of select="string(number($number))"/>
+  </xsl:template>
+  
+  <xsl:template name="print-prev-next-links">
+    <xsl:param name="div" select="."/>
+    
+    <xsl:variable name="previous-section" select="$div/preceding::div[@type = $page-div-type][1]"/>
+    <xsl:variable name="next-section" select="$div/following::div[@type = $page-div-type][1]"/>
+    <xsl:if test="$previous-section or $next-section">
+      <table width="100%" class="navigation">
+        <tr>
+          <xsl:if test="$previous-section">
+            <td align="left">
+              <a href="{$previous-section/@osisID}.html" class="previous-link">[&lt; Previous]</a>
+            </td>
+          </xsl:if>
+          <xsl:if test="$next-section">
+            <td align="right">
+              <a href="{$next-section/@osisID}.html" class="next-link">[Next &gt;]</a>
+            </td>
+          </xsl:if>
+        </tr>
+      </table>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>

Added: trunk/step-web-app/src/main/resources/xsl/cswing/cutandpaste2.xsl
===================================================================
--- trunk/step-web-app/src/main/resources/xsl/cswing/cutandpaste2.xsl	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/xsl/cswing/cutandpaste2.xsl	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,578 @@
+<?xml version="1.0"?>
+<!--
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: cutandpaste2.xsl 772 2005-08-14 16:06:17Z dmsmith $
+ -->
+ <!--
+ * Transforms OSIS to HTML for viewing within JSword browsers.
+ * Note: There are custom protocols which the browser must handle.
+ * 
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ -->
+<xsl:stylesheet xmlns="http://www.w3.org/TR/REC-html40" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <xsl:output method="html" omit-xml-declaration="yes" indent="no"/>
+  <xsl:strip-space elements="*"/>
+
+  <xsl:param name="strongs.hebrew.url" select="'dict:'"/>
+  <xsl:param name="strongs.greek.url" select="'dict:'"/>
+
+  <!-- Whether to show Strongs or not -->
+  <xsl:param name="strongs" select="'true'"/>
+
+  <!-- The CSS stylesheet to use. The url must be absolute. -->
+  <xsl:param name="css"/>
+  
+  <!-- The order of display. Hebrew is rtl (right to left) -->
+  <xsl:param name="direction" select="'ltr'"/>
+
+  <!--
+  The font that is passed in is of the form: font or font,style,size 
+  where style is a bit mask with 1 being bold and 2 being italic.
+  This needs to be changed into a style="xxx" specification
+  -->
+  <xsl:param name="font" select="Serif"/>
+  <xsl:variable name="aFont">
+    <xsl:choose>
+      <xsl:when test="substring-before($font, ',') = ''"><xsl:value-of select="$font"/>,0,16</xsl:when>
+      <xsl:otherwise><xsl:value-of select="$font"/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:variable name="fontfamily" select='concat("font-family: &apos;", substring-before($aFont, ","), "&apos;;")' />
+  <xsl:variable name="fontsize" select="concat(' font-size: ', substring-after(substring-after($aFont, ','), ','), 'pt;')" />
+  <xsl:variable name="styling" select="substring-before(substring-after($aFont, ','), ',')" />
+  <xsl:variable name="fontweight">
+    <xsl:if test="$styling = '1' or $styling = '3'"><xsl:text> font-weight: bold;</xsl:text></xsl:if>
+  </xsl:variable>
+  <xsl:variable name="fontstyle">
+    <xsl:if test="$styling = '2' or $styling = '3'"> font-style: italic;</xsl:if>
+  </xsl:variable>
+  <xsl:variable name="fontspec" select="concat($fontfamily, $fontsize, $fontweight, $fontstyle)"/>
+
+  <!--
+  For now, we assume that all the works inside a corpus are of the
+  same type.
+  -->
+  <xsl:variable name="osis-id-type" select="substring-before((//osisText)[1]/@osisIDWork, '.')"/>
+
+  <xsl:variable name="page-div-type">
+    <xsl:choose>
+      <!--
+      KJV is a special case. It should be Bible.KJV, but some OSIS
+      transcriptions just use KJV instead.
+      -->
+      <xsl:when test="$osis-id-type = 'Bible' or $osis-id-type = 'KJV'">
+        <xsl:text>chapter</xsl:text>
+      </xsl:when>
+      <xsl:when test="$osis-id-type = 'Dictionary'">
+        <xsl:text>x-lexeme</xsl:text>
+      </xsl:when>
+      <xsl:when test="$osis-id-type = 'Lexicon'">
+        <xsl:text>x-lemma</xsl:text>
+      </xsl:when>
+      <xsl:when test="$osis-id-type = 'Morph'">
+        <xsl:text>x-tag</xsl:text>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>FIXME</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <!--=======================================================================-->
+  <xsl:template match="/osis">
+    <html dir="{$direction}">
+      <body>
+        <xsl:apply-templates/>
+      </body>
+    </html>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="osisCorpus">
+    <xsl:for-each select="osisText">
+      <!-- If this text has a header, apply templates to the header. -->
+      <xsl:if test="preceding-sibling::*[1][self::header]">
+        <div class="corpus-text-header">
+          <xsl:apply-templates select="preceding-sibling::*[1][self::header]"/>
+        </div>
+      </xsl:if>
+      <xsl:apply-templates select="."/>
+    </xsl:for-each>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="osisText">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="div">
+    <xsl:if test="@divTitle">
+      <h1><xsl:value-of select="@divTitle"/></h1>
+    </xsl:if>
+    <xsl:if test="@type = 'testament'">
+      <h2>
+        <xsl:choose>
+          <xsl:when test="preceding::div[@type = 'testament']">
+           <xsl:text>New Testament</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>Old Testament</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </h2>
+    </xsl:if>
+    <xsl:apply-templates/>
+    <xsl:if test="@divTitle">
+      <p>&#0160;</p>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="verse">
+    <!-- ignore verse numbers -->
+
+    <xsl:variable name="title" select=".//title"/>
+    <xsl:if test="string-length($title) > 0">
+      <p><xsl:value-of select="$title"/></p>
+    </xsl:if>
+
+    <xsl:apply-templates/>
+    <xsl:text> </xsl:text>
+
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="a">
+    <a href="{@href}">
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="note">
+    <!-- ignore notes -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="p">
+    <p><xsl:apply-templates/></p>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="p" mode="print-notes">
+    <!-- don't put para's in notes -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="seg">
+    <xsl:choose>
+      <xsl:when test="@type='font-style: italic;'">
+        <i><xsl:apply-templates/></i>
+      </xsl:when>
+      <xsl:when test="@type='font-weight: bold;'">
+        <b><xsl:apply-templates/></b>
+      </xsl:when>
+      <xsl:when test="@type='text-decoration: underline;'">
+        <u><xsl:apply-templates/></u>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'color:')">
+        <font color="substring-before(substring-after(@type, 'color: '), ';')">
+          <xsl:apply-templates/>
+        </font>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'font-size:')">
+        <font size="substring-before(substring-after(@type, 'font-size: '), ';')">
+          <xsl:apply-templates/>
+        </font>
+      </xsl:when>
+      <xsl:otherwise>
+        <p><xsl:apply-templates/></p>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="abbr">
+    <abbr class="abbr">
+      <xsl:if test="@expansion">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expansion"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </abbr>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="speaker">
+    <xsl:choose>
+      <xsl:when test="@who='Jesus'">
+        <font color="red">
+          <xsl:apply-templates/>
+        </font>
+      </xsl:when>
+      <xsl:otherwise>
+        <font color="blue">
+          <xsl:apply-templates/>
+        </font>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title">
+    <p align="right">
+      <xsl:apply-templates/>
+    </p>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title[@type='section']">
+  <!-- Done by a line in [verse]
+    <h3>
+      <xsl:apply-templates/>
+    </h3>
+  -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="reference">
+    <a href="bible://{@osisRef}">
+      <xsl:apply-templates/>
+    </a>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+
+  <xsl:template match="caption">
+    <div class="caption">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="catchWord">
+    <span class="catchWord">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <!--
+      <cell> is handled shortly after <table> below and thus does not appear
+      here.
+  -->
+  
+  <xsl:template match="closer">
+    <div class="closer">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="date">
+    <span class="date">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <xsl:template match="divineName">
+    <span class="divineName">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <xsl:template match="figure">
+    <div class="figure">
+      <img src="@src"/>  <!-- FIXME: Not necessarily an image... -->
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="foreign">
+    <em class="foreign">
+      <xsl:apply-templates/>
+    </em>
+  </xsl:template>
+  
+  <!-- This is a subheading. -->
+  <xsl:template match="head//head">
+    <h5 class="head">
+      <xsl:apply-templates/>
+    </h5>
+  </xsl:template>
+  
+  <!-- This is a top-level heading. -->
+  <xsl:template match="head">
+    <h4 class="head">
+      <xsl:apply-templates/>
+    </h4>
+  </xsl:template>
+  
+  <xsl:template match="hi">
+    <span class="hi">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+
+  <xsl:template match="index">
+    <a name="index{@id}" class="index"/>
+  </xsl:template>
+  
+  <xsl:template match="inscription">
+    <span class="inscription">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <xsl:template match="item">
+    <li class="item">
+      <xsl:apply-templates/>
+    </li>
+  </xsl:template>
+  
+  <!--
+      <item> and <label> are covered by <list> below and so do not appear here.
+  -->
+  
+  <xsl:template match="l">
+    <div class="l">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="lg">
+    <div class="lg">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="list">
+    <xsl:choose>
+      <xsl:when test="label">
+        <!-- If there are <label>s in the list, it's a <dl>. -->
+        <dl class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::label">
+                <dt class="label">
+                  <xsl:apply-templates/>
+                </dt>
+              </xsl:when>
+              <xsl:when test="self::item">
+                <dd class="item">
+                  <xsl:apply-templates/>
+                </dd>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <dd class="list-wrapper">
+                  <xsl:apply-templates select="."/>
+                </dd>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </dl>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- If there are no <label>s in the list, it's a plain old <ul>. -->
+        <ul class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::item">
+                <li class="item">
+                  <xsl:apply-templates/>
+                </li>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <li class="list-wrapper">
+                  <xsl:apply-templates select="."/>
+                </li>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="mentioned">
+    <span class="mentioned">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <!--
+      Note: I have not covered <milestone>, <milestoneStart>, or
+            <milestoneEnd> here, since I have no idea what they are supposed
+            to do, based on the spec.
+  -->
+  
+  <xsl:template match="name">
+    <span class="name">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  <xsl:template match="q">
+    <!--
+        FIXME: Should I use <span> here?  The spec says that this can be used
+               as an embedded quote or a block quote, but there seems to be no
+               way to figure out which it is based on context.  Currently I've
+               got it as a <blockquote> because it has block-level elements in
+               it.
+        
+        FIXME: Should I include the speaker in the text, e.g.:
+               
+                   {@who}: {text()}
+               
+               ?  I'm not sure.  Currently I've just got it as a "title"
+               attribute on the <span>.
+    -->
+    <blockquote class="q">
+      <xsl:if test="@who">
+        <xsl:attribute name="title"><xsl:value-of select="@who"/></xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </blockquote>
+  </xsl:template>
+  
+  <xsl:template match="rdg">
+    <div class="rdg">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!--
+      <row> is handled near <table> below and so does not appear here.
+  -->
+  
+  <xsl:template match="salute">
+    <div class="salute">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="signed">
+    <span class="signed">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+
+  <xsl:template match="speech">
+    <div class="speech">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="table">
+    <table class="table">
+      <xsl:copy-of select="@rows|@cols"/>
+      <xsl:if test="head">
+        <thead class="head">
+          <xsl:apply-templates select="head"/>
+        </thead>
+      </xsl:if>
+      <tbody>
+        <xsl:apply-templates select="row"/>
+      </tbody>
+    </table>
+  </xsl:template>
+  
+  <xsl:template match="row">
+    <tr class="row">
+      <xsl:apply-templates/>
+    </tr>
+  </xsl:template>
+  
+  <xsl:template match="cell">
+    <xsl:variable name="element-name">
+      <xsl:choose>
+        <xsl:when test="@role = 'label'">
+          <xsl:text>th</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>td</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:element name="{$element-name}">
+      <xsl:attribute name="class">cell</xsl:attribute>
+      <xsl:if test="@rows">
+        <xsl:attribute name="rowspan">
+          <xsl:value-of select="@rows"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@cols">
+        <xsl:attribute name="colspan">
+          <xsl:value-of select="@cols"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="transChange">
+    <span class="transChange">
+      <xsl:apply-templates/>
+    </span>
+  </xsl:template>
+  
+  
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+      Named templates
+   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  
+  <xsl:template name="trim-zeros-from-number">
+    <xsl:param name="number" select="'0'"/>
+    <xsl:value-of select="string(number($number))"/>
+  </xsl:template>
+  
+  <xsl:template name="print-prev-next-links">
+    <xsl:param name="div" select="."/>
+    
+    <xsl:variable name="previous-section" select="$div/preceding::div[@type = $page-div-type][1]"/>
+    <xsl:variable name="next-section" select="$div/following::div[@type = $page-div-type][1]"/>
+    <xsl:if test="$previous-section or $next-section">
+      <table width="100%" class="navigation">
+        <tr>
+          <xsl:if test="$previous-section">
+            <td align="left">
+              <a href="{$previous-section/@osisID}.html" class="previous-link">[&lt; Previous]</a>
+            </td>
+          </xsl:if>
+          <xsl:if test="$next-section">
+            <td align="right">
+              <a href="{$next-section/@osisID}.html" class="next-link">[Next &gt;]</a>
+            </td>
+          </xsl:if>
+        </tr>
+      </table>
+    </xsl:if>
+  </xsl:template>
+</xsl:stylesheet>

Added: trunk/step-web-app/src/main/resources/xsl/cswing/index.txt
===================================================================
--- trunk/step-web-app/src/main/resources/xsl/cswing/index.txt	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/xsl/cswing/index.txt	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1 @@
+simple.xsl
\ No newline at end of file

Added: trunk/step-web-app/src/main/resources/xsl/cswing/simple.xsl
===================================================================
--- trunk/step-web-app/src/main/resources/xsl/cswing/simple.xsl	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/xsl/cswing/simple.xsl	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,1600 @@
+<?xml version="1.0"?>
+<!--
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: simple.xsl 1943 2009-03-25 11:43:28Z dmsmith $
+ -->
+ <!--
+ * Transforms OSIS to HTML for viewing within JSword browsers.
+ * Note: There are custom protocols which the browser must handle.
+ * 
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ -->
+ <xsl:stylesheet
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version="1.0"
+  xmlns:jsword="http://xml.apache.org/xalan/java"
+  extension-element-prefixes="jsword">
+
+  <!--  Version 3.0 is necessary to get br to work correctly. -->
+  <xsl:output method="html" version="3.0" omit-xml-declaration="yes" indent="no"/>
+
+  <!-- Be very careful about introducing whitespace into the document.
+       strip-space merely remove space between one tag and another tag.
+       This may cause significant whitespace to be removed.
+       
+       It is easy to have apply-templates on a line to itself which if
+       it encounters text before anything else will introduce whitespace.
+       With the browser we are using, span will introduce whitespace
+       but font does not. Therefore we use font as a span.
+    -->
+  <!-- gdef and hdef refer to hebrew and greek definitions keyed by strongs -->
+  <xsl:param name="greek.def.protocol" select="'gdef:'"/>
+  <xsl:param name="hebrew.def.protocol" select="'hdef:'"/>
+  <xsl:param name="lex.def.protocol" select="'lex:'"/>
+  <!-- currently these are not used, but they are for morphologic forms -->
+  <xsl:param name="greek.morph.protocol" select="'gmorph:'"/>
+  <xsl:param name="hebrew.morph.protocol" select="'hmorph:'"/>
+
+  <!-- The absolute base for relative references. -->
+  <xsl:param name="baseURL" select="''"/>
+
+  <!-- Whether to show Strongs or not -->
+  <xsl:param name="Strongs" select="'false'"/>
+
+  <!-- Whether to show morphologic forms or not -->
+  <xsl:param name="Morph" select="'false'"/>
+
+  <!-- Whether to start each verse on an new line or not -->
+  <xsl:param name="VLine" select="'false'"/>
+
+  <!-- Whether to show non-canonical "headings" or not -->
+  <xsl:param name="Headings" select="'true'"/>
+
+  <!-- Whether to show notes or not -->
+  <xsl:param name="Notes" select="'true'"/>
+
+  <!-- Whether to have linking cross references or not -->
+  <xsl:param name="XRef" select="'true'"/>
+
+  <!-- Whether to output no Verse numbers -->
+  <xsl:param name="NoVNum" select="'false'"/>
+
+  <!-- Whether to output Verse numbers or not -->
+  <xsl:param name="VNum" select="'true'"/>
+
+  <!-- Whether to output Chapter and Verse numbers or not -->
+  <xsl:param name="CVNum" select="'false'"/>
+
+  <!-- Whether to output Book, Chapter and Verse numbers or not -->
+  <xsl:param name="BCVNum" select="'false'"/>
+
+  <!-- Whether to output superscript verse numbers or normal size ones -->
+  <xsl:param name="TinyVNum" select="'true'"/>
+
+  <!-- The CSS stylesheet to use. The url must be absolute. -->
+  <xsl:param name="css"/>
+  
+  <!-- The order of display. Hebrew is rtl (right to left) -->
+  <xsl:param name="direction" select="'ltr'"/>
+
+  <!-- The font that is passed in is in one of two forms:
+    FamilyName-STYLE-size, where STYLE is either PLAIN, BOLD, ITALIC or BOLDITALIC
+    or
+    FamilyName,style,size, where STYLE is 0 for PLAIN, 1 for BOLD, 2 for ITALIC or 3 for BOLDITALIC.
+    This needs to be changed into a CSS style specification
+  -->
+  <xsl:param name="font" select="Serif"/>
+
+  <xsl:variable name="fontspec">
+      <xsl:call-template name="generateFontStyle">
+        <xsl:with-param name="fontspec" select="$font"/>
+        <xsl:with-param name="style">css</xsl:with-param>
+      </xsl:call-template>
+  </xsl:variable>
+
+  <!-- Create a global key factory from which OSIS ids will be generated -->
+  <xsl:variable name="keyf" select="jsword:org.crosswire.jsword.passage.PassageKeyFactory.instance()"/>
+  <!-- Create a global number shaper that can transform 0-9 into other number systems. -->
+  <xsl:variable name="shaper" select="jsword:org.crosswire.common.icu.NumberShaper.new()"/>
+
+  <!--=======================================================================-->
+  <xsl:template match="/">
+    <html dir="{$direction}">
+      <head>
+        <base href="{$baseURL}"/>
+        <style type="text/css">
+          BODY { background:white; <xsl:value-of select="$fontspec" /> }
+          A { text-decoration: none; }
+          A.strongs { color: black; text-decoration: none; }
+          SUB.strongs { font-size: 75%; color: red; }
+          SUB.morph { font-size: 75%; color: blue; }
+          SUB.lemma { font-size: 75%; color: red; }
+          SUP.verse { font-size: 75%; color: gray; }
+          SUP.note { font-size: 75%; color: green; }
+          FONT.lex { color: red; }
+          FONT.jesus { color: red; }
+          FONT.speech { color: blue; }
+          FONT.strike { text-decoration: line-through; }
+          FONT.small-caps { font-variant: small-caps; }
+          FONT.inscription { font-weight: bold; font-variant: small-caps; }
+          FONT.divineName { font-variant: small-caps; }
+          FONT.normal { font-variant: normal; }
+          FONT.caps { text-transform: uppercase; }
+          H1.level { text-align: center; font-size: 115%; color: #000000; }
+          H2.level { text-align: center; font-size: 110%; color: #000000; }
+          H3.level { text-align: center; font-size: 100%; }
+          H4.level { text-align: center; font-size: 90%; }
+          H5.level { text-align: center; font-size: 85%; }
+          H6.level { text-align: center; font-size: 80%; }
+          H3.heading { font-size: 110%; color: #666699; font-weight: bold; }
+          H2.heading { font-size: 115%; color: #669966; font-weight: bold; }
+          div.margin { font-size:90%; }
+          TD.notes { width:20%; background:#f4f4e8; }
+          TD.text { width:80%; }
+          <!-- the following are for dictionary entries -->
+          FONT.orth { font-weight: bold; }
+          FONT.pron { font-style: italic; }
+          FONT.def  { font-style: italic; }
+          FONT.usg  { font-style: plain; }
+        </style>
+        <!-- Always include the user's stylesheet even if "" -->
+        <link rel="stylesheet" type="text/css" href="{$css}" title="styling" />
+      </head>
+      <body>
+        <!-- If there are notes, output a table with notes in the 2nd column. -->
+        <!-- There is a rendering bug which prevents the notes from adhering to the right edge. -->
+        <xsl:choose>
+          <xsl:when test="$Notes = 'true' and //note[not(@type = 'x-strongsMarkup')]">
+            <xsl:choose>
+              <xsl:when test="$direction != 'rtl'">
+                <table cols="2" cellpadding="5" cellspacing="5">
+                  <tr>
+                    <!-- The two rows are swapped until the bug is fixed. -->
+                    <td valign="top" class="notes">
+                      <p>&#160;</p>
+                      <xsl:apply-templates select="//verse" mode="print-notes"/>
+                    </td>
+                    <td valign="top" class="text">
+                      <xsl:apply-templates/>
+                    </td>
+                  </tr>
+                </table>
+              </xsl:when>
+              <xsl:otherwise>
+                <!-- reverse the table for Right to Left languages -->
+                <table cols="2" cellpadding="5" cellspacing="5">
+                  <!-- In a right to left, the alignment should be reversed too -->
+                  <tr align="right">
+                    <td valign="top" class="notes">
+                      <p>&#160;</p>
+                      <xsl:apply-templates select="//note" mode="print-notes"/>
+                    </td>
+                    <td valign="top" class="text">
+                      <xsl:apply-templates/>
+                    </td>
+                  </tr>
+                </table>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </body>
+    </html>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == A proper OSIS document has osis as it's root.
+    == We dig deeper for it's content.
+    -->
+  <xsl:template match="osis">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == An OSIS document may contain more that one work.
+    == Each work is held in an osisCorpus element.
+    == If there is only one work, then this element will (should) be absent.
+    == Process each document in turn.
+    == It might be reasonable to dig into the header element of each work
+    == and get its title.
+    == Otherwise, we ignore the header and work elements and just process
+    == the osisText elements.
+    -->
+  <xsl:template match="osisCorpus">
+    <xsl:apply-templates select="osisText"/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == Each work has an osisText element.
+    == We ignore the header and work elements and process its div elements.
+    == While divs can be milestoned, the osisText element requires container
+    == divs.
+    -->
+  <xsl:template match="osisText">
+    <xsl:apply-templates select="div"/>
+  </xsl:template>
+  
+  <!-- Ignore headers and its elements -->
+  <xsl:template match="header"/>
+  <xsl:template match="revisionDesc"/>
+  <xsl:template match="work"/>
+   <!-- <xsl:template match="title"/> who's parent is work -->
+  <xsl:template match="contributor"/>
+  <xsl:template match="creator"/>
+  <xsl:template match="subject"/>
+  <!-- <xsl:template match="date"/> who's parent is work -->
+  <xsl:template match="description"/>
+  <xsl:template match="publisher"/>
+  <xsl:template match="type"/>
+  <xsl:template match="format"/>
+  <xsl:template match="identifier"/>
+  <xsl:template match="source"/>
+  <xsl:template match="language"/>
+  <xsl:template match="relation"/>
+  <xsl:template match="coverage"/>
+  <xsl:template match="rights"/>
+  <xsl:template match="scope"/>
+  <xsl:template match="workPrefix"/>
+  <xsl:template match="castList"/>
+  <xsl:template match="castGroup"/>
+  <xsl:template match="castItem"/>
+  <xsl:template match="actor"/>
+  <xsl:template match="role"/>
+  <xsl:template match="roleDesc"/>
+  <xsl:template match="teiHeader"/>
+  <xsl:template match="refSystem"/>
+
+
+  <!-- Ignore titlePage -->
+  <xsl:template match="titlePage"/>
+
+  <!--=======================================================================-->
+  <!-- 
+    == Div provides the major containers for a work.
+    == Divs are milestoneable.
+    -->
+  <xsl:template match="div[@type='x-center']">
+    <div align="center">
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="div">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="div" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!-- Handle verses as containers and as a start verse.                     -->
+  <xsl:template match="verse[not(@eID)]">
+    <!-- output each preverse element in turn -->
+    <xsl:for-each select=".//*[@subType = 'x-preverse' or @subtype = 'x-preverse']">
+      <xsl:choose>
+        <xsl:when test="local-name() = 'title'">
+          <!-- Always show canonical titles or if headings is turned on -->
+          <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+            <h3 class="heading"><xsl:apply-templates /></h3>
+          </xsl:if>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates />
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <!-- Handle the KJV paragraph marker. -->
+    <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <!-- If the verse doesn't start on its own line and -->
+    <!-- the verse is not the first verse of a set of siblings, -->
+    <!-- output an extra space. -->
+    <xsl:if test="$VLine = 'false' and preceding-sibling::*[local-name() = 'verse']">
+      <xsl:text>&#160;</xsl:text>
+    </xsl:if>
+    <!-- Always output the verse -->
+    <xsl:choose>
+      <xsl:when test="$VLine = 'true'">
+        <div class="l"><a name="{@osisID}"><xsl:call-template name="versenum"/></a><xsl:apply-templates/></div>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="versenum"/><xsl:apply-templates/>
+        <!-- Follow the verse with an extra space -->
+        <!-- when they don't start on lines to themselves -->
+        <xsl:text> </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="verse[not(@eID)]" mode="jesus">
+    <!-- If the verse doesn't start on its own line and -->
+    <!-- the verse is not the first verse of a set of siblings, -->
+    <!-- output an extra space. -->
+    <xsl:if test="$VLine = 'false' and preceding-sibling::*[local-name() = 'verse']">
+      <xsl:text>&#160;</xsl:text>
+    </xsl:if>
+    <xsl:variable name="title" select=".//title"/>
+    <xsl:if test="string-length($title) > 0">
+      <h3 class="heading"><xsl:value-of select="$title"/></h3>
+    </xsl:if>
+    <!-- Handle the KJV paragraph marker. -->
+    <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <!-- Always output the verse -->
+    <xsl:choose>
+      <xsl:when test="$VLine = 'true'">
+        <div class="l"><a name="{@osisID}"><xsl:call-template name="versenum"/></a><xsl:apply-templates mode="jesus"/></div>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="versenum"/><xsl:apply-templates mode="jesus"/>
+        <!-- Follow the verse with an extra space -->
+        <!-- when they don't start on lines to themselves -->
+        <xsl:text> </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="verse" mode="print-notes">
+    <xsl:if test=".//note[not(@type) or not(@type = 'x-strongsMarkup')]">
+      <xsl:variable name="passage" select="jsword:getValidKey($keyf, @osisID)"/>
+      <a href="#{substring-before(concat(@osisID, ' '), ' ')}">
+        <xsl:value-of select="jsword:getName($passage)"/>
+      </a>
+      <xsl:apply-templates select=".//note" mode="print-notes" />
+      <div><xsl:text>&#160;</xsl:text></div>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="versenum">
+    <!-- Are verse numbers wanted? -->
+    <xsl:if test="$NoVNum = 'false'">
+      <!-- An osisID can be a space separated list of them -->
+      <xsl:variable name="firstOsisID" select="substring-before(concat(@osisID, ' '), ' ')"/>
+      <xsl:variable name="book" select="substring-before($firstOsisID, '.')"/>
+      <xsl:variable name="chapter" select="jsword:shape($shaper, substring-before(substring-after($firstOsisID, '.'), '.'))"/>
+      <!-- If n is present use it for the number -->
+      <xsl:variable name="verse">
+        <xsl:choose>
+          <xsl:when test="@n">
+            <xsl:value-of select="jsword:shape($shaper, string(@n))"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="jsword:shape($shaper, substring-after(substring-after($firstOsisID, '.'), '.'))"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <xsl:variable name="versenum">
+        <xsl:choose>
+          <xsl:when test="$BCVNum = 'true'">
+            <xsl:variable name="passage" select="jsword:getValidKey($keyf, @osisID)"/>
+            <xsl:value-of select="jsword:getName($passage)"/>
+          </xsl:when>
+          <xsl:when test="$CVNum = 'true'">
+            <xsl:value-of select="concat($chapter, ' : ', $verse)"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="$verse"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <!--
+        == Surround versenum with something that forces a proper bidi context in Java.
+        == Sup does not.
+        -->
+      <xsl:choose>
+        <xsl:when test="$TinyVNum = 'true' and $Notes = 'true'">
+          <a name="{@osisID}"><sup class="verse"><font><xsl:value-of select="$versenum"/></font></sup></a>
+        </xsl:when>
+        <xsl:when test="$TinyVNum = 'true' and $Notes = 'false'">
+          <sup class="verse"><font><xsl:value-of select="$versenum"/></font></sup>
+        </xsl:when>
+        <xsl:when test="$TinyVNum = 'false' and $Notes = 'true'">
+          <a name="{@osisID}">(<font><xsl:value-of select="$versenum"/></font>)</a>
+          <xsl:text> </xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          (<font><xsl:value-of select="$versenum"/></font>)
+          <xsl:text> </xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+    <xsl:if test="$VNum = 'false' and $Notes = 'true'">
+      <a name="{@osisID}"></a>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="a">
+    <a href="{@href}"><xsl:apply-templates/></a>
+  </xsl:template>
+
+  <xsl:template match="a" mode="jesus">
+    <a href="{@href}"><xsl:apply-templates mode="jesus"/></a>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!-- When we encounter a note, we merely output a link to the note. -->
+  <xsl:template match="note[@type = 'x-strongsMarkup']"/>
+  <xsl:template match="note[@type = 'x-strongsMarkup']" mode="jesus"/>
+  <xsl:template match="note[@type = 'x-strongsMarkup']" mode="print-notes"/>
+
+  <xsl:template match="note">
+    <xsl:if test="$Notes = 'true'">
+      <!-- If there is a following sibling that is a note, emit a separator -->
+      <xsl:variable name="siblings" select="../child::node()"/>
+      <xsl:variable name="next-position" select="position() + 1"/>
+      <xsl:choose>
+        <xsl:when test="name($siblings[$next-position]) = 'note'">
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a>, </sup>
+        </xsl:when>
+        <xsl:otherwise>
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a></sup>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="note" mode="jesus">
+    <xsl:if test="$Notes = 'true'">
+     <!-- If there is a following sibling that is a note, emit a separator -->
+      <xsl:variable name="siblings" select="../child::node()"/>
+      <xsl:variable name="next-position" select="position() + 1"/>
+      <xsl:choose>
+        <xsl:when test="$siblings[$next-position] and name($siblings[$next-position]) = 'note'">
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a>, </sup>
+        </xsl:when>
+        <xsl:otherwise>
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a></sup>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="note" mode="print-notes">
+    <div class="margin">
+      <strong><xsl:call-template name="generateNoteXref"/></strong>
+      <a name="note-{generate-id(.)}">
+        <xsl:text> </xsl:text>
+      </a>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!--
+    == If the n attribute is present then use that for the cross ref otherwise create a letter.
+    == Note: numbering restarts with each verse.
+    -->
+  <xsl:template name="generateNoteXref">
+    <xsl:choose>
+      <xsl:when test="@n">
+        <xsl:value-of select="@n"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:number level="any" from="/osis//verse" format="a"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="p">
+    <p><xsl:apply-templates/></p>
+  </xsl:template>
+  
+  <xsl:template match="p" mode="jesus">
+    <p><xsl:apply-templates mode="jesus"/></p>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="p" mode="print-notes">
+    <!-- FIXME: This ignores text in the note. -->
+    <!-- don't put para's in notes -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="w">
+    <!-- Output the content followed by all the lemmas and then all the morphs. -->
+    <xsl:apply-templates/>
+    <xsl:if test="$Strongs = 'true' and (starts-with(@lemma, 'x-Strongs:') or starts-with(@lemma, 'strong:'))">
+      <xsl:call-template name="lemma">
+        <xsl:with-param name="lemma" select="@lemma"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:if test="$Morph = 'true' and (starts-with(@morph, 'x-Robinson:') or starts-with(@morph, 'robinson:'))">
+      <xsl:call-template name="morph">
+        <xsl:with-param name="morph" select="@morph"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:if test="$Strongs = 'true' and starts-with(@lemma, 'lemma.Strong:')">
+      <xsl:call-template name="lemma">
+        <xsl:with-param name="lemma" select="@lemma"/>
+      </xsl:call-template>
+    </xsl:if>
+    <!--
+        except when followed by a text node or non-printing node.
+        This is true whether the href is output or not.
+    -->
+    <xsl:variable name="siblings" select="../child::node()"/>
+    <xsl:variable name="next-position" select="position() + 1"/>
+    <xsl:if test="$siblings[$next-position] and name($siblings[$next-position]) != ''">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="w" mode="jesus">
+    <!-- Output the content followed by all the lemmas and then all the morphs. -->
+    <xsl:apply-templates mode="jesus"/>
+    <xsl:if test="$Strongs = 'true' and (starts-with(@lemma, 'x-Strongs:') or starts-with(@lemma, 'strong:'))">
+      <xsl:call-template name="lemma">
+        <xsl:with-param name="lemma" select="@lemma"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:if test="$Morph = 'true' and (starts-with(@morph, 'x-Robinson:') or starts-with(@morph, 'robinson:'))">
+      <xsl:call-template name="morph">
+        <xsl:with-param name="morph" select="@morph"/>
+      </xsl:call-template>
+    </xsl:if>
+    <!--
+        except when followed by a text node or non-printing node.
+        This is true whether the href is output or not.
+    -->
+    <xsl:variable name="siblings" select="../child::node()"/>
+    <xsl:variable name="next-position" select="position() + 1"/>
+    <xsl:if test="$siblings[$next-position] and name($siblings[$next-position]) != ''">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template name="lemma">
+    <xsl:param name="lemma"/>
+    <xsl:param name="part" select="0"/>
+    <xsl:variable name="orig-lemma" select="substring-after($lemma, ':')"/>
+    <xsl:variable name="protocol">
+      <xsl:choose>
+        <xsl:when test="substring($orig-lemma, 1, 1) = 'H'">
+          <xsl:value-of select="$hebrew.def.protocol"/>
+        </xsl:when>
+        <xsl:when test="substring($orig-lemma, 1, 1) = 'G'">
+          <xsl:value-of select="$greek.def.protocol"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$lex.def.protocol"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="separator">
+      <xsl:choose>
+        <xsl:when test="contains($orig-lemma, '|')">
+          <xsl:value-of select="'|'"/>
+        </xsl:when>
+        <xsl:when test="contains($orig-lemma, ' ')">
+          <xsl:value-of select="' '"/>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="sub">
+      <xsl:choose>
+        <xsl:when test="$separator != '' and $part = '0'">
+          <xsl:value-of select="$part + 1"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$part"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$protocol = $lex.def.protocol">
+        <font class="lex">[<xsl:value-of select="$orig-lemma"/>]</font>
+      </xsl:when>
+      <xsl:when test="$separator = ''">
+        <!-- <sub class="strongs"><a href="{$protocol}{$orig-lemma}">S<xsl:number level="any" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a></sub> -->
+        <sub class="strongs"><a href="{$protocol}{$orig-lemma}"><xsl:value-of select="format-number(substring($orig-lemma,2),'#')"/></a></sub>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- <sub class="strongs"><a href="{$protocol}{substring-before($orig-lemma, $separator)}">S<xsl:number level="single" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a>, </sub> -->
+        <sub class="strongs"><a href="{$protocol}{substring-before($orig-lemma, $separator)}"><xsl:value-of select="format-number(substring(substring-before($orig-lemma, $separator),2),'#')"/></a>, </sub>
+        <xsl:call-template name="lemma">
+          <xsl:with-param name="lemma" select="substring-after($lemma, $separator)"/>
+          <xsl:with-param name="part">
+            <xsl:choose>
+              <xsl:when test="$sub">
+                <xsl:value-of select="$sub + 1"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="1"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="morph">
+    <xsl:param name="morph"/>
+    <xsl:param name="part" select="0"/>
+    <xsl:variable name="orig-work" select="substring-before($morph, ':')"/>
+    <xsl:variable name="orig-morph" select="substring-after($morph, ':')"/>
+    <xsl:variable name="protocol">
+      <xsl:choose>
+        <xsl:when test="starts-with($orig-work, 'x-Robinson') or starts-with($orig-work, 'robinson')">
+          <xsl:value-of select="$greek.morph.protocol"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$hebrew.morph.protocol"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="separator">
+      <xsl:choose>
+        <xsl:when test="contains($orig-morph, '|')">
+          <xsl:value-of select="'|'"/>
+        </xsl:when>
+        <xsl:when test="contains($orig-morph, ' ')">
+          <xsl:value-of select="' '"/>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="sub">
+      <xsl:choose>
+        <xsl:when test="$separator != '' and $part = '0'">
+          <xsl:value-of select="$part + 1"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$part"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$separator = ''">
+        <!-- <sub class="morph"><a href="{$protocol}{$orig-morph}">M<xsl:number level="any" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a></sub> -->
+        <sub class="morph"><a href="{$protocol}{$orig-morph}"><xsl:value-of select="$orig-morph"/></a></sub>
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- <sub class="morph"><a href="{$protocol}{substring-before($orig-morph, $separator)}">M<xsl:number level="single" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a>, </sub> -->
+        <sub class="morph"><a href="{$protocol}{substring-before($orig-morph, $separator)}"><xsl:value-of select="substring-before($orig-morph, $separator)"/></a>, </sub>
+        <xsl:call-template name="morph">
+          <xsl:with-param name="morph" select="substring-after($morph, $separator)"/>
+          <xsl:with-param name="part">
+            <xsl:choose>
+              <xsl:when test="$sub">
+                <xsl:value-of select="$sub + 1"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="1"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="seg">
+    <xsl:choose>
+      <xsl:when test="starts-with(@type, 'color:')">
+        <font color="{substring-before(substring-after(@type, 'color: '), ';')}"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'font-size:')">
+        <font size="{substring-before(substring-after(@type, 'font-size: '), ';')}"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="@type = 'x-variant'">
+        <xsl:if test="@subType = 'x-class-1'">
+          <xsl:apply-templates/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="seg" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="starts-with(@type, 'color:')">
+        <font color="{substring-before(substring-after(@type, 'color: '), ';')}"><xsl:apply-templates mode="jesus"/></font>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'font-size:')">
+        <font size="{substring-before(substring-after(@type, 'font-size: '), ';')}"><xsl:apply-templates mode="jesus"/></font>
+      </xsl:when>
+      <xsl:when test="@type = 'x-variant'">
+        <xsl:if test="@subType = 'x-class:1'">
+          <xsl:apply-templates mode="jesus"/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="jesus"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <!-- expansion is OSIS, expan is TEI -->
+  <xsl:template match="abbr">
+    <font class="abbr">
+      <xsl:if test="@expansion">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expansion"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@expan">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expan"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </font>
+  </xsl:template>
+
+  <xsl:template match="abbr" mode="jesus">
+    <font class="abbr">
+      <xsl:if test="@expansion">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expansion"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@expan">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expan"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates mode="jesus"/>
+    </font>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="speaker[@who = 'Jesus']">
+    <font class="jesus"><xsl:apply-templates mode="jesus"/></font>
+  </xsl:template>
+
+  <xsl:template match="speaker">
+    <font class="speech"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title[@subType ='x-preverse' or @subtype = 'x-preverse']">
+  <!-- Done by a line in [verse]
+    <h3 class="heading">
+      <xsl:apply-templates/>
+    </h3>
+  -->
+  </xsl:template>
+
+  <xsl:template match="title[@subType ='x-preverse' or @subtype = 'x-preverse']" mode="jesus">
+  <!-- Done by a line in [verse]
+    <h3 class="heading">
+      <xsl:apply-templates/>
+    </h3>
+  -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title[@level]">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <xsl:choose>
+        <xsl:when test="@level = '1'">
+          <h1 class="level"><xsl:apply-templates/></h1>
+        </xsl:when>
+        <xsl:when test="@level = '2'">
+          <h2 class="level"><xsl:apply-templates/></h2>
+        </xsl:when>
+        <xsl:when test="@level = '3'">
+          <h3 class="level"><xsl:apply-templates/></h3>
+        </xsl:when>
+        <xsl:when test="@level = '4'">
+          <h4 class="level"><xsl:apply-templates/></h4>
+        </xsl:when>
+        <xsl:when test="@level = '5'">
+          <h5 class="level"><xsl:apply-templates/></h5>
+        </xsl:when>
+        <xsl:otherwise>
+          <h6 class="level"><xsl:apply-templates/></h6>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="title[@level]" mode="jesus">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <xsl:choose>
+        <xsl:when test="@level = '1'">
+          <h1 class="level"><xsl:apply-templates/></h1>
+        </xsl:when>
+        <xsl:when test="@level = '2'">
+          <h2 class="level"><xsl:apply-templates/></h2>
+        </xsl:when>
+        <xsl:when test="@level = '3'">
+          <h3 class="level"><xsl:apply-templates/></h3>
+        </xsl:when>
+        <xsl:when test="@level = '4'">
+          <h4 class="level"><xsl:apply-templates/></h4>
+        </xsl:when>
+        <xsl:when test="@level = '5'">
+          <h5 class="level"><xsl:apply-templates/></h5>
+        </xsl:when>
+        <xsl:otherwise>
+          <h6 class="level"><xsl:apply-templates/></h6>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <h2 class="heading"><xsl:apply-templates/></h2>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="title" mode="jesus">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <h2 class="heading"><xsl:apply-templates/></h2>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="reference">
+    <xsl:choose>
+      <xsl:when test="$XRef = 'true'">
+        <a href="bible://{@osisRef}"><xsl:apply-templates/></a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="reference" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="$XRef = 'true'">
+        <a href="bible://{@osisRef}"><xsl:apply-templates mode="jesus"/></a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="jesus"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="caption">
+    <div class="caption"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="caption" mode="jesus">
+    <div class="caption"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="catchWord">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="catchWord" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <!--
+      <cell> is handled shortly after <table> below and thus does not appear
+      here.
+  -->
+  
+  <xsl:template match="closer">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="closer" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <xsl:template match="date">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="date" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <xsl:template match="divineName">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+  
+  <xsl:template match="divineName" mode="jesus">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+  
+  <xsl:template match="figure">
+    <div class="figure">
+      <xsl:choose>
+        <xsl:when test="starts-with(@src, '/')">
+          <img src="{concat($baseURL, @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:when>
+        <xsl:otherwise>
+          <img src="{concat($baseURL, '/',  @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="figure" mode="jesus">
+    <div class="figure">
+      <xsl:choose>
+        <xsl:when test="starts-with(@src, '/')">
+          <img src="{concat($baseURL, @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:when>
+        <xsl:otherwise>
+          <img src="{concat($baseURL, '/',  @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:apply-templates mode="jesus"/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="foreign">
+    <em class="foreign"><xsl:apply-templates/></em>
+  </xsl:template>
+  
+  <xsl:template match="foreign" mode="jesus">
+    <em class="foreign"><xsl:apply-templates mode="jesus"/></em>
+  </xsl:template>
+  
+  <!-- This is a subheading. -->
+  <xsl:template match="head//head">
+    <h5 class="head"><xsl:apply-templates/></h5>
+  </xsl:template>
+  
+  <!-- This is a top-level heading. -->
+  <xsl:template match="head">
+    <h4 class="head"><xsl:apply-templates/></h4>
+  </xsl:template>
+  
+  <xsl:template match="index">
+    <a name="index{@id}" class="index"/>
+  </xsl:template>
+
+  <xsl:template match="inscription">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+
+  <xsl:template match="inscription" mode="jesus">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+
+  <xsl:template match="item">
+    <li class="item"><xsl:apply-templates/></li>
+  </xsl:template>
+
+  <xsl:template match="item" mode="jesus">
+    <li class="item"><xsl:apply-templates mode="jesus"/></li>
+  </xsl:template>
+  
+  <!--
+      <item> and <label> are covered by <list> below and so do not appear here.
+  -->
+
+  <xsl:template match="lg">
+    <div class="lg"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="lg" mode="jesus">
+    <div class="lg"><xsl:apply-templates mode="jesus"/></div>
+  </xsl:template>
+  
+  <xsl:template match="lg[@sID or @eID]"/>
+  <xsl:template match="lg[@sID or @eID]" mode="jesus"/>
+
+  <xsl:template match="l[@sID]"/>
+  <xsl:template match="l[@sID]" mode="jesus"/>
+
+  <xsl:template match="l[@eID]"><br/></xsl:template>
+  <xsl:template match="l[@eID]" mode="jesus"><br/></xsl:template>
+
+  <xsl:template match="l">
+    <xsl:apply-templates/><br/>
+  </xsl:template>
+  
+  <xsl:template match="l" mode="jesus">
+    <xsl:apply-templates mode="jesus"/><br/>
+  </xsl:template>
+
+  <!-- While a BR is a break, if it is immediately followed by punctuation,
+       indenting this rule can introduce whitespace.
+    -->
+  <xsl:template match="lb"><br/></xsl:template>
+  <xsl:template match="lb" mode="jesus"><br/></xsl:template>
+
+  <xsl:template match="list">
+    <xsl:choose>
+      <xsl:when test="label">
+        <!-- If there are <label>s in the list, it's a <dl>. -->
+        <dl class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::label">
+                <dt class="label"><xsl:apply-templates/></dt>
+              </xsl:when>
+              <xsl:when test="self::item">
+                <dd class="item"><xsl:apply-templates/></dd>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <dd class="list-wrapper"><xsl:apply-templates select="."/></dd>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </dl>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- If there are no <label>s in the list, it's a plain old <ul>. -->
+        <ul class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::item">
+                <li class="item"><xsl:apply-templates/></li>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <li class="list-wrapper"><xsl:apply-templates select="."/></li>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+
+  <xsl:template match="list" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="label">
+        <!-- If there are <label>s in the list, it's a <dl>. -->
+        <dl class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::label">
+                <dt class="label"><xsl:apply-templates mode="jesus"/></dt>
+              </xsl:when>
+              <xsl:when test="self::item">
+                <dd class="item"><xsl:apply-templates mode="jesus"/></dd>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <dd class="list-wrapper"><xsl:apply-templates select="." mode="jesus"/></dd>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates mode="jesus"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </dl>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- If there are no <label>s in the list, it's a plain old <ul>. -->
+        <ul class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::item">
+                <li class="item"><xsl:apply-templates mode="jesus"/></li>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <li class="list-wrapper"><xsl:apply-templates select="." mode="jesus"/></li>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates mode="jesus"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="mentioned">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="mentioned" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <!-- Milestones represent characteristics of the original manuscript.
+    == that are being preserved. For this reason, most are ignored.
+    ==
+    == The defined types are:
+    == column   Marks the end of a column where there is a multi-column display.
+    == footer   Marks the footer region of a page.
+    == halfLine Used to mark half-line units if not otherwise encoded.
+    == header   Marks the header region of a page.
+    == line     Marks line breaks, particularly important in recording appearance of an original text, such as a manuscript.
+    == pb       Marks a page break in a text.
+    == screen   Marks a preferred place for breaks in an on-screen rendering of the text.
+    == cQuote   Marks the location of a continuation quote mark, with marker containing the publishers mark.
+    -->
+  <!--  This is used by the KJV for paragraph markers. -->
+  <xsl:template match="milestone[@type = 'x-p']"><xsl:text> </xsl:text><xsl:value-of select="@marker"/><xsl:text> </xsl:text></xsl:template>
+  <xsl:template match="milestone[@type = 'x-p']" mode="jesus"><xsl:text> </xsl:text><xsl:value-of select="@marker"/><xsl:text> </xsl:text></xsl:template>
+
+  <xsl:template match="milestone[@type = 'cQuote']">
+    <xsl:value-of select="@marker"/>
+  </xsl:template>
+
+  <xsl:template match="milestone[@type = 'cQuote']" mode="jesus">
+    <xsl:value-of select="@marker"/>
+  </xsl:template>
+
+  <xsl:template match="milestone[@type = 'line']"><br/></xsl:template>
+
+  <xsl:template match="milestone[@type = 'line']" mode="jesus"><br/></xsl:template>
+
+  <!--
+    == Milestone start and end are deprecated.
+    == At this point we expect them to not be in the document.
+    == These have been replace with milestoneable elements.
+    -->
+  <xsl:template match="milestoneStart"/>
+  <xsl:template match="milestoneEnd"/>
+  
+  <xsl:template match="name">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="name" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!-- If there is a milestoned q then just output a quotation mark -->
+  <xsl:template match="q[@sID or @eID]">
+    <xsl:choose>
+      <xsl:when test="@marker"><xsl:value-of select="@marker"/></xsl:when>
+      <!-- The chosen mark should be based on the work's author's locale. -->
+      <xsl:otherwise>"</xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@sID or @eID]" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="@marker"><xsl:value-of select="@marker"/></xsl:when>
+      <!-- The chosen mark should be based on the work's author's locale. -->
+      <xsl:otherwise>"</xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@who = 'Jesus']">
+    <font class="jesus"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></font>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'blockquote']">
+    <blockquote class="q"><xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/></blockquote>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'blockquote']" mode="jesus">
+    <blockquote class="q"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></blockquote>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'citation']">
+    <blockquote class="q"><xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/></blockquote>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'citation']" mode="jesus">
+    <blockquote class="q"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></blockquote>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'embedded']">
+    <xsl:choose>
+      <xsl:when test="@marker">
+        <xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <quote class="q"><xsl:apply-templates/></quote>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@type = 'embedded']" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="@marker">
+      <xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <quote class="q"><xsl:apply-templates/></quote>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!-- An alternate reading. -->
+  <xsl:template match="rdg">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+   <xsl:template match="rdg" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!--
+      <row> is handled near <table> below and so does not appear here.
+  -->
+  
+  <xsl:template match="salute">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+ <!-- Avoid adding whitespace -->
+  <xsl:template match="salute" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <xsl:template match="signed">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="signed" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <xsl:template match="speech">
+    <div class="speech"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="speech" mode="jesus">
+    <div class="speech"><xsl:apply-templates mode="jesus"/></div>
+  </xsl:template>
+
+  <xsl:template match="table">
+    <table class="table">
+      <xsl:copy-of select="@rows|@cols"/>
+      <xsl:if test="head">
+        <thead class="head"><xsl:apply-templates select="head"/></thead>
+      </xsl:if>
+      <tbody><xsl:apply-templates select="row"/></tbody>
+    </table>
+  </xsl:template>
+
+  <xsl:template match="row">
+    <tr class="row"><xsl:apply-templates/></tr>
+  </xsl:template>
+  
+  <xsl:template match="cell">
+    <xsl:variable name="element-name">
+      <xsl:choose>
+        <xsl:when test="@role = 'label'">
+          <xsl:text>th</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>td</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="cell-direction">
+      <xsl:if test="@xml:lang">
+        <xsl:call-template name="getDirection">
+         <xsl:with-param name="lang"><xsl:value-of select="@xml:lang"/></xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:element name="{$element-name}">
+      <xsl:attribute name="class">cell</xsl:attribute>
+      <xsl:attribute name="valign">top</xsl:attribute>
+      <xsl:if test="@xml:lang">
+        <xsl:attribute name="dir">
+          <xsl:value-of select="$cell-direction"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="$cell-direction = 'rtl'">
+        <xsl:attribute name="align">
+          <xsl:value-of select="'right'"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@rows">
+        <xsl:attribute name="rowspan">
+          <xsl:value-of select="@rows"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@cols">
+        <xsl:attribute name="colspan">
+          <xsl:value-of select="@cols"/>
+        </xsl:attribute>
+      </xsl:if>
+      <!-- hack alert -->
+      <xsl:choose>
+        <xsl:when test="$cell-direction = 'rtl'">
+          <xsl:text>&#8235;</xsl:text><xsl:apply-templates/><xsl:text>&#8236;</xsl:text>
+        </xsl:when>
+        <xsl:when test="$cell-direction = 'ltr'">
+          <xsl:text>&#8234;</xsl:text><xsl:apply-templates/><xsl:text>&#8236;</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="transChange">
+    <em><xsl:apply-templates/></em>
+  </xsl:template>
+  <xsl:template match="transChange" mode="jesus">
+    <em><xsl:apply-templates/></em>
+  </xsl:template>
+  
+  <!-- @type is OSIS, @rend is TEI -->
+  <xsl:template match="hi">
+    <xsl:variable name="style">
+      <xsl:choose>
+        <xsl:when test="@type">
+          <xsl:value-of select="@type"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@rend"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$style = 'acrostic'">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="$style = 'bold'">
+        <strong><xsl:apply-templates/></strong>
+      </xsl:when>
+      <xsl:when test="$style = 'emphasis'">
+        <em><xsl:apply-templates/></em>
+      </xsl:when>
+      <xsl:when test="$style = 'illuminated'">
+        <strong><em><xsl:apply-templates/></em></strong>
+      </xsl:when>
+      <xsl:when test="$style = 'italic'">
+        <em><xsl:apply-templates/></em>
+      </xsl:when>
+      <xsl:when test="$style = 'line-through'">
+        <font class="strike"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="$style = 'normal'">
+        <font class="normal"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="$style = 'small-caps'">
+        <font class="small-caps"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="$style = 'sub'">
+        <sub><xsl:apply-templates/></sub>
+      </xsl:when>
+      <xsl:when test="$style = 'super'">
+        <sup><xsl:apply-templates/></sup>
+      </xsl:when>
+      <xsl:when test="$style = 'underline'">
+        <u><xsl:apply-templates/></u>
+      </xsl:when>
+      <xsl:when test="$style = 'x-caps'">
+        <font class="caps"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="hi" mode="jesus">
+    <xsl:variable name="style">
+      <xsl:choose>
+        <xsl:when test="@type">
+          <xsl:value-of select="@type"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@rend"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$style = 'acrostic'">
+        <xsl:apply-templates/>
+      </xsl:when>
+      <xsl:when test="$style = 'bold'">
+        <strong><xsl:apply-templates/></strong>
+      </xsl:when>
+      <xsl:when test="$style = 'emphasis'">
+        <em><xsl:apply-templates/></em>
+      </xsl:when>
+      <xsl:when test="$style = 'illuminated'">
+        <strong><em><xsl:apply-templates/></em></strong>
+      </xsl:when>
+      <xsl:when test="$style = 'italic'">
+        <em><xsl:apply-templates/></em>
+      </xsl:when>
+      <xsl:when test="$style = 'line-through'">
+        <font class="strike"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="$style = 'normal'">
+        <font class="normal"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="$style = 'small-caps'">
+        <font class="small-caps"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="$style = 'sub'">
+        <sub><xsl:apply-templates/></sub>
+      </xsl:when>
+      <xsl:when test="$style = 'super'">
+        <sup><xsl:apply-templates/></sup>
+      </xsl:when>
+      <xsl:when test="$style = 'underline'">
+        <u><xsl:apply-templates/></u>
+      </xsl:when>
+      <xsl:when test="$style = 'x-caps'">
+        <font class="caps"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--
+    The following elements are actually TEI and there is some expectation
+    that these will make it into OSIS.
+  -->
+  <xsl:template match="superentry">
+    <!-- output each preverse element in turn -->
+    <xsl:for-each select="entry|entryFree">
+      <xsl:apply-templates/><br/><br/>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="entry">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="entryFree">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="form">
+    <xsl:apply-templates/><br/>
+  </xsl:template>
+
+  <xsl:template match="orth">
+    <font class="orth"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="pron">
+    <font class="pron"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="etym">
+    <font class="etym"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="def">
+    <font class="def"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="usg">
+    <font class="usg"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <xsl:template match="@xml:lang">
+    <xsl:variable name="dir">
+      <xsl:if test="@xml:lang">
+        <xsl:call-template name="getDirection">
+         <xsl:with-param name="lang"><xsl:value-of select="@xml:lang"/></xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:if test="$dir">
+      <xsl:attribute name="dir">
+        <xsl:value-of select="$dir"/>
+      </xsl:attribute>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="small-caps">
+  <xsl:value-of select="translate(., 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+  </xsl:template>
+
+  <!--
+    Generate a css or an inline style representation of a font spec.
+    The fontspec that is passed in is in one of two forms:
+    FamilyName-STYLE-size, where STYLE is either PLAIN, BOLD, ITALIC or BOLDITALIC
+    or
+    FamilyName,style,size, where STYLE is 0 for PLAIN, 1 for BOLD, 2 for ITALIC or 3 for BOLDITALIC.
+
+    The style attribute is css for a css style specification or anything else for an inline style one.
+  -->
+  <xsl:template name="generateFontStyle">
+    <xsl:param name="fontspec"/>
+    <xsl:param name="style"/>
+    <xsl:variable name="fontSeparator">
+      <xsl:choose>
+        <xsl:when test="contains($fontspec, ',')">
+          <xsl:value-of select="','"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="'-'"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="aFont">
+      <xsl:choose>
+        <xsl:when test="substring-before($fontspec, $fontSeparator) = ''"><xsl:value-of select="$fontspec"/>,0,16</xsl:when>
+        <xsl:otherwise><xsl:value-of select="$fontspec"/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="fontfamily" select="substring-before($aFont, $fontSeparator)" />
+    <xsl:variable name="fontsize" select="substring-after(substring-after($aFont, $fontSeparator), $fontSeparator)" />
+    <xsl:variable name="styling" select="substring-before(substring-after($aFont, $fontSeparator), $fontSeparator)" />
+    <xsl:variable name="fontweight">
+      <xsl:choose>
+        <xsl:when test="$styling = '1' or $styling = '3' or contains($styling, 'bold')">bold</xsl:when>
+        <xsl:otherwise>normal</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="fontstyle">
+      <xsl:choose>
+        <xsl:when test="$styling = '2' or $styling = '3' or contains($styling, 'italic')">italic</xsl:when>
+        <xsl:otherwise>normal</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$style = 'css'">
+        <xsl:value-of select='concat("font-family: &apos;", $fontfamily, "&apos;, Serif; ",
+                                     "font-size:   ",       $fontsize,   "pt; ",
+                                     "font-weight: ",       $fontweight, "; ",
+                                     "font-style:  ",       $fontstyle,  ";")'/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select='concat("font-family=&apos;",  $fontfamily, "&apos;, Serif; ",
+                                     "font-size=",          $fontsize,   "pt; ",
+                                     "font-weight=",        $fontweight, "; ",
+                                     "font-style=",         $fontstyle,  "; ")'/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--
+    The direction is deduced from the xml:lang attribute and is assumed to be meaningful for those elements.
+    Note: there is a bug that prevents dir=rtl from working.
+    see: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4296022 and 4866977
+  -->
+  <xsl:template name="getDirection">
+    <xsl:param name="lang"/>
+    <xsl:choose>
+      <xsl:when test="$lang = 'he' or $lang = 'ar' or $lang = 'fa' or $lang = 'ur' or $lang = 'syr'">
+        <xsl:value-of select="'rtl'"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="'ltr'"/>
+      </xsl:otherwise>
+    </xsl:choose>
+   </xsl:template>
+  
+</xsl:stylesheet>

Added: trunk/step-web-app/src/main/resources/xsl/cswing/simple2.xsl
===================================================================
--- trunk/step-web-app/src/main/resources/xsl/cswing/simple2.xsl	                        (rev 0)
+++ trunk/step-web-app/src/main/resources/xsl/cswing/simple2.xsl	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,1465 @@
+<?xml version="1.0"?>
+<!--
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: simple.xsl 1603 2007-08-03 15:37:45Z dmsmith $
+ -->
+ <!--
+ * Transforms OSIS to HTML for viewing within JSword browsers.
+ * Note: There are custom protocols which the browser must handle.
+ * 
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ -->
+ <xsl:stylesheet
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  version="1.0"
+  xmlns:jsword="http://xml.apache.org/xalan/java"
+  extension-element-prefixes="jsword">
+
+  <!--  Version 3.0 is necessary to get br to work correctly. -->
+  <xsl:output method="html" version="3.0" omit-xml-declaration="yes" indent="no"/>
+
+  <!-- Be very careful about introducing whitespace into the document.
+       strip-space merely remove space between one tag and another tag.
+       This may cause significant whitespace to be removed.
+       
+       It is easy to have apply-templates on a line to itself which if
+       it encounters text before anything else will introduce whitespace.
+       With the browser we are using, span will introduce whitespace
+       but font does not. Therefore we use font as a span.
+    -->
+  <!-- gdef and hdef refer to hebrew and greek definitions keyed by strongs -->
+  <xsl:param name="greek.def.protocol" select="'gdef:'"/>
+  <xsl:param name="hebrew.def.protocol" select="'hdef:'"/>
+  <!-- currently these are not used, but they are for morphologic forms -->
+  <xsl:param name="greek.morph.protocol" select="'gmorph:'"/>
+  <xsl:param name="hebrew.morph.protocol" select="'hmorph:'"/>
+
+  <!-- The absolute base for relative references. -->
+  <xsl:param name="baseURL" select="''"/>
+
+  <!-- Whether to show Strongs or not -->
+  <xsl:param name="Strongs" select="'false'"/>
+
+  <!-- Whether to show morphologic forms or not -->
+  <xsl:param name="Morph" select="'false'"/>
+
+  <!-- Whether to start each verse on an new line or not -->
+  <xsl:param name="VLine" select="'false'"/>
+
+  <!-- Whether to show non-canonical "headings" or not -->
+  <xsl:param name="Headings" select="'true'"/>
+
+  <!-- Whether to show notes or not -->
+  <xsl:param name="Notes" select="'true'"/>
+
+  <!-- Whether to have linking cross references or not -->
+  <xsl:param name="XRef" select="'true'"/>
+
+  <!-- Whether to output no Verse numbers -->
+  <xsl:param name="NoVNum" select="'false'"/>
+
+  <!-- Whether to output Verse numbers or not -->
+  <xsl:param name="VNum" select="'true'"/>
+
+  <!-- Whether to output Chapter and Verse numbers or not -->
+  <xsl:param name="CVNum" select="'false'"/>
+
+  <!-- Whether to output Book, Chapter and Verse numbers or not -->
+  <xsl:param name="BCVNum" select="'false'"/>
+
+  <!-- Whether to output superscript verse numbers or normal size ones -->
+  <xsl:param name="TinyVNum" select="'true'"/>
+
+  <!-- The CSS stylesheet to use. The url must be absolute. -->
+  <xsl:param name="css"/>
+  
+  <!-- The order of display. Hebrew is rtl (right to left) -->
+  <xsl:param name="direction" select="'ltr'"/>
+
+  <!-- The font that is passed in is in one of two forms:
+    FamilyName-STYLE-size, where STYLE is either PLAIN, BOLD, ITALIC or BOLDITALIC
+    or
+    FamilyName,style,size, where STYLE is 0 for PLAIN, 1 for BOLD, 2 for ITALIC or 3 for BOLDITALIC.
+    This needs to be changed into a CSS style specification
+  -->
+  <xsl:param name="font" select="Serif"/>
+
+  <xsl:variable name="fontspec">
+      <xsl:call-template name="generateFontStyle">
+        <xsl:with-param name="fontspec" select="$font"/>
+        <xsl:with-param name="style">css</xsl:with-param>
+      </xsl:call-template>
+  </xsl:variable>
+
+  <!-- Create a global key factory from which OSIS ids will be generated -->
+  <xsl:variable name="keyf" select="jsword:org.crosswire.jsword.passage.PassageKeyFactory.instance()"/>
+
+  <!--=======================================================================-->
+  <xsl:template match="/">
+    <html dir="{$direction}">
+      <head>
+        <base href="{$baseURL}"/>
+        <style type="text/css">
+          BODY { <xsl:value-of select="$fontspec" /> }
+          A { text-decoration: none; }
+          A.strongs { color: black; text-decoration: none; }
+          SUB.strongs { font-size: 75%; color: red; }
+          SUB.morph { font-size: 75%; color: blue; }
+          SUB.lemma { font-size: 75%; color: red; }
+          SUP.verse { font-size: 75%; color: gray; }
+          SUP.note { font-size: 75%; color: green; }
+          FONT.jesus { color: red; }
+          FONT.speech { color: blue; }
+          FONT.strike { text-decoration: line-through; }
+          FONT.small-caps { font-variant: small-caps; }
+          FONT.inscription { font-weight: bold; font-variant: small-caps; }
+          FONT.divineName { font-variant: small-caps; }
+          FONT.normal { font-variant: normal; }
+          FONT.caps { text-transform: uppercase; }
+          H1.level { text-align: center; font-size: 115%; color: #000000; }
+          H2.level { text-align: center; font-size: 110%; color: #000000; }
+          H3.level { text-align: center; font-size: 100%; }
+          H4.level { text-align: center; font-size: 90%; }
+          H5.level { text-align: center; font-size: 85%; }
+          H6.level { text-align: center; font-size: 80%; }
+          H3.heading { font-size: 110%; color: #666699; font-weight: bold; }
+          H2.heading { font-size: 115%; color: #669966; font-weight: bold; }
+          div.margin { font-size:90%; }
+          TD.notes { width:20%; background:#f4f4e8; }
+          TD.text { width:80%; }
+        </style>
+        <!-- Always include the user's stylesheet even if "" -->
+        <link rel="stylesheet" type="text/css" href="{$css}" title="styling" />
+      </head>
+      <body>
+        <!-- If there are notes, output a table with notes in the 2nd column. -->
+        <!-- There is a rendering bug which prevents the notes from adhering to the right edge. -->
+        <xsl:choose>
+          <xsl:when test="$Notes = 'true' and //note[not(@type = 'x-strongsMarkup')]">
+            <xsl:choose>
+              <xsl:when test="$direction != 'rtl'">
+	            <table cols="2" cellpadding="5" cellspacing="5">
+	              <tr>
+	                <!-- The two rows are swapped until the bug is fixed. -->
+	                <td valign="top" class="notes">
+	                  <p>&#160;</p>
+	                  <xsl:apply-templates select="//verse" mode="print-notes"/>
+	                </td>
+	                <td valign="top" class="text">
+	                  <xsl:apply-templates/>
+	                </td>
+	              </tr>
+	            </table>
+              </xsl:when>
+              <xsl:otherwise>
+                <!-- reverse the table for Right to Left languages -->
+	            <table cols="2" cellpadding="5" cellspacing="5">
+	              <!-- In a right to left, the alignment should be reversed too -->
+	              <tr align="right">
+	                <td valign="top" class="notes">
+	                  <p>&#160;</p>
+	                  <xsl:apply-templates select="//note" mode="print-notes"/>
+	                </td>
+	                <td valign="top" class="text">
+	                  <xsl:apply-templates/>
+	                </td>
+	              </tr>
+	            </table>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </body>
+    </html>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == A proper OSIS document has osis as it's root.
+    == We dig deeper for it's content.
+    -->
+  <xsl:template match="osis">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == An OSIS document may contain more that one work.
+    == Each work is held in an osisCorpus element.
+    == If there is only one work, then this element will (should) be absent.
+    == Process each document in turn.
+    == It might be reasonable to dig into the header element of each work
+    == and get its title.
+    == Otherwise, we ignore the header and work elements and just process
+    == the osisText elements.
+    -->
+  <xsl:template match="osisCorpus">
+    <xsl:apply-templates select="osisText"/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!--
+    == Each work has an osisText element.
+    == We ignore the header and work elements and process its div elements.
+    == While divs can be milestoned, the osisText element requires container
+    == divs.
+    -->
+  <xsl:template match="osisText">
+    <xsl:apply-templates select="div"/>
+  </xsl:template>
+  
+  <!-- Ignore headers and its elements -->
+  <xsl:template match="header"/>
+  <xsl:template match="revisionDesc"/>
+  <xsl:template match="work"/>
+   <!-- <xsl:template match="title"/> who's parent is work -->
+  <xsl:template match="contributor"/>
+  <xsl:template match="creator"/>
+  <xsl:template match="subject"/>
+  <!-- <xsl:template match="date"/> who's parent is work -->
+  <xsl:template match="description"/>
+  <xsl:template match="publisher"/>
+  <xsl:template match="type"/>
+  <xsl:template match="format"/>
+  <xsl:template match="identifier"/>
+  <xsl:template match="source"/>
+  <xsl:template match="language"/>
+  <xsl:template match="relation"/>
+  <xsl:template match="coverage"/>
+  <xsl:template match="rights"/>
+  <xsl:template match="scope"/>
+  <xsl:template match="workPrefix"/>
+  <xsl:template match="castList"/>
+  <xsl:template match="castGroup"/>
+  <xsl:template match="castItem"/>
+  <xsl:template match="actor"/>
+  <xsl:template match="role"/>
+  <xsl:template match="roleDesc"/>
+  <xsl:template match="teiHeader"/>
+  <xsl:template match="refSystem"/>
+
+
+  <!-- Ignore titlePage -->
+  <xsl:template match="titlePage"/>
+
+  <!--=======================================================================-->
+  <!-- 
+    == Div provides the major containers for a work.
+    == Divs are milestoneable.
+    -->
+  <xsl:template match="div">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="div" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!-- Handle verses as containers and as a start verse.                     -->
+  <xsl:template match="verse[not(@eID)]">
+    <!-- If the verse doesn't start on its own line and -->
+    <!-- the verse is not the first verse of a set of siblings, -->
+    <!-- output an extra space. -->
+    <xsl:if test="$VLine = 'false' and preceding-sibling::*[local-name() = 'verse']">
+      <xsl:text>&#160;</xsl:text>
+    </xsl:if>
+    <!-- output each preverse element in turn -->
+    <xsl:for-each select=".//*[@subType = 'x-preverse' or @subtype = 'x-preverse']">
+      <xsl:choose>
+        <xsl:when test="local-name() = 'title'">
+          <!-- Always show canonical titles or if headings is turned on -->
+          <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+            <h3 class="heading"><xsl:apply-templates /></h3>
+          </xsl:if>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates />
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <!-- Handle the KJV paragraph marker. -->
+    <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <!-- Always output the verse -->
+    <xsl:choose>
+ 	  <xsl:when test="$VLine = 'true'">
+        <div class="l"><a name="{@osisID}"><xsl:call-template name="versenum"/></a><xsl:apply-templates/></div>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="versenum"/><xsl:apply-templates/>
+        <!-- Follow the verse with an extra space -->
+        <!-- when they don't start on lines to themselves -->
+        <xsl:text> </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="verse[not(@eID)]" mode="jesus">
+    <!-- If the verse doesn't start on its own line and -->
+    <!-- the verse is not the first verse of a set of siblings, -->
+    <!-- output an extra space. -->
+    <xsl:if test="$VLine = 'false' and preceding-sibling::*[local-name() = 'verse']">
+      <xsl:text>&#160;</xsl:text>
+    </xsl:if>
+    <xsl:variable name="title" select=".//title"/>
+    <xsl:if test="string-length($title) > 0">
+      <h3 class="heading"><xsl:value-of select="$title"/></h3>
+    </xsl:if>
+    <!-- Handle the KJV paragraph marker. -->
+    <xsl:if test="milestone[@type = 'x-p']"><br/><br/></xsl:if>
+    <!-- Always output the verse -->
+    <xsl:choose>
+ 	  <xsl:when test="$VLine = 'true'">
+        <div class="l"><a name="{@osisID}"><xsl:call-template name="versenum"/></a><xsl:apply-templates mode="jesus"/></div>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="versenum"/><xsl:apply-templates mode="jesus"/>
+        <!-- Follow the verse with an extra space -->
+        <!-- when they don't start on lines to themselves -->
+        <xsl:text> </xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="verse" mode="print-notes">
+    <xsl:if test=".//note[not(@type) or not(@type = 'x-strongsMarkup')]">
+      <xsl:variable name="passage" select="jsword:getValidKey($keyf, @osisID)"/>
+      <a href="#{substring-before(concat(@osisID, ' '), ' ')}">
+        <xsl:value-of select="jsword:getName($passage)"/>
+      </a>
+      <xsl:apply-templates select=".//note" mode="print-notes" />
+      <div><xsl:text>&#160;</xsl:text></div>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template name="versenum">
+    <!-- Are verse numbers wanted? -->
+    <xsl:if test="$NoVNum = 'false'">
+      <!-- An osisID can be a space separated list of them -->
+      <xsl:variable name="firstOsisID" select="substring-before(concat(@osisID, ' '), ' ')"/>
+      <xsl:variable name="book" select="substring-before($firstOsisID, '.')"/>
+      <xsl:variable name="chapter" select="substring-before(substring-after($firstOsisID, '.'), '.')"/>
+      <!-- If n is present use it for the number -->
+      <xsl:variable name="verse">
+        <xsl:choose>
+          <xsl:when test="@n">
+            <xsl:value-of select="@n"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="substring-after(substring-after($firstOsisID, '.'), '.')"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <xsl:variable name="versenum">
+        <xsl:choose>
+          <xsl:when test="$BCVNum = 'true'">
+          	<xsl:value-of select="concat($book, '&#160;', $chapter, ':', $verse)"/>
+          </xsl:when>
+          <xsl:when test="$CVNum = 'true'">
+          	<xsl:value-of select="concat($chapter, ':', $verse)"/>
+          </xsl:when>
+          <xsl:otherwise>
+          	<xsl:value-of select="$verse"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="$TinyVNum = 'true' and $Notes = 'true'">
+      	  <a name="{@osisID}"><sup class="verse"><xsl:value-of select="$versenum"/></sup></a>
+      	</xsl:when>
+        <xsl:when test="$TinyVNum = 'true' and $Notes = 'false'">
+      	  <sup class="verse"><xsl:value-of select="$versenum"/></sup>
+      	</xsl:when>
+        <xsl:when test="$TinyVNum = 'false' and $Notes = 'true'">
+      	  <a name="{@osisID}">(<xsl:value-of select="$versenum"/>)</a>
+      	  <xsl:text> </xsl:text>
+      	</xsl:when>
+      	<xsl:otherwise>
+      	  (<xsl:value-of select="$versenum"/>)
+      	  <xsl:text> </xsl:text>
+      	</xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+    <xsl:if test="$VNum = 'false' and $Notes = 'true'">
+      <a name="{@osisID}"></a>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="a">
+    <a href="{@href}"><xsl:apply-templates/></a>
+  </xsl:template>
+
+  <xsl:template match="a" mode="jesus">
+    <a href="{@href}"><xsl:apply-templates mode="jesus"/></a>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <!-- When we encounter a note, we merely output a link to the note. -->
+  <xsl:template match="note[@type = 'x-strongsMarkup']"/>
+  <xsl:template match="note[@type = 'x-strongsMarkup']" mode="jesus"/>
+  <xsl:template match="note[@type = 'x-strongsMarkup']" mode="print-notes"/>
+
+  <xsl:template match="note">
+    <xsl:if test="$Notes = 'true'">
+      <!-- If there is a following sibling that is a note, emit a separator -->
+      <xsl:variable name="siblings" select="../child::node()"/>
+      <xsl:variable name="next-position" select="position() + 1"/>
+      <xsl:choose>
+        <xsl:when test="name($siblings[$next-position]) = 'note'">
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a>, </sup>
+        </xsl:when>
+        <xsl:otherwise>
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a></sup>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="note" mode="jesus">
+    <xsl:if test="$Notes = 'true'">
+     <!-- If there is a following sibling that is a note, emit a separator -->
+      <xsl:variable name="siblings" select="../child::node()"/>
+      <xsl:variable name="next-position" select="position() + 1"/>
+      <xsl:choose>
+        <xsl:when test="$siblings[$next-position] and name($siblings[$next-position]) = 'note'">
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a>, </sup>
+        </xsl:when>
+        <xsl:otherwise>
+          <sup class="note"><a href="#note-{generate-id(.)}"><xsl:call-template name="generateNoteXref"/></a></sup>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="note" mode="print-notes">
+    <div class="margin">
+      <strong><xsl:call-template name="generateNoteXref"/></strong>
+      <a name="note-{generate-id(.)}">
+        <xsl:text> </xsl:text>
+      </a>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+
+  <!--
+    == If the n attribute is present then use that for the cross ref otherwise create a letter.
+    == Note: numbering restarts with each verse.
+    -->
+  <xsl:template name="generateNoteXref">
+  	<xsl:choose>
+  	  <xsl:when test="@n">
+  	    <xsl:value-of select="@n"/>
+  	  </xsl:when>
+  	  <xsl:otherwise>
+  	    <xsl:number level="any" from="/osis//verse" format="a"/>
+  	  </xsl:otherwise>
+  	</xsl:choose>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="p">
+    <p><xsl:apply-templates/></p>
+  </xsl:template>
+  
+  <xsl:template match="p" mode="jesus">
+    <p><xsl:apply-templates mode="jesus"/></p>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="p" mode="print-notes">
+    <!-- FIXME: This ignores text in the note. -->
+    <!-- don't put para's in notes -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="w">
+    <!-- Output the content followed by all the lemmas and then all the morphs. -->
+    <xsl:apply-templates/>
+    <xsl:if test="$Strongs = 'true' and (starts-with(@lemma, 'x-Strongs:') or starts-with(@lemma, 'strong:'))">
+      <xsl:call-template name="lemma">
+        <xsl:with-param name="lemma" select="@lemma"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:if test="$Morph = 'true' and (starts-with(@morph, 'x-Robinson:') or starts-with(@morph, 'robinson:'))">
+      <xsl:call-template name="morph">
+        <xsl:with-param name="morph" select="@morph"/>
+      </xsl:call-template>
+    </xsl:if>
+    <!--
+        except when followed by a text node or non-printing node.
+        This is true whether the href is output or not.
+    -->
+    <xsl:variable name="siblings" select="../child::node()"/>
+    <xsl:variable name="next-position" select="position() + 1"/>
+    <xsl:if test="$siblings[$next-position] and name($siblings[$next-position]) != ''">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="w" mode="jesus">
+    <!-- Output the content followed by all the lemmas and then all the morphs. -->
+    <xsl:apply-templates mode="jesus"/>
+    <xsl:if test="$Strongs = 'true' and (starts-with(@lemma, 'x-Strongs:') or starts-with(@lemma, 'strong:'))">
+      <xsl:call-template name="lemma">
+        <xsl:with-param name="lemma" select="@lemma"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:if test="$Morph = 'true' and (starts-with(@morph, 'x-Robinson:') or starts-with(@morph, 'robinson:'))">
+      <xsl:call-template name="morph">
+        <xsl:with-param name="morph" select="@morph"/>
+      </xsl:call-template>
+    </xsl:if>
+    <!--
+        except when followed by a text node or non-printing node.
+        This is true whether the href is output or not.
+    -->
+    <xsl:variable name="siblings" select="../child::node()"/>
+    <xsl:variable name="next-position" select="position() + 1"/>
+    <xsl:if test="$siblings[$next-position] and name($siblings[$next-position]) != ''">
+      <xsl:text> </xsl:text>
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template name="lemma">
+    <xsl:param name="lemma"/>
+    <xsl:param name="part" select="0"/>
+    <xsl:variable name="orig-lemma" select="substring-after($lemma, ':')"/>
+    <xsl:variable name="protocol">
+      <xsl:choose>
+        <xsl:when test="substring($orig-lemma, 1, 1) = 'H'">
+          <xsl:value-of select="$hebrew.def.protocol"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$greek.def.protocol"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="separator">
+      <xsl:choose>
+        <xsl:when test="contains($orig-lemma, '|')">
+          <xsl:value-of select="'|'"/>
+        </xsl:when>
+        <xsl:when test="contains($orig-lemma, ' ')">
+          <xsl:value-of select="' '"/>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="sub">
+      <xsl:choose>
+        <xsl:when test="$separator != '' and $part = '0'">
+          <xsl:value-of select="$part + 1"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$part"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$separator = ''">
+        <sub class="strongs"><a href="{$protocol}{$orig-lemma}">S<xsl:number level="any" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a></sub>
+      </xsl:when>
+      <xsl:otherwise>
+        <sub class="strongs"><a href="{$protocol}{substring-before($orig-lemma, $separator)}">S<xsl:number level="single" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a>, </sub>
+        <xsl:call-template name="lemma">
+          <xsl:with-param name="lemma" select="substring-after($lemma, $separator)"/>
+          <xsl:with-param name="part">
+            <xsl:choose>
+              <xsl:when test="$sub">
+                <xsl:value-of select="$sub + 1"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="1"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="morph">
+    <xsl:param name="morph"/>
+    <xsl:param name="part" select="0"/>
+    <xsl:variable name="orig-work" select="substring-before($morph, ':')"/>
+    <xsl:variable name="orig-morph" select="substring-after($morph, ':')"/>
+    <xsl:variable name="protocol">
+      <xsl:choose>
+        <xsl:when test="starts-with($orig-work, 'x-Robinson') or starts-with($orig-work, 'robinson')">
+          <xsl:value-of select="$greek.morph.protocol"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$hebrew.morph.protocol"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="separator">
+      <xsl:choose>
+        <xsl:when test="contains($orig-morph, '|')">
+          <xsl:value-of select="'|'"/>
+        </xsl:when>
+        <xsl:when test="contains($orig-morph, ' ')">
+          <xsl:value-of select="' '"/>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="sub">
+      <xsl:choose>
+        <xsl:when test="$separator != '' and $part = '0'">
+          <xsl:value-of select="$part + 1"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$part"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$separator = ''">
+        <sub class="morph"><a href="{$protocol}{$orig-morph}">M<xsl:number level="any" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a></sub>
+      </xsl:when>
+      <xsl:otherwise>
+        <sub class="morph"><a href="{$protocol}{substring-before($orig-morph, $separator)}">M<xsl:number level="single" from="/osis//verse" format="1"/><xsl:number value="$sub" format="a"/></a>, </sub>
+        <xsl:call-template name="morph">
+          <xsl:with-param name="morph" select="substring-after($morph, $separator)"/>
+          <xsl:with-param name="part">
+            <xsl:choose>
+              <xsl:when test="$sub">
+                <xsl:value-of select="$sub + 1"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="1"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="seg">
+    <xsl:choose>
+      <xsl:when test="starts-with(@type, 'color:')">
+        <font color="{substring-before(substring-after(@type, 'color: '), ';')}"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'font-size:')">
+        <font size="{substring-before(substring-after(@type, 'font-size: '), ';')}"><xsl:apply-templates/></font>
+      </xsl:when>
+      <xsl:when test="@type = 'x-variant'">
+        <xsl:if test="@subType = 'x-class:1'">
+          <xsl:apply-templates/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="seg" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="starts-with(@type, 'color:')">
+        <font color="{substring-before(substring-after(@type, 'color: '), ';')}"><xsl:apply-templates mode="jesus"/></font>
+      </xsl:when>
+      <xsl:when test="starts-with(@type, 'font-size:')">
+        <font size="{substring-before(substring-after(@type, 'font-size: '), ';')}"><xsl:apply-templates mode="jesus"/></font>
+      </xsl:when>
+      <xsl:when test="@type = 'x-variant'">
+        <xsl:if test="@subType = 'x-class:1'">
+          <xsl:apply-templates mode="jesus"/>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="jesus"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="abbr">
+    <abbr class="abbr">
+      <xsl:if test="@expansion">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expansion"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </abbr>
+  </xsl:template>
+
+  <xsl:template match="abbr" mode="jesus">
+    <abbr class="abbr">
+      <xsl:if test="@expansion">
+        <xsl:attribute name="title">
+          <xsl:value-of select="@expansion"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates mode="jesus"/>
+    </abbr>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="speaker[@who = 'Jesus']">
+    <font class="jesus"><xsl:apply-templates mode="jesus"/></font>
+  </xsl:template>
+
+  <xsl:template match="speaker">
+    <font class="speech"><xsl:apply-templates/></font>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title[@subType ='x-preverse' or @subtype = 'x-preverse']">
+  <!-- Done by a line in [verse]
+    <h3 class="heading">
+      <xsl:apply-templates/>
+    </h3>
+  -->
+  </xsl:template>
+
+  <xsl:template match="title[@subType ='x-preverse' or @subtype = 'x-preverse']" mode="jesus">
+  <!-- Done by a line in [verse]
+    <h3 class="heading">
+      <xsl:apply-templates/>
+    </h3>
+  -->
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title[@level]">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <xsl:choose>
+        <xsl:when test="@level = '1'">
+          <h1 class="level"><xsl:apply-templates/></h1>
+        </xsl:when>
+        <xsl:when test="@level = '2'">
+          <h2 class="level"><xsl:apply-templates/></h2>
+        </xsl:when>
+        <xsl:when test="@level = '3'">
+          <h3 class="level"><xsl:apply-templates/></h3>
+        </xsl:when>
+        <xsl:when test="@level = '4'">
+          <h4 class="level"><xsl:apply-templates/></h4>
+        </xsl:when>
+        <xsl:when test="@level = '5'">
+          <h5 class="level"><xsl:apply-templates/></h5>
+        </xsl:when>
+        <xsl:otherwise>
+          <h6 class="level"><xsl:apply-templates/></h6>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="title[@level]" mode="jesus">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <xsl:choose>
+        <xsl:when test="@level = '1'">
+          <h1 class="level"><xsl:apply-templates/></h1>
+        </xsl:when>
+        <xsl:when test="@level = '2'">
+          <h2 class="level"><xsl:apply-templates/></h2>
+        </xsl:when>
+        <xsl:when test="@level = '3'">
+          <h3 class="level"><xsl:apply-templates/></h3>
+        </xsl:when>
+        <xsl:when test="@level = '4'">
+          <h4 class="level"><xsl:apply-templates/></h4>
+        </xsl:when>
+        <xsl:when test="@level = '5'">
+          <h5 class="level"><xsl:apply-templates/></h5>
+        </xsl:when>
+        <xsl:otherwise>
+          <h6 class="level"><xsl:apply-templates/></h6>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="title">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <h2 class="heading"><xsl:apply-templates/></h2>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="title" mode="jesus">
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <h2 class="heading"><xsl:apply-templates/></h2>
+    </xsl:if>
+  </xsl:template>
+
+  <!--=======================================================================-->
+  <xsl:template match="reference">
+    <xsl:choose>
+      <xsl:when test="$XRef = 'true'">
+        <a href="bible://{@osisRef}"><xsl:apply-templates/></a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="reference" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="$XRef = 'true'">
+        <a href="bible://{@osisRef}"><xsl:apply-templates mode="jesus"/></a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="jesus"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!--=======================================================================-->
+  <xsl:template match="caption">
+    <div class="caption"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="caption" mode="jesus">
+    <div class="caption"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="catchWord">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="catchWord" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <!--
+      <cell> is handled shortly after <table> below and thus does not appear
+      here.
+  -->
+  
+  <xsl:template match="closer">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="closer" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <xsl:template match="date">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="date" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <xsl:template match="divineName">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+  
+  <xsl:template match="divineName" mode="jesus">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+  
+  <xsl:template match="figure">
+    <div class="figure">
+      <xsl:choose>
+        <xsl:when test="starts-with(@src, '/')">
+          <img src="{concat($baseURL, @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:when>
+        <xsl:otherwise>
+          <img src="{concat($baseURL, '/',  @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:apply-templates/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="figure" mode="jesus">
+    <div class="figure">
+      <xsl:choose>
+        <xsl:when test="starts-with(@src, '/')">
+          <img src="{concat($baseURL, @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:when>
+        <xsl:otherwise>
+          <img src="{concat($baseURL, '/',  @src)}"/>   <!-- FIXME: Not necessarily an image... -->
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:apply-templates mode="jesus"/>
+    </div>
+  </xsl:template>
+  
+  <xsl:template match="foreign">
+    <em class="foreign"><xsl:apply-templates/></em>
+  </xsl:template>
+  
+  <xsl:template match="foreign" mode="jesus">
+    <em class="foreign"><xsl:apply-templates mode="jesus"/></em>
+  </xsl:template>
+  
+  <!-- This is a subheading. -->
+  <xsl:template match="head//head">
+    <h5 class="head"><xsl:apply-templates/></h5>
+  </xsl:template>
+  
+  <!-- This is a top-level heading. -->
+  <xsl:template match="head">
+    <h4 class="head"><xsl:apply-templates/></h4>
+  </xsl:template>
+  
+  <xsl:template match="index">
+    <a name="index{@id}" class="index"/>
+  </xsl:template>
+
+  <xsl:template match="inscription">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+
+  <xsl:template match="inscription" mode="jesus">
+    <xsl:apply-templates mode="small-caps"/>
+  </xsl:template>
+
+  <xsl:template match="item">
+    <li class="item"><xsl:apply-templates/></li>
+  </xsl:template>
+
+  <xsl:template match="item" mode="jesus">
+    <li class="item"><xsl:apply-templates mode="jesus"/></li>
+  </xsl:template>
+  
+  <!--
+      <item> and <label> are covered by <list> below and so do not appear here.
+  -->
+
+  <xsl:template match="lg">
+    <div class="lg"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="lg" mode="jesus">
+    <div class="lg"><xsl:apply-templates mode="jesus"/></div>
+  </xsl:template>
+  
+  <xsl:template match="lg[@sID or @eID]"/>
+  <xsl:template match="lg[@sID or @eID]" mode="jesus"/>
+
+  <xsl:template match="l[@sID]"/>
+  <xsl:template match="l[@sID]" mode="jesus"/>
+
+  <xsl:template match="l[@eID]"><br/></xsl:template>
+  <xsl:template match="l[@eID]" mode="jesus"><br/></xsl:template>
+
+  <xsl:template match="l">
+    <xsl:apply-templates/><br/>
+  </xsl:template>
+  
+  <xsl:template match="l" mode="jesus">
+    <xsl:apply-templates mode="jesus"/><br/>
+  </xsl:template>
+
+  <!-- While a BR is a break, if it is immediately followed by punctuation,
+       indenting this rule can introduce whitespace.
+    -->
+  <xsl:template match="lb"><br/></xsl:template>
+  <xsl:template match="lb" mode="jesus"><br/></xsl:template>
+
+  <xsl:template match="list">
+    <xsl:choose>
+      <xsl:when test="label">
+        <!-- If there are <label>s in the list, it's a <dl>. -->
+        <dl class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::label">
+                <dt class="label"><xsl:apply-templates/></dt>
+              </xsl:when>
+              <xsl:when test="self::item">
+                <dd class="item"><xsl:apply-templates/></dd>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <dd class="list-wrapper"><xsl:apply-templates select="."/></dd>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </dl>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- If there are no <label>s in the list, it's a plain old <ul>. -->
+        <ul class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::item">
+                <li class="item"><xsl:apply-templates/></li>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <li class="list-wrapper"><xsl:apply-templates select="."/></li>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+
+  <xsl:template match="list" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="label">
+        <!-- If there are <label>s in the list, it's a <dl>. -->
+        <dl class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::label">
+                <dt class="label"><xsl:apply-templates mode="jesus"/></dt>
+              </xsl:when>
+              <xsl:when test="self::item">
+                <dd class="item"><xsl:apply-templates mode="jesus"/></dd>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <dd class="list-wrapper"><xsl:apply-templates select="." mode="jesus"/></dd>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates mode="jesus"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </dl>
+      </xsl:when>
+
+      <xsl:otherwise>
+        <!-- If there are no <label>s in the list, it's a plain old <ul>. -->
+        <ul class="list">
+          <xsl:for-each select="node()">
+            <xsl:choose>
+              <xsl:when test="self::item">
+                <li class="item"><xsl:apply-templates mode="jesus"/></li>
+              </xsl:when>
+              <xsl:when test="self::list">
+                <li class="list-wrapper"><xsl:apply-templates select="." mode="jesus"/></li>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:apply-templates mode="jesus"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:for-each>
+        </ul>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="mentioned">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+  <xsl:template match="mentioned" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+  
+  <!-- Milestones represent characteristics of the original manuscript.
+    == that are being preserved. For this reason, most are ignored.
+    ==
+    == The defined types are:
+    == column   Marks the end of a column where there is a multi-column display.
+    == footer   Marks the footer region of a page.
+    == halfLine Used to mark half-line units if not otherwise encoded.
+    == header   Marks the header region of a page.
+    == line     Marks line breaks, particularly important in recording appearance of an original text, such as a manuscript.
+    == pb       Marks a page break in a text.
+    == screen   Marks a preferred place for breaks in an on-screen rendering of the text.
+    == cQuote   Marks the location of a continuation quote mark, with marker containing the publishers mark.
+    -->
+  <!--  This is used by the KJV for paragraph markers. -->
+  <xsl:template match="milestone[@type = 'x-p']"><xsl:text> </xsl:text><xsl:value-of select="@marker"/><xsl:text> </xsl:text></xsl:template>
+  <xsl:template match="milestone[@type = 'x-p']" mode="jesus"><xsl:text> </xsl:text><xsl:value-of select="@marker"/><xsl:text> </xsl:text></xsl:template>
+
+  <xsl:template match="milestone[@type = 'cQuote']">
+    <xsl:value-of select="@marker"/>
+  </xsl:template>
+
+  <xsl:template match="milestone[@type = 'cQuote']" mode="jesus">
+    <xsl:value-of select="@marker"/>
+  </xsl:template>
+
+  <xsl:template match="milestone[@type = 'line']"><br/></xsl:template>
+
+  <xsl:template match="milestone[@type = 'line']" mode="jesus"><br/></xsl:template>
+
+  <!--
+    == Milestone start and end are deprecated.
+    == At this point we expect them to not be in the document.
+    == These have been replace with milestoneable elements.
+    -->
+  <xsl:template match="milestoneStart"/>
+  <xsl:template match="milestoneEnd"/>
+  
+  <xsl:template match="name">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="name" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!-- If there is a milestoned q then just output a quotation mark -->
+  <xsl:template match="q[@sID or @eID]">
+    <xsl:choose>
+      <xsl:when test="@marker"><xsl:value-of select="@marker"/></xsl:when>
+      <!-- The chosen mark should be based on the work's author's locale. -->
+      <xsl:otherwise>"</xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@sID or @eID]" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="@marker"><xsl:value-of select="@marker"/></xsl:when>
+      <!-- The chosen mark should be based on the work's author's locale. -->
+      <xsl:otherwise>"</xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@who = 'Jesus']">
+    <font class="jesus"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></font>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'blockquote']">
+    <blockquote class="q"><xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/></blockquote>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'blockquote']" mode="jesus">
+    <blockquote class="q"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></blockquote>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'citation']">
+    <blockquote class="q"><xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/></blockquote>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'citation']" mode="jesus">
+    <blockquote class="q"><xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/></blockquote>
+  </xsl:template>
+
+  <xsl:template match="q[@type = 'embedded']">
+    <xsl:choose>
+      <xsl:when test="@marker">
+        <xsl:value-of select="@marker"/><xsl:apply-templates/><xsl:value-of select="@marker"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <quote class="q"><xsl:apply-templates/></quote>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template match="q[@type = 'embedded']" mode="jesus">
+    <xsl:choose>
+      <xsl:when test="@marker">
+      <xsl:value-of select="@marker"/><xsl:apply-templates mode="jesus"/><xsl:value-of select="@marker"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <quote class="q"><xsl:apply-templates/></quote>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <!-- An alternate reading. -->
+  <xsl:template match="rdg">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+   <xsl:template match="rdg" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <!--
+      <row> is handled near <table> below and so does not appear here.
+  -->
+  
+  <xsl:template match="salute">
+    <xsl:apply-templates/>
+  </xsl:template>
+  
+ <!-- Avoid adding whitespace -->
+  <xsl:template match="salute" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <xsl:template match="signed">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="signed" mode="jesus">
+    <xsl:apply-templates mode="jesus"/>
+  </xsl:template>
+
+  <xsl:template match="speech">
+    <div class="speech"><xsl:apply-templates/></div>
+  </xsl:template>
+  
+  <xsl:template match="speech" mode="jesus">
+    <div class="speech"><xsl:apply-templates mode="jesus"/></div>
+  </xsl:template>
+
+  <xsl:template match="table">
+    <table class="table">
+      <xsl:copy-of select="@rows|@cols"/>
+      <xsl:if test="head">
+        <thead class="head"><xsl:apply-templates select="head"/></thead>
+      </xsl:if>
+      <tbody><xsl:apply-templates select="row"/></tbody>
+    </table>
+  </xsl:template>
+
+  <xsl:template match="row">
+    <tr class="row"><xsl:apply-templates/></tr>
+  </xsl:template>
+  
+  <xsl:template match="cell">
+    <xsl:variable name="element-name">
+      <xsl:choose>
+        <xsl:when test="@role = 'label'">
+          <xsl:text>th</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>td</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="cell-direction">
+      <xsl:if test="@xml:lang">
+        <xsl:call-template name="getDirection">
+         <xsl:with-param name="lang"><xsl:value-of select="@xml:lang"/></xsl:with-param>
+        </xsl:call-template>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:element name="{$element-name}">
+      <xsl:attribute name="class">cell</xsl:attribute>
+      <xsl:attribute name="valign">top</xsl:attribute>
+      <xsl:if test="@xml:lang">
+        <xsl:attribute name="dir">
+          <xsl:value-of select="$cell-direction"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="$cell-direction = 'rtl'">
+        <xsl:attribute name="align">
+          <xsl:value-of select="'right'"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@rows">
+        <xsl:attribute name="rowspan">
+          <xsl:value-of select="@rows"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:if test="@cols">
+        <xsl:attribute name="colspan">
+          <xsl:value-of select="@cols"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates/>
+    </xsl:element>
+  </xsl:template>
+
+  <xsl:template match="transChange">
+    <em><xsl:apply-templates/></em>
+  </xsl:template>
+  <xsl:template match="transChange" mode="jesus">
+    <em><xsl:apply-templates/></em>
+  </xsl:template>
+  
+  
+  <xsl:template match="hi">
+      <xsl:choose>
+        <xsl:when test="@type = 'acrostic'">
+          <xsl:apply-templates/>
+        </xsl:when>
+        <xsl:when test="@type = 'bold'">
+          <strong><xsl:apply-templates/></strong>
+        </xsl:when>
+        <xsl:when test="@type = 'emphasis'">
+          <em><xsl:apply-templates/></em>
+        </xsl:when>
+        <xsl:when test="@type = 'illuminated'">
+          <strong><em><xsl:apply-templates/></em></strong>
+        </xsl:when>
+        <xsl:when test="@type = 'italic'">
+          <em><xsl:apply-templates/></em>
+        </xsl:when>
+        <xsl:when test="@type = 'line-through'">
+          <font class="strike"><xsl:apply-templates/></font>
+        </xsl:when>
+        <xsl:when test="@type = 'normal'">
+          <font class="normal"><xsl:apply-templates/></font>
+        </xsl:when>
+        <xsl:when test="@type = 'small-caps'">
+          <font class="small-caps"><xsl:apply-templates/></font>
+        </xsl:when>
+        <xsl:when test="@type = 'sub'">
+          <sub><xsl:apply-templates/></sub>
+        </xsl:when>
+        <xsl:when test="@type = 'super'">
+          <sup><xsl:apply-templates/></sup>
+        </xsl:when>
+        <xsl:when test="@type = 'underline'">
+          <u><xsl:apply-templates/></u>
+        </xsl:when>
+        <xsl:when test="@type = 'x-caps'">
+          <font class="caps"><xsl:apply-templates/></font>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates/>
+        </xsl:otherwise>
+      </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="hi" mode="jesus">
+      <xsl:choose>
+        <xsl:when test="@type = 'acrostic'">
+          <xsl:apply-templates mode="jesus"/>
+        </xsl:when>
+        <xsl:when test="@type = 'bold'">
+          <strong><xsl:apply-templates mode="jesus"/></strong>
+        </xsl:when>
+        <xsl:when test="@type = 'emphasis'">
+          <em><xsl:apply-templates mode="jesus"/></em>
+        </xsl:when>
+        <xsl:when test="@type = 'illuminated'">
+          <strong><em><xsl:apply-templates mode="jesus"/></em></strong>
+        </xsl:when>
+        <xsl:when test="@type = 'italic'">
+          <em><xsl:apply-templates mode="jesus"/></em>
+        </xsl:when>
+        <xsl:when test="@type = 'line-through'">
+          <font class="strike"><xsl:apply-templates mode="jesus"/></font>
+        </xsl:when>
+        <xsl:when test="@type = 'normal'">
+          <font class="normal"><xsl:apply-templates mode="jesus"/></font>
+        </xsl:when>
+        <xsl:when test="@type = 'small-caps'">
+          <font class="small-caps"><xsl:apply-templates mode="small-caps"/></font>
+        </xsl:when>
+        <xsl:when test="@type = 'sub'">
+          <sub><xsl:apply-templates mode="jesus"/></sub>
+        </xsl:when>
+        <xsl:when test="@type = 'super'">
+          <sup><xsl:apply-templates mode="jesus"/></sup>
+        </xsl:when>
+        <xsl:when test="@type = 'underline'">
+          <u><xsl:apply-templates mode="jesus"/></u>
+        </xsl:when>
+        <xsl:when test="@type = 'x-caps'">
+          <font class="caps"><xsl:apply-templates mode="jesus"/></font>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates/>
+        </xsl:otherwise>
+      </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="small-caps">
+  <xsl:value-of select="translate(., 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+  </xsl:template>
+
+  <!--
+    Generate a css or an inline style representation of a font spec.
+    The fontspec that is passed in is in one of two forms:
+    FamilyName-STYLE-size, where STYLE is either PLAIN, BOLD, ITALIC or BOLDITALIC
+    or
+    FamilyName,style,size, where STYLE is 0 for PLAIN, 1 for BOLD, 2 for ITALIC or 3 for BOLDITALIC.
+
+    The style attribute is css for a css style specification or anything else for an inline style one.
+  -->
+  <xsl:template name="generateFontStyle">
+    <xsl:param name="fontspec"/>
+    <xsl:param name="style"/>
+    <xsl:variable name="fontSeparator">
+      <xsl:choose>
+        <xsl:when test="contains($fontspec, ',')">
+          <xsl:value-of select="','"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="'-'"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="aFont">
+      <xsl:choose>
+        <xsl:when test="substring-before($fontspec, $fontSeparator) = ''"><xsl:value-of select="$fontspec"/>,0,16</xsl:when>
+        <xsl:otherwise><xsl:value-of select="$fontspec"/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="fontfamily" select="substring-before($aFont, $fontSeparator)" />
+    <xsl:variable name="fontsize" select="substring-after(substring-after($aFont, $fontSeparator), $fontSeparator)" />
+    <xsl:variable name="styling" select="substring-before(substring-after($aFont, $fontSeparator), $fontSeparator)" />
+    <xsl:variable name="fontweight">
+      <xsl:choose>
+        <xsl:when test="$styling = '1' or $styling = '3' or contains($styling, 'bold')">bold</xsl:when>
+        <xsl:otherwise>normal</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:variable name="fontstyle">
+      <xsl:choose>
+        <xsl:when test="$styling = '2' or $styling = '3' or contains($styling, 'italic')">italic</xsl:when>
+        <xsl:otherwise>normal</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$style = 'css'">
+        <xsl:value-of select='concat("font-family: &apos;", $fontfamily, "&apos;, Serif; ",
+                                     "font-size:   ",       $fontsize,   "pt; ",
+                                     "font-weight: ",       $fontweight, "; ",
+                                     "font-style:  ",       $fontstyle,  ";")'/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select='concat("font-family=&apos;",  $fontfamily, "&apos;, Serif; ",
+                                     "font-size=",          $fontsize,   "pt; ",
+                                     "font-weight=",        $fontweight, "; ",
+                                     "font-style=",         $fontstyle,  "; ")'/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <!--
+    The direction is deduced from the xml:lang attribute and is assumed to be meaningful for those elements.
+    Note: there is a bug that prevents dir=rtl from working.
+    see: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4296022 and 4866977
+  -->
+  <xsl:template name="getDirection">
+    <xsl:param name="lang"/>
+    <xsl:choose>
+      <xsl:when test="$lang = 'he' or $lang = 'ar' or $lang = 'fa' or $lang = 'ur' or $lang = 'syr'">
+        <xsl:value-of select="'rtl'"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="'ltr'"/>
+      </xsl:otherwise>
+    </xsl:choose>
+   </xsl:template>
+  
+</xsl:stylesheet>

Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/ModuleRefDataServiceTest.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/ModuleRefDataServiceTest.java	                        (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/client/service/ModuleRefDataServiceTest.java	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,22 @@
+package com.tyndalehouse.step.web.client.service;
+
+import org.junit.Test;
+
+import com.tyndalehouse.step.web.client.service.refdata.ModuleName;
+import com.tyndalehouse.step.web.client.service.refdata.ModuleRefData;
+
+/**
+ * Tests the Module Reference Data client side service
+ * 
+ * @author cjburrell
+ * 
+ */
+public class ModuleRefDataServiceTest {
+	@Test
+	public void testModuleHierarchy() {
+		new ModuleName("test module", null);
+		ModuleRefData.getInstance().getListOfModules("Module");
+
+		// Assert.assertTrue(modules.contains(module.getModuleName()));
+	}
+}

Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/StepQueryRunnerImplTest.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/StepQueryRunnerImplTest.java	                        (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/StepQueryRunnerImplTest.java	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,83 @@
+package com.tyndalehouse.step.web.server.db;
+
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.apache.commons.logging.Log;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.tyndalehouse.step.web.server.db.framework.StepQueryRunnerImpl;
+import com.tyndalehouse.step.web.server.db.framework.UnableToRunQueryException;
+import com.tyndalehouse.step.web.server.db.helper.TestProcessor;
+
+/**
+ * Tests the StepQueryRunner framework
+ * 
+ * @author CJBurrell
+ * 
+ */
+ at RunWith(JMock.class)
+public class StepQueryRunnerImplTest {
+
+	/** the mock object */
+	private final Mockery context = new Mockery();
+
+	/** tests running a query */
+	@Test
+	public void testRunQuery() throws UnableToRunQueryException {
+		// set up the test
+		final TestProcessor processor = new TestProcessor();
+		final Log log = context.mock(Log.class);
+
+		context.checking(new Expectations() {
+			{
+				ignoring(log);
+			}
+		});
+
+		final StepQueryRunnerImpl impl = new StepQueryRunnerImpl(log);
+
+		// Take an example ResultSet
+
+		final List<String> events = impl.run(processor);
+		Assert.assertNotNull(events);
+		Assert.assertEquals("Bantu expansion from Cameroon to Central Africa", events.get(0));
+		Assert.assertEquals("Events in Africa", events.get(1));
+
+//		TODO: Db Date has changed. this needs investigation		
+//		Assert.assertEquals("First date on the Mayan Long Count calendar", events.get(2));
+	}
+
+	/**
+	 * tests and expects a exception to be returned
+	 * 
+	 * @throws UnableToRunQueryException the query expected to be return on
+	 *             invalid query passed in
+	 */
+	@Test(expected = UnableToRunQueryException.class)
+	public void testRunQueryWithNull() throws UnableToRunQueryException {
+		// set up the test
+		final Log log = context.mock(Log.class);
+
+		context.checking(new Expectations() {
+			{
+				allowing(log).debug(with(any(String.class)));
+				allowing(log).trace(with(any(String.class)));
+				allowing(log).info(with(any(String.class)));
+				allowing(log).isDebugEnabled();
+				allowing(log).isTraceEnabled();
+				allowing(log).isInfoEnabled();
+				allowing(log).isErrorEnabled();
+				atLeast(1).of(log).error(with(any(String.class)));
+			}
+		});
+
+		final StepQueryRunnerImpl impl = new StepQueryRunnerImpl(log);
+		impl.run(null);
+	}
+}

Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/TestProcessor.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/TestProcessor.java	                        (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/TestProcessor.java	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,52 @@
+package com.tyndalehouse.step.web.server.db.helper;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.tyndalehouse.step.web.server.common.ConfigNotLoadedException;
+import com.tyndalehouse.step.web.server.db.framework.MalformedStepQueryException;
+import com.tyndalehouse.step.web.server.db.framework.Query;
+import com.tyndalehouse.step.web.server.db.framework.ResultSetProcessor;
+
+/**
+ * Test processor, to test the retrieval of data from the database
+ * 
+ * @author CJBurrell
+ * 
+ */
+public class TestProcessor implements ResultSetProcessor<String> {
+	/**
+	 * simple constructor
+	 */
+	public TestProcessor() {
+
+	}
+
+
+	public Map<String, Object> getParameters() {
+		final Map<String, Object> params = new HashMap<String, Object>();
+		params.put("event_name", "Events in Africa");
+		params.put("event_id", 2);
+		final long l = -160321161544388L;
+		params.put("date_of_event", l);
+		return params;
+	}
+
+	public Query getQuery() {
+		return TestQueryImpl.TEST_QUERY_PARAMS_DIFFERENT_TYPES;
+	}
+
+	public List<String> process(final ResultSet rs) throws MalformedStepQueryException,
+		ConfigNotLoadedException, SQLException {
+		final List<String> events = new ArrayList<String>();
+
+		while (rs.next()) {
+			events.add(rs.getString("name"));
+		}
+		return events;
+	}
+}

Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/TestQueryImpl.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/TestQueryImpl.java	                        (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/db/helper/TestQueryImpl.java	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,28 @@
+package com.tyndalehouse.step.web.server.db.helper;
+
+import com.tyndalehouse.step.web.server.db.framework.Query;
+
+public enum TestQueryImpl implements Query {
+	/** a test query */
+	TEST_QUERY_PARAMS_DIFFERENT_TYPES("tests");
+
+	/**
+	 * component, directory of the test queries
+	 */
+	private final String component;
+
+	/**
+	 * creates the enum
+	 * 
+	 * @param component given a component/directory where the test sql script
+	 *            lives
+	 */
+	TestQueryImpl(final String component) {
+		this.component = component;
+	}
+
+
+	public String getComponent() {
+		return component;
+	}
+}

Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetCurrentBibleTextHandlerTest.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetCurrentBibleTextHandlerTest.java	                        (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetCurrentBibleTextHandlerTest.java	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,138 @@
+package com.tyndalehouse.step.web.server.handlers;
+
+import net.customware.gwt.dispatch.shared.ActionException;
+
+import org.apache.commons.logging.Log;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.tyndalehouse.step.web.server.handler.GetCurrentBibleTextHandler;
+import com.tyndalehouse.step.web.shared.command.GetCurrentBibleTextCommand;
+import com.tyndalehouse.step.web.shared.common.scripturelookup.BibleTextLookupType;
+import com.tyndalehouse.step.web.shared.result.GetCurrentBibleTextResult;
+
+/**
+ * Tests the handler that retrieves scripture from the server
+ * 
+ * @author CJBurrell
+ * 
+ */
+ at RunWith(JMock.class)
+public class GetCurrentBibleTextHandlerTest {
+	/**
+	 * The standard context for mocking objects
+	 */
+	private final Mockery context = new Mockery();
+
+	/**
+	 * tests a greek reverse interlinear
+	 * 
+	 * @throws ActionException exception during test
+	 **/
+	@Test
+	public void testGreekReverseInterlinear() throws ActionException {
+		final Log log = context.mock(Log.class);
+
+		context.checking(new Expectations() {
+			{
+				ignoring(log);
+			}
+		});
+
+		final GetCurrentBibleTextCommand cmd = new GetCurrentBibleTextCommand("KJV", "acts 1:1");
+		cmd.setTypeOfLookup(BibleTextLookupType.REVERSE_INTERLINEAR);
+
+		final GetCurrentBibleTextHandler handler = new GetCurrentBibleTextHandler();
+		final GetCurrentBibleTextResult result = handler.execute(cmd, null);
+
+		Assert.assertNotNull(result.getPassage());
+		Assert.assertNotNull(result.getPassage().getVerseContent());
+		Assert.assertTrue(result.getPassage().getVerseContent().size() != 0);
+
+		// TODO: add interlinear specific stuff
+
+	}
+
+	/**
+	 * tests hebrew reverse interlinear
+	 * 
+	 * @throws ActionException an exception during execution
+	 */
+	@Test
+	public void testHebrewReverseInterlinear() throws ActionException {
+		final Log log = context.mock(Log.class);
+
+		context.checking(new Expectations() {
+			{
+				ignoring(log);
+			}
+		});
+
+		final GetCurrentBibleTextCommand cmd = new GetCurrentBibleTextCommand("KJV", "Gen 1:1");
+		cmd.setTypeOfLookup(BibleTextLookupType.REVERSE_INTERLINEAR);
+
+		final GetCurrentBibleTextHandler handler = new GetCurrentBibleTextHandler();
+		final GetCurrentBibleTextResult result = handler.execute(cmd, null);
+
+		Assert.assertNotNull(result.getPassage());
+		Assert.assertNotNull(result.getPassage().getVerseContent());
+		Assert.assertTrue(result.getPassage().getVerseContent().size() != 0);
+
+		// TODO: add interlinear specific stuff
+
+	}
+
+	/**
+	 * tests a logical lookup of the passage, as opposed to plain text
+	 * 
+	 * @throws ActionException exception during running
+	 */
+	@Test
+	public void testLogicalPassage() throws ActionException {
+		final Log log = context.mock(Log.class);
+
+		context.checking(new Expectations() {
+			{
+				ignoring(log);
+			}
+		});
+
+		final GetCurrentBibleTextCommand cmd = new GetCurrentBibleTextCommand("ESV", "Gen 1:1");
+		cmd.setTypeOfLookup(BibleTextLookupType.LOGICAL);
+
+		final GetCurrentBibleTextHandler handler = new GetCurrentBibleTextHandler();
+		final GetCurrentBibleTextResult result = handler.execute(cmd, null);
+
+		Assert.assertEquals(result.getPassage().getText(),
+			"In the beginning, God created the heavens and the earth.");
+	}
+
+	/**
+	 * An lookup for plain text
+	 * 
+	 * @throws ActionException exception during the retrieval of the text
+	 */
+	@Test
+	public void testLookupText() throws ActionException {
+		final Log log = context.mock(Log.class);
+
+		context.checking(new Expectations() {
+			{
+				ignoring(log);
+			}
+		});
+
+		final GetCurrentBibleTextCommand cmd = new GetCurrentBibleTextCommand("ESV", "Gen 1:1");
+		cmd.setTypeOfLookup(BibleTextLookupType.PLAIN_TEXT);
+
+		final GetCurrentBibleTextHandler handler = new GetCurrentBibleTextHandler();
+		final GetCurrentBibleTextResult result = handler.execute(cmd, null);
+
+		Assert.assertEquals(result.getPassageText(),
+			"In the beginning, God created the heavens and the earth.");
+	}
+}

Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetDictionaryDefinitionHandlerTest.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetDictionaryDefinitionHandlerTest.java	                        (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetDictionaryDefinitionHandlerTest.java	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,69 @@
+package com.tyndalehouse.step.web.server.handlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.Assert;
+import net.customware.gwt.dispatch.shared.ActionException;
+
+import org.apache.commons.logging.Log;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.tyndalehouse.step.web.server.handler.GetDictionaryDefinitionHandler;
+import com.tyndalehouse.step.web.shared.command.GetDictionaryDefinitionCommand;
+import com.tyndalehouse.step.web.shared.result.GetDictionaryDefinitionResult;
+
+/**
+ * Tests the retrieval of a dictionary definition from a dictionary module
+ * 
+ * @author CJBurrell
+ * 
+ */
+ at RunWith(JMock.class)
+public class GetDictionaryDefinitionHandlerTest {
+
+	/**
+	 * The standard context for mocking objects
+	 */
+	private final Mockery context = new Mockery();
+
+	// TODO: add test to ensure that we have a negative,
+	// what happens when we lookup a reference that doesn't exist
+	// at the moment we get a false positive
+
+	/**
+	 * looks up some text for two references, one greek, one hebrew
+	 * 
+	 * @throws ActionException an exception during execution of the test
+	 */
+	@Test
+	public void testLookupText() throws ActionException {
+		final List<String> lookupReferences = new ArrayList<String>();
+		lookupReferences.add("strong:G00051");
+		lookupReferences.add("strong:H00052");
+
+		final Log log = context.mock(Log.class);
+		context.checking(new Expectations() {
+			{
+				ignoring(log);
+			}
+		});
+
+		final GetDictionaryDefinitionCommand cmd = new GetDictionaryDefinitionCommand();
+		cmd.setLookupReference(lookupReferences);
+
+		final GetDictionaryDefinitionHandler handler = new GetDictionaryDefinitionHandler();
+		final GetDictionaryDefinitionResult result = handler.execute(cmd, null);
+
+		Assert.assertTrue(result.getXsltedDefinition().contains(">00051<"));
+		Assert.assertTrue(result.getXsltedDefinition().contains("Abshay"));
+
+		Assert.assertTrue(result.getXsltedDefinition().contains(">00052<"));
+		Assert.assertTrue(result.getXsltedDefinition().contains("a thing ignored"));
+
+	}
+}

Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetTimelineUISetupHandlerTest.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetTimelineUISetupHandlerTest.java	                        (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/GetTimelineUISetupHandlerTest.java	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,60 @@
+package com.tyndalehouse.step.web.server.handlers;
+
+import java.util.ArrayList;
+
+import net.customware.gwt.dispatch.shared.ActionException;
+
+import org.apache.commons.logging.Log;
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.tyndalehouse.step.web.server.db.framework.StepQueryRunner;
+import com.tyndalehouse.step.web.server.handler.GetTimelineUISetupHandler;
+import com.tyndalehouse.step.web.shared.common.timeline.TimelineBean;
+
+/**
+ * Testing the timeline setup handler
+ * 
+ * @author CJBurrell
+ * 
+ */
+ at RunWith(JMock.class)
+public class GetTimelineUISetupHandlerTest {
+
+	/**
+	 * The standard context for mocking objects
+	 */
+	private final Mockery context = new Mockery();
+
+	/**
+	 * looks up
+	 * 
+	 * @throws ActionException an exception during the running
+	 */
+	@Test
+	public void testTimelineUIHandler() throws ActionException {
+		final Log log = context.mock(Log.class);
+
+		context.checking(new Expectations() {
+			{
+				ignoring(log);
+			}
+		});
+
+		final StepQueryRunner runner = context.mock(StepQueryRunner.class);
+		context.checking(new Expectations() {
+			{
+				atMost(1).of(runner);
+				will(returnValue(new ArrayList<TimelineBean>()));
+			}
+		});
+
+		new GetTimelineUISetupHandler(runner).execute(null, null);
+
+		// this test is purely to check we are not calling the database more
+		// than is required.
+	}
+}

Added: trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/JSwordInstallTest.java
===================================================================
--- trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/JSwordInstallTest.java	                        (rev 0)
+++ trunk/step-web-app/src/test/java/com/tyndalehouse/step/web/server/handlers/JSwordInstallTest.java	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,36 @@
+package com.tyndalehouse.step.web.server.handlers;
+
+import net.customware.gwt.dispatch.shared.ActionException;
+
+import org.junit.Test;
+
+/**
+ * Tests JSword installation handler
+ * 
+ * @author CJBurrell
+ * 
+ */
+public class JSwordInstallTest {
+	/**
+	 * tests the installation of a bible version from JSword/crosswire.org
+	 * 
+	 * @throws ActionException an exception during execution of the tests
+	 */
+	@Test
+	public void testInstallESV() throws ActionException {
+		//TODO: change to a module that's tiny. Because this test is quite slow, also relies on outside world
+//		
+//		final String initials = "ASV";
+//		final InstallJswordModuleCommand cmd = new InstallJswordModuleCommand();
+//		cmd.setInitials(initials);
+//
+//		
+//		final InstallJswordModuleHandler ijmh = new InstallJswordModuleHandler();
+//		final InstallJswordModuleResult result = ijmh.execute(cmd, null);
+//
+//		Assert.assertTrue(result.isSuccessful());
+//		Assert.assertTrue(Books.installed().getBook(initials) != null);
+//		// check book is installed
+
+	}
+}

Added: trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/queries/tests/test_query_params_different_types.sql
===================================================================
--- trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/queries/tests/test_query_params_different_types.sql	                        (rev 0)
+++ trunk/step-web-app/src/test/resources/com/tyndalehouse/step/web/server/db/queries/tests/test_query_params_different_types.sql	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,30 @@
+--------------------------------------------------------
+-- Query test
+-- This looks up 3 events 
+--------------------------------------------------------
+define date_of_event as bigint
+define event_name as varchar
+define event_id as integer
+
+
+	select 
+		name 
+	from 
+		step.event 
+	where 
+		name = #event_name# -- 'Events in Africa'
+union
+	select 
+		name 
+	from 
+		step.event 
+	where 
+		event_id = #event_id# -- 2
+union
+	select 
+		name 
+	from 
+		step.event 
+	where 
+		from_date = #date_of_event# -- = -160321161544388
+order by name

Added: trunk/step-web-app/war/WEB-INF/web.xml
===================================================================
--- trunk/step-web-app/war/WEB-INF/web.xml	                        (rev 0)
+++ trunk/step-web-app/war/WEB-INF/web.xml	2010-04-14 22:17:04 UTC (rev 122)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+  
+  	<!-- Remote logging agent for gwt-log -->
+	<servlet>
+		<servlet-name>remoteLoggerServiceImpl</servlet-name>
+		<servlet-class>com.allen_sauer.gwt.log.server.RemoteLoggerServiceImpl</servlet-class>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>remoteLoggerServiceImpl</servlet-name>
+		<url-pattern>/step/gwt-log</url-pattern>
+	</servlet-mapping>
+
+  
+  	<filter>
+		<filter-name>guiceFilter</filter-name>
+		<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
+	</filter>
+
+	<filter-mapping>
+		<filter-name>guiceFilter</filter-name>
+		<url-pattern>/*</url-pattern>
+	</filter-mapping>
+
+	<listener>
+		<listener-class>com.tyndalehouse.step.web.server.guice.MyGuiceServletConfig</listener-class>
+	</listener>
+
+	<!-- Default page to serve -->
+	<welcome-file-list>
+		<welcome-file>Step.html</welcome-file>
+	</welcome-file-list>
+
+</web-app>




More information about the Tynstep-svn mailing list