Index: projects/DailyDrillingReport_1.2/XML/HTMLreport/ddr_HTMLReport_transformation_2011_02_07.xsl
===================================================================
--- projects/DailyDrillingReport_1.2/XML/HTMLreport/ddr_HTMLReport_transformation_2011_02_07.xsl (revision 152)
+++ projects/DailyDrillingReport_1.2/XML/HTMLreport/ddr_HTMLReport_transformation_2011_02_07.xsl (revision 159)
@@ -540,7 +540,5 @@
 												</td>
 												<td align="center">
-													<xsl:variable name="element_casing" select="document($ddrSchema)/xsd:schema/xsd:simpleType[@name='tubularJobTypes']/xsd:restriction"/>
-													<xsl:variable name="casingTypes" select="witsml:casing_liner_tubing_run/witsml:tubularJobType" />
-													<xsl:value-of select="$element_casing//xsd:enumeration[@value=$casingTypes]"/>
+													<xsl:value-of select="witsml:casing_liner_tubing_run/witsml:tubularJobType"/>
 												</td>
 												<td align="center">
@@ -660,7 +658,5 @@
 												</td>
 												<td align="center">
-													<xsl:variable name="element_jobTypes" select="document($ddrSchema)/xsd:schema/xsd:simpleType[@name='cementJobTypes']/xsd:restriction"/>
-													<xsl:variable name="jobTypes" select="witsml:jobType" />
-													<xsl:value-of select="$element_jobTypes//xsd:enumeration[@value=$jobTypes]"/>
+													<xsl:value-of select="witsml:jobType"/>
 												</td>
 												<td align="center">
@@ -671,14 +667,14 @@
 												</td>
 												<td align="center">
-													<xsl:if test="witsml:topPlug='true'">yes</xsl:if>
-													<xsl:if test="witsml:topPlug='false'">no</xsl:if>
-												</td>
-												<td align="center">
-													<xsl:if test="witsml:botPlug='true'">yes</xsl:if>
-													<xsl:if test="witsml:botPlug='false'">no</xsl:if>
-												</td>
-												<td align="center">
-													<xsl:if test="witsml:plugBumped='true'">yes</xsl:if>
-													<xsl:if test="witsml:plugBumped='false'">no</xsl:if>
+													<xsl:if test="witsml:topPlug='true' or witsml:topPlug='1'">yes</xsl:if>
+													<xsl:if test="witsml:topPlug='false' or witsml:topPlug='0'">no</xsl:if>
+												</td>
+												<td align="center">
+													<xsl:if test="witsml:botPlug='true' or witsml:botPlug='1'">yes</xsl:if>
+													<xsl:if test="witsml:botPlug='false' or witsml:botPlug='0'">no</xsl:if>
+												</td>
+												<td align="center">
+													<xsl:if test="witsml:plugBumped='true' or witsml:plugBumped='1'">yes</xsl:if>
+													<xsl:if test="witsml:plugBumped='false' or witsml:plugBumped='0'">no</xsl:if>
 												</td>
 												<td align="center">
@@ -686,6 +682,6 @@
 												</td>
 												<td align="center">
-													<xsl:if test="witsml:floatHeld='true'">yes</xsl:if>
-													<xsl:if test="witsml:floatHeld='false'">no</xsl:if>
+													<xsl:if test="witsml:floatHeld='true' or witsml:floatHeld='1'">yes</xsl:if>
+													<xsl:if test="witsml:floatHeld='false' or witsml:floatHeld='0'">no</xsl:if>
 												</td>
 												<td align="center">
@@ -693,6 +689,6 @@
 												</td>
 												<td align="center">
-													<xsl:if test="witsml:annFlowAfter='true'">yes</xsl:if>
-													<xsl:if test="witsml:annFlowAfter='false'">no</xsl:if>
+													<xsl:if test="witsml:annFlowAfter='true' or witsml:annFlowAfter='1'">yes</xsl:if>
+													<xsl:if test="witsml:annFlowAfter='false' or witsml:annFlowAfter='0'">no</xsl:if>
 												</td>
 												<td align="center">
@@ -700,10 +696,10 @@
 												</td>
 												<td align="center">
-													<xsl:if test="witsml:reciprocated='true'">yes</xsl:if>
-													<xsl:if test="witsml:reciprocated='false'">no</xsl:if>
-												</td>
-												<td align="center">
-													<xsl:if test="witsml:rotated='true'">yes</xsl:if>
-													<xsl:if test="witsml:rotated='false'">no</xsl:if>
+													<xsl:if test="witsml:reciprocated='true' or witsml:reciprocated='1'">yes</xsl:if>
+													<xsl:if test="witsml:reciprocated='false' or witsml:reciprocated='0'">no</xsl:if>
+												</td>
+												<td align="center">
+													<xsl:if test="witsml:rotated='true' or witsml:rotated='1'">yes</xsl:if>
+													<xsl:if test="witsml:rotated='false' or witsml:rotated='0'">no</xsl:if>
 												</td>
 											</tr>
@@ -712,108 +708,108 @@
 								</tr>
 								<!--  witsml:cementingFluid -->
-								<tr height="5px">
-									<td/>
-								</tr>
-								<tr>
-									<td>
-									</td>
-								</tr>
-								<tr>
-									<td class="SectionHead">Cementing Fluid Details</td>
-								</tr>
-								<xsl:variable name="element_fluid" select="document($ddrSchema)/xsd:schema/xsd:complexType[@name='cementingFluid']/xsd:sequence"/>
-								<xsl:variable name="url_dTimFluid">
-									<xsl:value-of select="$element_fluid//xsd:element[@name='dTim']/@sawsdl:modelReference"/>
-								</xsl:variable>
-								<xsl:variable name="url_mdFluid">
-									<xsl:value-of select="$element_fluid//xsd:element[@name='md']/@sawsdl:modelReference"/>
-								</xsl:variable>
-								<xsl:variable name="url_mudClass">
-									<xsl:value-of select="$element_fluid//xsd:element[@name='mudClass']/@sawsdl:modelReference"/>
-								</xsl:variable>
-								<xsl:variable name="url_density">
-									<xsl:value-of select="$element_fluid//xsd:element[@name='density']/@sawsdl:modelReference"/>
-								</xsl:variable>
-								<xsl:variable name="url_pv">
-									<xsl:value-of select="$element_fluid//xsd:element[@name='pv']/@sawsdl:modelReference"/>
-								</xsl:variable>
-								<xsl:variable name="url_yp">
-									<xsl:value-of select="$element_fluid//xsd:element[@name='yp']/@sawsdl:modelReference"/>
-								</xsl:variable>
-								<tr>
-									<td>
-										<table id="table2">
-											<tr>
-												<td align="center" width="100" valign="top">
-													<a target="_blank" href="{$url_mudClass}">Fluid Type</a>
-												</td>
-												<td align="center" width="100" valign="top">
-													<a target="_blank" href="{$url_mudClass}">Fluid Description</a>
-												</td>
-												<td align="center" width="100" valign="top">
-													<a target="_blank" href="{$urlRDS}">Volume Pumped <xsl:value-of select="witsml:cementingFluid/witsml:volPumped/@uom"/>
-													</a>
-												</td>
-												<td align="center" width="100" valign="top">
-													<a target="_blank" href="{$url_density}">Fluid Density <xsl:value-of select="witsml:cementingFluid/witsml:density/@uom"/>
-													</a>
-												</td>
-												<td align="center" width="80" valign="top">
-													<a target="_blank" href="{$url_yp}">Yield Point <xsl:value-of select="witsml:cementingFluid/witsml:yp/@uom"/>
-													</a>
-												</td>
-												<td align="center" width="80" valign="top">
-													<a target="_blank" href="{$urlRDS}">Mix Water Ratio <xsl:value-of select="witsml:cementingFluid/witsml:ratioMixWater/@uom"/>
-													</a>
-												</td>
-												<td align="center" width="80" valign="top">
-													<a target="_blank" href="{$urlRDS}">Free Water <xsl:value-of select="witsml:cementingFluid/witsml:pcFreeWater/@uom"/>
-													</a>
-												</td>
-												<td align="center" width="80" valign="top">
-													<a target="_blank" href="{$urlRDS}">Thick Time <xsl:value-of select="witsml:cementingFluid/witsml:eTimThickening/@uom"/>
-													</a>
-												</td>
-												<td align="center" width="100" valign="top">
-													<a target="_blank" href="{$urlRDS}">Comments</a>
-												</td>
+								<xsl:if test="count(witsml:cementingFluid) > 0">
+									<tr height="5px">
+										<td/>
+									</tr>
+									<tr>
+										<td>
+										</td>
+									</tr>
+									<tr>
+										<td class="SectionHead">Cementing Fluid Details</td>
+									</tr>
+									<xsl:variable name="element_fluid" select="document($ddrSchema)/xsd:schema/xsd:complexType[@name='cementingFluid']/xsd:sequence"/>
+									<xsl:variable name="url_dTimFluid">
+										<xsl:value-of select="$element_fluid//xsd:element[@name='dTim']/@sawsdl:modelReference"/>
+									</xsl:variable>
+									<xsl:variable name="url_mdFluid">
+										<xsl:value-of select="$element_fluid//xsd:element[@name='md']/@sawsdl:modelReference"/>
+									</xsl:variable>
+									<xsl:variable name="url_mudClass">
+										<xsl:value-of select="$element_fluid//xsd:element[@name='mudClass']/@sawsdl:modelReference"/>
+									</xsl:variable>
+									<xsl:variable name="url_density">
+										<xsl:value-of select="$element_fluid//xsd:element[@name='density']/@sawsdl:modelReference"/>
+									</xsl:variable>
+									<xsl:variable name="url_pv">
+										<xsl:value-of select="$element_fluid//xsd:element[@name='pv']/@sawsdl:modelReference"/>
+									</xsl:variable>
+									<xsl:variable name="url_yp">
+										<xsl:value-of select="$element_fluid//xsd:element[@name='yp']/@sawsdl:modelReference"/>
+									</xsl:variable>
+									<tr>
+										<td>
+											<table id="table2">
+												<tr>
+													<td align="center" width="100" valign="top">
+														<a target="_blank" href="{$url_mudClass}">Fluid Type</a>
+													</td>
+													<td align="center" width="100" valign="top">
+														<a target="_blank" href="{$url_mudClass}">Fluid Description</a>
+													</td>
+													<td align="center" width="100" valign="top">
+														<a target="_blank" href="{$urlRDS}">Volume Pumped <xsl:value-of select="witsml:cementingFluid/witsml:volPumped/@uom"/>
+														</a>
+													</td>
+													<td align="center" width="100" valign="top">
+														<a target="_blank" href="{$url_density}">Fluid Density <xsl:value-of select="witsml:cementingFluid/witsml:density/@uom"/>
+														</a>
+													</td>
+													<td align="center" width="80" valign="top">
+														<a target="_blank" href="{$url_yp}">Yield Point <xsl:value-of select="witsml:cementingFluid/witsml:yp/@uom"/>
+														</a>
+													</td>
+													<td align="center" width="80" valign="top">
+														<a target="_blank" href="{$urlRDS}">Mix Water Ratio <xsl:value-of select="witsml:cementingFluid/witsml:ratioMixWater/@uom"/>
+														</a>
+													</td>
+													<td align="center" width="80" valign="top">
+														<a target="_blank" href="{$urlRDS}">Free Water <xsl:value-of select="witsml:cementingFluid/witsml:pcFreeWater/@uom"/>
+														</a>
+													</td>
+													<td align="center" width="80" valign="top">
+														<a target="_blank" href="{$urlRDS}">Thick Time <xsl:value-of select="witsml:cementingFluid/witsml:eTimThickening/@uom"/>
+														</a>
+													</td>
+													<td align="center" width="100" valign="top">
+														<a target="_blank" href="{$urlRDS}">Comments</a>
+													</td>
 
-											</tr>
-											<xsl:for-each select="witsml:cementingFluid">
-												<tr class="light">
-													<td align="center">
-														<xsl:variable name="element_fluidTypes" select="document($ddrSchema)/xsd:schema/xsd:simpleType[@name='fluidTypes']/xsd:restriction"/>
-														<xsl:variable name="fluidTypes" select="witsml:typeFluid" />
-														<xsl:value-of select="$element_fluidTypes//xsd:enumeration[@value=$fluidTypes]"/>
-													</td>
-													<td align="center">
-														<xsl:value-of select="witsml:descFluid"/>
-													</td>
-													<td align="center">
-														<xsl:value-of select="witsml:volPumped"/>
-													</td>
-													<td align="center">
-														<xsl:value-of select="witsml:density"/>
-													</td>
-													<td align="center">
-														<xsl:value-of select="witsml:yp"/>
-													</td>
-													<td align="center">
-														<xsl:value-of select="witsml:ratioMixWater"/>
-													</td>
-													<td align="center">
-														<xsl:value-of select="witsml:pcFreeWater"/>
-													</td>
-													<td align="center">
-														<xsl:value-of select="witsml:eTimThickening"/>
-													</td>
-													<td align="center">
-														<xsl:value-of select="witsml:comments"/>
-													</td>
 												</tr>
-											</xsl:for-each>
-										</table>
-									</td>
-								</tr>
+												<xsl:for-each select="witsml:cementingFluid">
+													<tr class="light">
+														<td align="center">
+															<xsl:value-of select="witsml:typeFluid"/>
+														</td>
+														<td align="center">
+															<xsl:value-of select="witsml:descFluid"/>
+														</td>
+														<td align="center">
+															<xsl:value-of select="witsml:volPumped"/>
+														</td>
+														<td align="center">
+															<xsl:value-of select="witsml:density"/>
+														</td>
+														<td align="center">
+															<xsl:value-of select="witsml:yp"/>
+														</td>
+														<td align="center">
+															<xsl:value-of select="witsml:ratioMixWater"/>
+														</td>
+														<td align="center">
+															<xsl:value-of select="witsml:pcFreeWater"/>
+														</td>
+														<td align="center">
+															<xsl:value-of select="witsml:eTimThickening"/>
+														</td>
+														<td align="center">
+															<xsl:value-of select="witsml:comments"/>
+														</td>
+													</tr>
+												</xsl:for-each>
+											</table>
+										</td>
+									</tr>
+								</xsl:if>
 							</xsl:for-each>
 						</xsl:if>
@@ -1588,6 +1584,6 @@
 												</td>
 												<td valign="top" align="center">
-													<xsl:if test="witsml:goodSeal='true'">yes</xsl:if>
-													<xsl:if test="witsml:goodSeal='false'">no</xsl:if>
+													<xsl:if test="witsml:goodSeal='true' or witsml:goodSeal='1'">yes</xsl:if>
+													<xsl:if test="witsml:goodSeal='false' or witsml:goodSeal='0'">no</xsl:if>
 												</td>
 												<td valign="top" align="center">
@@ -2604,6 +2600,6 @@
 			</td>
 			<td class="light">
-				<xsl:if test="witsml:tightWell='true'">yes</xsl:if>
-				<xsl:if test="witsml:tightWell='false'">no</xsl:if>
+				<xsl:if test="witsml:tightWell='true' or witsml:tightWell='1'">yes</xsl:if>
+				<xsl:if test="witsml:tightWell='false' or witsml:tightWell='0'">no</xsl:if>
 			</td>
 			<td class="ColHead">
@@ -2611,6 +2607,6 @@
 			</td>
 			<td class="light">
-				<xsl:if test="witsml:hpht='true'">yes</xsl:if>
-				<xsl:if test="witsml:hpht='false'">no</xsl:if>
+				<xsl:if test="witsml:hpht='true' or witsml:hpht='1'">yes</xsl:if>
+				<xsl:if test="witsml:hpht='false' or witsml:hpht='0'">no</xsl:if>
 			</td>
 		</tr>
