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

	<xsl:template match="/*">
		<xsl:element name="AltusA30SMReport">
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:template>
	
	<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>
	
	<xsl:template match="ColumnType | ColumnSerialNumber | ColumnInjections">
		<xsl:variable name="coltype">
			<xsl:value-of select="//ColumnType"/>
		</xsl:variable>
		<xsl:if test="string-length($coltype) > 0">
			<xsl:call-template name="Emit"/>
		</xsl:if>
	</xsl:template>

  <xsl:template match="NeedleType">
  </xsl:template>
  
</xsl:stylesheet>
