<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<!-- Author: Jason Holzbach - AEM Corporation -->
	<!-- Version: 2.0 -->

	<xsl:include href="pbdmi_common_2.xsl"/>

	<xsl:output indent="yes" method="xml"/>

	<xsl:template match="*">

		<!-- HEADER -->
		<xsl:element name="FILETRANSMISSION">
			<xsl:attribute name="FILELAYOUTTYPE">
				<xsl:value-of select="FileLayoutType"/>
			</xsl:attribute>
			<xsl:attribute name="FILEID">
				<xsl:value-of select="FileId"/>
			</xsl:attribute>
			<xsl:attribute name="SCHOOLYEAR">
				<xsl:value-of select="SchoolYear"/>
			</xsl:attribute>

			<!--loop through agency elements-->
			<xsl:for-each select="Agency">
				<!--<AGENCY FIPSSTATECODE="01" STATEAGENCYIDNUMBER="01" STATELEAIDNUMBER="001000-0000001">-->
				<xsl:element name="AGENCY">
					<xsl:attribute name="FIPSSTATECODE">
						<xsl:value-of select="FipsStateCode"/>
					</xsl:attribute>
					<xsl:attribute name="STATEAGENCYIDNUMBER">
						<xsl:value-of select="StateAgencyIdNumber"/>
					</xsl:attribute>

					<!--loop through ADDTLINDMEAS child elements-->
					<xsl:for-each select="AdditionalIndicator">
						<!--<TABLETYPE TYPEABBRV="ADDTLINDMEAS" TOTALINDICATOR="N">-->
						<xsl:element name="TABLETYPE">
							<xsl:attribute name="TYPEABBRV">ADDTLINDMEAS</xsl:attribute>
							<xsl:attribute name="TOTALINDICATOR">
								<xsl:value-of select="TotalIndicator"/>
							</xsl:attribute>

							<!--<CATEGORY TYPE="GRADELVLASS" VALUE="11"/>-->
							<xsl:apply-templates select="GradeLevelAssess">
								<xsl:with-param name="value">
									<xsl:value-of select="GradeLevelAssess"/>
								</xsl:with-param>
							</xsl:apply-templates>

							<!--<CATEGORY TYPE="RACEETHNIC" VALUE="AM"/>-->
							<xsl:apply-templates select="RaceEthnic">
								<xsl:with-param name="value">
									<xsl:value-of select="RaceEthnic"/>
								</xsl:with-param>
							</xsl:apply-templates>

							<!--<CATEGORY TYPE="GENDER" VALUE="M"/>-->
							<xsl:apply-templates select="Gender">
								<xsl:with-param name="value">
									<xsl:value-of select="Gender"/>
								</xsl:with-param>
							</xsl:apply-templates>
							
							<!--<CATEGORY TYPE="DISABSTATIDEA" VALUE="WODIS"/>-->
							<xsl:apply-templates select="DisabilityStatusIdea">
								<xsl:with-param name="value">
									<xsl:value-of select="DisabilityStatusIdea"/>
								</xsl:with-param>
							</xsl:apply-templates>
						
							<!--<CATEGORY TYPE="LEPBOTH" VALUE="LEP"/>-->
							<xsl:apply-templates select="LepStatusBoth">
								<xsl:with-param name="value">
									<xsl:value-of select="LepStatusBoth"/>
								</xsl:with-param>
							</xsl:apply-templates>

							<!--<CATEGORY TYPE="MIGRNTSTATUS" VALUE="NMS"/>-->
							<xsl:apply-templates select="MigrantStatus">
								<xsl:with-param name="value">
									<xsl:value-of select="MigrantStatus"/>
								</xsl:with-param>
							</xsl:apply-templates>

							<!--<CATEGORY TYPE="ECODIS" VALUE="NECODIS"/>-->
							<xsl:apply-templates select="EconomicDisadvantagedStatus">
								<xsl:with-param name="value">
									<xsl:value-of select="EconomicDisadvantagedStatus"/>
								</xsl:with-param>
							</xsl:apply-templates>

							<!--<CATEGORY TYPE="HOMELSSTATUS" VALUE="NH"/>-->
							<xsl:apply-templates select="HomelessStatus">
								<xsl:with-param name="value">
									<xsl:value-of select="HomelessStatus"/>
								</xsl:with-param>
							</xsl:apply-templates>

							<!--<CATEGORY TYPE="ATTAINSTATUS" VALUE="NH"/>-->
							<xsl:apply-templates select="AttainmentStatus">
								<xsl:with-param name="value">
									<xsl:value-of select="AttainmentStatus"/>
								</xsl:with-param>
							</xsl:apply-templates>

							<!--<AMOUNT>500</AMOUNT>-->
							<xsl:apply-templates select="Amount">
								<xsl:with-param name="value">
									<xsl:value-of select="Amount"/>
								</xsl:with-param>
							</xsl:apply-templates>

							<!--<EXPLANATION></EXPLANATION>-->
							<xsl:apply-templates select="Explanation">
								<xsl:with-param name="value">
									<xsl:value-of select="Explanation"/>
								</xsl:with-param>
							</xsl:apply-templates>
						</xsl:element>
					</xsl:for-each>
				</xsl:element>
			</xsl:for-each>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="TestFiles\x001_sea.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->