Index: projects/DailyDrillingReport_1.2/XML/PDFreport/ddr_PDFReport_transformation_2011_03_09.xsl
===================================================================
--- projects/DailyDrillingReport_1.2/XML/PDFreport/ddr_PDFReport_transformation_2011_03_09.xsl (revision 230)
+++ projects/DailyDrillingReport_1.2/XML/PDFreport/ddr_PDFReport_transformation_2011_03_09.xsl (revision 245)
@@ -152,6 +152,6 @@
 							<xsl:value-of select="$element_drillReportStatusInfo//xsd:element[@name='avgPresBH']/@sawsdl:modelReference"/>
 						</xsl:variable>
-						<xsl:variable name="url_expTempBH">
-							<xsl:value-of select="$element_drillReportStatusInfo//xsd:element[@name='expTempBH']/@sawsdl:modelReference"/>
+						<xsl:variable name="url_avgTempBH">
+							<xsl:value-of select="$element_drillReportStatusInfo//xsd:element[@name='avgTempBH']/@sawsdl:modelReference"/>
 						</xsl:variable>
 						<xsl:variable name="url_fixedRig">
@@ -415,8 +415,8 @@
 									<fo:table-cell vertical-align="middle">
 										<fo:block font-size="11pt" font-weight="bold">
-											<fo:basic-link external-destination="url({$url_expTempBH})">Temperature </fo:basic-link>
-											<xsl:if test="string(/witsml:drillReports/witsml:drillReport/witsml:statusInfo/witsml:expTempBH/@uom)">
+											<fo:basic-link external-destination="url({$url_avgTempBH})">Temperature </fo:basic-link>
+											<xsl:if test="string(/witsml:drillReports/witsml:drillReport/witsml:statusInfo/witsml:avgTempBH/@uom)">
 												<fo:inline>
-													<xsl:value-of select="/witsml:drillReports/witsml:drillReport/witsml:statusInfo/witsml:expTempBH/@uom"/>
+													<xsl:value-of select="/witsml:drillReports/witsml:drillReport/witsml:statusInfo/witsml:avgTempBH/@uom"/>
 												</fo:inline>
 											</xsl:if>: </fo:block>
@@ -424,7 +424,7 @@
 									<fo:table-cell vertical-align="middle">
 										<fo:block>
-											<xsl:if test="string(/witsml:drillReports/witsml:drillReport/witsml:statusInfo/witsml:expTempBH)">
+											<xsl:if test="string(/witsml:drillReports/witsml:drillReport/witsml:statusInfo/witsml:avgTempBH)">
 												<fo:inline>
-													<xsl:value-of select="/witsml:drillReports/witsml:drillReport/witsml:statusInfo/witsml:expTempBH"/>
+													<xsl:value-of select="/witsml:drillReports/witsml:drillReport/witsml:statusInfo/witsml:avgTempBH"/>
 												</fo:inline>
 											</xsl:if>
@@ -867,9 +867,7 @@
 																<fo:table-cell>
 																	<fo:block>
-																		<xsl:if test="string(substring-after(substring(witsml:dTimEnd, 0, 17), 'T'))">
-																			<fo:inline>
-																				<xsl:value-of select="substring-after(substring(witsml:dTimEnd, 0, 17), 'T')"/>
-																			</fo:inline>
-																		</xsl:if>
+																		<fo:inline>
+																			<xsl:value-of select="substring-after(substring(witsml:dTimEnd, 0, 17), 'T')"/>
+																		</fo:inline>
 																	</fo:block>
 																</fo:table-cell>
@@ -885,16 +883,16 @@
 																<fo:table-cell>
 																	<fo:block>
-																		<xsl:if test="string(witsml:mdHoleEnd)">
-																			<fo:inline>
-																				<xsl:value-of select="witsml:mdHoleEnd"/>
-																			</fo:inline>
-																		</xsl:if>
-																	</fo:block>
-																</fo:table-cell>
-																<fo:table-cell>
-																	<fo:block>
 																		<xsl:if test="string(witsml:md)">
 																			<fo:inline>
 																				<xsl:value-of select="witsml:md"/>
+																			</fo:inline>
+																		</xsl:if>
+																	</fo:block>
+																</fo:table-cell>
+																<fo:table-cell>
+																	<fo:block>
+																		<xsl:if test="string(witsml:md)">
+																			<fo:inline>
+																				<xsl:value-of select="format-number(witsml:md - witsml:mdHoleStart, '0.0#')"/>
 																			</fo:inline>
 																		</xsl:if>
@@ -1477,5 +1475,5 @@
 								<xsl:value-of select="$element_pipe/casing_liner_tubing_run//xsd:element[@name='dTimStart']/@sawsdl:modelReference"/>
 							</xsl:variable>
-							<xsl:variable name="url_dTimEnd">
+							<xsl:variable name="url_dTimEndCLT">
 								<xsl:value-of select="$element_pipe/casing_liner_tubing_run//xsd:element[@name='dTimEnd']/@sawsdl:modelReference"/>
 							</xsl:variable>
@@ -2136,9 +2134,11 @@
 																	<fo:table-cell>
 																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_typeFluid})">Fluid type</fo:basic-link></fo:block>
-																	</fo:table-cell>
-																	<fo:table-cell>
-																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_volPumped})">Volume pumped</fo:basic-link></fo:block>
+																			<fo:basic-link external-destination="url({$url_typeFluid})">Fluid type</fo:basic-link>
+																		</fo:block>
+																	</fo:table-cell>
+																	<fo:table-cell>
+																		<fo:block>
+																			<fo:basic-link external-destination="url({$url_volPumped})">Volume pumped</fo:basic-link>
+																		</fo:block>
 																		<fo:block>
 																			<xsl:if test="string(witsml:cementingFluid/witsml:volPumped/@uom)">
@@ -2151,5 +2151,6 @@
 																	<fo:table-cell>
 																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_density})">Fluid densitiy</fo:basic-link></fo:block>
+																			<fo:basic-link external-destination="url({$url_density})">Fluid densitiy</fo:basic-link>
+																		</fo:block>
 																		<fo:block>
 																			<xsl:if test="string(witsml:cementingFluid/witsml:density/@uom)">
@@ -2162,5 +2163,6 @@
 																	<fo:table-cell>
 																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_yp})">Yield point</fo:basic-link></fo:block>
+																			<fo:basic-link external-destination="url({$url_yp})">Yield point</fo:basic-link>
+																		</fo:block>
 																		<fo:block>
 																			<xsl:if test="string(witsml:cementingFluid/witsml:yp/@uom)">
@@ -2173,5 +2175,6 @@
 																	<fo:table-cell>
 																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_ratioMixWater})">Mix water ratio</fo:basic-link></fo:block>
+																			<fo:basic-link external-destination="url({$url_ratioMixWater})">Mix water ratio</fo:basic-link>
+																		</fo:block>
 																		<fo:block>
 																			<xsl:if test="string(witsml:cementingFluid/witsml:ratioMixWater/@uom)">
@@ -2184,5 +2187,6 @@
 																	<fo:table-cell>
 																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_pcFreeWater})">Free water</fo:basic-link></fo:block>
+																			<fo:basic-link external-destination="url({$url_pcFreeWater})">Free water</fo:basic-link>
+																		</fo:block>
 																		<fo:block>
 																			<xsl:if test="string(witsml:cementingFluid/witsml:pcFreeWater/@uom)">
@@ -2195,5 +2199,6 @@
 																	<fo:table-cell>
 																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_eTimThickening})">Thickening time</fo:basic-link></fo:block>
+																			<fo:basic-link external-destination="url({$url_eTimThickening})">Thickening time</fo:basic-link>
+																		</fo:block>
 																		<fo:block>
 																			<xsl:if test="string(witsml:cementingFluid/witsml:eTimThickening/@uom)">
@@ -2206,9 +2211,11 @@
 																	<fo:table-cell text-align="left">
 																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_descFluid})">Fluid Description</fo:basic-link></fo:block>
+																			<fo:basic-link external-destination="url({$url_descFluid})">Fluid Description</fo:basic-link>
+																		</fo:block>
 																	</fo:table-cell>
 																	<fo:table-cell  text-align="left">
 																		<fo:block>
-																		<fo:basic-link external-destination="url({$url_fluidComments})">Comments</fo:basic-link></fo:block>
+																			<fo:basic-link external-destination="url({$url_fluidComments})">Comments</fo:basic-link>
+																		</fo:block>
 																	</fo:table-cell>
 																</fo:table-row>
