<?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:variable name="NativePressureUnits">psi</xsl:variable>
	<xsl:variable name="TheSchema" select="document('rAcquityFTN-Config-r100.xsd')"/>
	<xsl:variable name="LanguageSubfolder" select="Locale:LanguageSubfolder()"/>
	<xsl:variable name="ResourceFile" select="concat($LanguageSubfolder,'\\rAcquityFTN-Resource-r100.xml')"/>
	<xsl:variable name="TheResources" select="document(string($ResourceFile))"></xsl:variable>

  <xsl:template match="/*">
		<xsl:element name="rAcquityFTNConfig">
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>

	<!-- Omit the followiong... -->
  <xsl:template match="SystemName"/>
  <xsl:template match="ProductID"/>

  <xsl:template match="DisableUpperLeakSensor"/>
  <xsl:template match="DisableBottomLeakSensor"/>
  <xsl:template match="DisableExternalColumnLeakSensor"/>

  <xsl:template match="SpotLight"/>
  <xsl:template match="ChamberLight"/>
  
  <xsl:template match="ElevatorAddress"/>
  
	<xsl:template match="WarnOnMissingVial"/>
  <xsl:template match="RequireEcord"/>

  <xsl:template match="PreHeaterConfig"/>
  <xsl:template match="PressXDucerPresent"/>
  
  <xsl:template match="ColumnModuleType"/>
  <xsl:template match="ColumnModuleValveType"/>
  <xsl:template match="PressXDucerPresent"/>

  <xsl:template match="ColumnModuleMinTemp"/>
  <xsl:template match="ColumnModuleMaxTemp"/>

  <xsl:template match="ElevatorPresent"/>
  <xsl:template match="ElevatorFirmwareVersion"/>
  <xsl:template match="ElevatorChecksum"/>
  <!-- Customize text for booleans -->
  
  <xsl:template match="SampleHeaterCooler">
    <xsl:variable name="varname">
      <xsl:value-of select="name()"/>
    </xsl:variable>
    <xsl:call-template name="Emit-Field-Value-Prompt">
      <xsl:with-param name="InputVar" select="$varname"/>
      <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='xsd:boolean']/Prompt[@id='SampleHeaterCooler']/@value"/>
      </xsl:with-param>
      <xsl:with-param name="InputUnits">None</xsl:with-param>
    </xsl:call-template>
  </xsl:template>

  <xsl:template match="HasAspirationPump">
    <xsl:variable name="varname">
      <xsl:value-of select="name()"/>
    </xsl:variable>
    <xsl:call-template name="Emit-Field-Value-Prompt">
      <xsl:with-param name="InputVar" select="$varname"/>
      <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='xsd:boolean']/Prompt[@id='HasAspirationPump']/@value"/>
      </xsl:with-param>
      <xsl:with-param name="InputUnits">None</xsl:with-param>
    </xsl:call-template>
  </xsl:template>
  
  <xsl:template match="ColumnModulePreheaterPresent">
    <xsl:variable name="varname">
      <xsl:value-of select="name()"/>
    </xsl:variable>
    <xsl:call-template name="Emit-Field-Value-Prompt">
      <xsl:with-param name="InputVar" select="$varname"/>
      <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='xsd:boolean']/Prompt[@id='ColumnModulePreheaterPresent']/@value"/>
      </xsl:with-param>
      <xsl:with-param name="InputUnits">None</xsl:with-param>
    </xsl:call-template>
  </xsl:template>
  
  <xsl:template match="Elevator">
    <xsl:variable name="varname">
      <xsl:value-of select="name()"/>
    </xsl:variable>
    <xsl:call-template name="Emit-Field-Value-Prompt">
      <xsl:with-param name="InputVar" select="$varname"/>
      <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='xsd:boolean']/Prompt[@id='Elevator']/@value"/>
      </xsl:with-param>
      <xsl:with-param name="InputUnits">None</xsl:with-param>
    </xsl:call-template>
  </xsl:template>
  
  <!-- Emit elevator serial number only if elevator is present -->
	<xsl:template match="ElevatorSerialNumber">
		<xsl:variable name="ElevatorSN">
			<xsl:value-of select="."/>
		</xsl:variable>
		<xsl:if test="string-length($ElevatorSN)>0">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>

</xsl:stylesheet>

