<?xml version="1.0" encoding="utf-8"?>
<!-- Version 8.0 -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:include href="pbdmi-common-8.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>
			<xsl:variable name="fips" select="FipsStateCode"/>
			<!--loop through agency elements-->
			<xsl:for-each select="Agency">
				<!--<AGENCY FIPSSTATECODE="01" STATEAGENCYIDNUMBER="01">--> <xsl:element name="AGENCY">
					<xsl:attribute name="FIPSSTATECODE">
						<xsl:value-of select="$fips"/>
					</xsl:attribute>
					<xsl:attribute name="STATEAGENCYIDNUMBER">
						<xsl:value-of select="StateAgencyIdNumber"/>
					</xsl:attribute>
					<xsl:if test="StateLeaIdNumber">
						<xsl:attribute name="STATELEAIDNUMBER">
							<xsl:value-of select="StateLeaIdNumber"/>
						</xsl:attribute>
					</xsl:if>
					<xsl:if test="StateSchoolIdNumber">
						<xsl:attribute name="STATESCHOOLIDNUMBER">
							<xsl:value-of select="StateSchoolIdNumber"/>
						</xsl:attribute>
					</xsl:if>
					<!--loop through IDEADISAB child elements-->
					<xsl:for-each select="IdeaDisabledSchoolAge">
						<!--<TABLETYPE TYPEABBRV="IDEADISAB" TOTALINDICATOR="N">--> <xsl:element name="TABLETYPE">
							<xsl:attribute name="TYPEABBRV">IDEADISAB</xsl:attribute>
							<xsl:attribute name="TOTALINDICATOR">
								<xsl:value-of select="TotalIndicator"/>
							</xsl:attribute>
							<!--<CATEGORY TYPE="RACEETHNIC" VALUE="AS"/>--> <xsl:apply-templates select="RaceEthnic">
								<xsl:with-param name="value">
									<xsl:value-of select="RaceEthnic"/>
								</xsl:with-param>
							</xsl:apply-templates>
							<!--<CATEGORY TYPE="SEX" VALUE="M"/>--> <xsl:apply-templates select="Sex">
								<xsl:with-param name="value">
									<xsl:value-of select="Sex"/>
								</xsl:with-param>
							</xsl:apply-templates>
							<!--<CATEGORY TYPE="DISABCATIDEA" VALUE="AUT"/>--> <xsl:apply-templates select="DisabilityCategory">
								<xsl:with-param name="value">
									<xsl:value-of select="DisabilityCategory"/>
								</xsl:with-param>
							</xsl:apply-templates>
							<!--<CATEGORY TYPE="AGESA" VALUE="7"/>--> <xsl:apply-templates select="AgeSchoolAge">
								<xsl:with-param name="value">
									<xsl:value-of select="AgeSchoolAge"/>
								</xsl:with-param>
							</xsl:apply-templates>
							<!--<CATEGORY TYPE="EDENVIRIDEASA" VALUE="HH"/>--> <xsl:apply-templates select="IdeaEduEnvironmentSchoolAge">
								<xsl:with-param name="value">
									<xsl:value-of select="IdeaEduEnvironmentSchoolAge"/>
								</xsl:with-param>
							</xsl:apply-templates>
							<!--<CATEGORY TYPE="LEPBOTH" VALUE="FLEP1"/>--> <xsl:apply-templates select="LepStatusBoth">
								<xsl:with-param name="value">
									<xsl:value-of select="LepStatusBoth"/>
								</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>