<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:Locale="urn:Locale-namespace">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  <xsl:include href="DefaultPrint-r102.xsl"/>
  <xsl:include href="Locale.xsl"/>
  <xsl:variable name="NativePressureUnits">psi</xsl:variable>
  <xsl:variable name="TheSchema" select="document('AltusA10UV-Report-r100.xsd')"/>
  <xsl:variable name="LanguageSubfolder" select="Locale:LanguageSubfolder()"/>
  <xsl:variable name="ResourceFile" select="concat($LanguageSubfolder,'\\AltusA10UV-Resource-r100.xml')"/>
  <xsl:variable name="TheResources" select="document(string($ResourceFile))"/>
  <xsl:template match="/*">
    <xsl:element name="AltusA10UVReport">
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>
  <xsl:template match="SupportsFlowCellMemDevice|SupportsTempControl"/>
 
  <xsl:template match="Messages">
    <xsl:if test="count(child::*) > 0">
      <xsl:element name="FieldList">
        <xsl:element name="Title">
          <xsl:value-of select="$TheResources//Type[@name='tMessageList']/@prompt"/>
        </xsl:element>
        <xsl:apply-templates/>
      </xsl:element>
    </xsl:if>
  </xsl:template>
  <xsl:template match="Message">
    <xsl:element name="Field">
      <xsl:attribute name="name"><xsl:value-of select="position()"/><xsl:text>. </xsl:text></xsl:attribute>
      <xsl:attribute name="type">String</xsl:attribute>
      <xsl:value-of select="."/>
    </xsl:element>
  </xsl:template>
  <!-- Customize text for boolean Yes/No before end of FieldList -->
  <xsl:template match="LampChanged">
    <xsl:call-template name="Emit-Field-Value-Prompt">
      <xsl:with-param name="InputVar" select="name()"/>
      <xsl:with-param name="InputType">String</xsl:with-param>
      <xsl:with-param name="InputPrecision">0</xsl:with-param>
      <xsl:with-param name="InputValue">
        <xsl:choose>
          <xsl:when test=". = 'true'">
            <xsl:value-of select="$TheResources//Enum[@id='BooleanYes_1A']/@value"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$TheResources//Enum[@id='BooleanNo_0A']/@value"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:with-param>
      <xsl:with-param name="InputPrompt">
        <xsl:value-of select="$TheResources//Type[@name='tLampChanged']/@prompt"/>
      </xsl:with-param>
      <xsl:with-param name="InputUnits">None</xsl:with-param>
    </xsl:call-template>
  </xsl:template>
 <xsl:template match="FlowCellVariety">
    <xsl:variable name="flowcellvar">
      <xsl:value-of select="//FlowCellVariety"/>
    </xsl:variable>
    <xsl:variable name="showflowcelldata">
      <xsl:value-of select="//SupportsFlowCellMemDevice"/>
    </xsl:variable>
    <xsl:if test="string-length($flowcellvar) > 0 and $showflowcelldata = 'true'">
      <xsl:call-template name="Emit"/>
    </xsl:if>
  </xsl:template>
  <!-- Filter out the rest of the flow cell data -->
	<xsl:template match="FlowCellPathLengthMM|FlowCellVolumeUL|FlowCellSerialNumber|FlowCellPartNumber">
		<xsl:variable name="showflowcelldata">
			<xsl:value-of select="//SupportsFlowCellMemDevice"/>
		</xsl:variable>
		<xsl:if test="$showflowcelldata = 'true'">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>
	<xsl:template match="TemperatureControlSetting">
		<xsl:variable name="showtempcontrolsetting">
			<xsl:value-of select="//SupportsTempControl"/>
		</xsl:variable>
		<xsl:if test="$showtempcontrolsetting = 'true'">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>
  <xsl:template match="LampSerialNumber">
      <xsl:call-template name="Emit"/>
      <xsl:text disable-output-escaping="yes">
      &lt;/FieldList&gt;
			</xsl:text>
  </xsl:template>
</xsl:stylesheet>
