<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<!-- Author: Hector Tello - AEM Corporation -->
	<!-- Version: 4.0 -->

	<xsl:include href="pbdmi-common-4.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:value-of>
						</xsl:attribute>
					</xsl:if>

					<xsl:if test="StateSchoolIdNumber">
						<xsl:attribute name="STATESCHOOLIDNUMBER">
							<xsl:value-of select="StateSchoolIdNumber">
							</xsl:value-of>
						</xsl:attribute>
					</xsl:if>

					<!--<CATEGORY TYPE="ALTAPPROACHSTATUS" VALUE="YES"/>-->
					<xsl:apply-templates select="AypAlternateApproach">
						<xsl:with-param name="value">
							<xsl:value-of select="AypAlternateApproach"/>
						</xsl:with-param>
					</xsl:apply-templates>

					<!--<CATEGORY TYPE="AMAOPROFSTATUS" VALUE="METAMAOLEP"/>-->
					<xsl:apply-templates select="AmaoProficiency">
						<xsl:with-param name="value">
							<xsl:value-of select="AmaoProficiency"/>
						</xsl:with-param>
					</xsl:apply-templates>

					<!--<CATEGORY TYPE="AMAOPROGSTATUS" VALUE="NOTMETAMAOLEP"/>-->
					<xsl:apply-templates select="AmaoProgress">
						<xsl:with-param name="value">
							<xsl:value-of select="AmaoProgress"/>
						</xsl:with-param>
					</xsl:apply-templates>

					<!--<CATEGORY TYPE="AYPSTATUS" VALUE="YES"/>-->
					<xsl:apply-templates select="AypStatus">
						<xsl:with-param name="value">
							<xsl:value-of select="AypStatus"/>
						</xsl:with-param>
					</xsl:apply-templates>

					<!--<CATEGORY TYPE="DISTMEETAYP" VALUE="100"/>-->
					<xsl:apply-templates select="DistrictsMeetingAYP">
						<xsl:with-param name="value">
							<xsl:value-of select="DistrictsMeetingAYP"/>
						</xsl:with-param>
					</xsl:apply-templates>

					<!--<CATEGORY TYPE="DISTNOTMEETAYP" VALUE="5"/>-->
					<xsl:apply-templates select="DistrictsNotMeetingAYP">
						<xsl:with-param name="value">
							<xsl:value-of select="DistrictsNotMeetingAYP"/>
						</xsl:with-param>
					</xsl:apply-templates>

					<!--<CATEGORY TYPE="SCHOOLMEETAYP" VALUE="1000"/>-->
					<xsl:apply-templates select="SchoolsMeetingAYP">
						<xsl:with-param name="value">
							<xsl:value-of select="SchoolsMeetingAYP"/>
						</xsl:with-param>
					</xsl:apply-templates>

					<!--<CATEGORY TYPE="SCHOOLNOTMEETAYP" VALUE="25"/>-->
					<xsl:apply-templates select="SchoolsNotMeetingAYP">
						<xsl:with-param name="value">
							<xsl:value-of select="SchoolsNotMeetingAYP"/>
						</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:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="no" name="SEA" userelativepaths="yes" externalpreview="no" url="TestFiles\x103_sea.xml" htmlbaseurl="" outputurl="TestFiles\transformed\x103_sea.xml" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="yes" validator="internal" customvalidator="" ><validatorSchema value="..\LegacyXSD\x103_sea_ayp_status_v3.xsd"/></scenario><scenario default="no" name="LEA" userelativepaths="yes" externalpreview="no" url="TestFiles\x103_lea.xml" htmlbaseurl="" outputurl="TestFiles\transformed\x103_lea.xml" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="yes" validator="internal" customvalidator="" ><validatorSchema value="..\LegacyXSD\x103_lea_ayp_status_v3.xsd"/></scenario><scenario default="yes" name="School" userelativepaths="yes" externalpreview="no" url="TestFiles\x103_school.xml" htmlbaseurl="" outputurl="TestFiles\transformed\x103_school.xml" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="yes" validator="internal" customvalidator="" ><validatorSchema value="..\LegacyXSD\x103_school_ayp_status_v3.xsd"/></scenario></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->