<?xml version="1.0"?>
<!-- Author : R.Vijayavel, Mastek  -->
<!-- Prepared for  PLASC07-Secondary School Summary Report-HTML Presentation  on 2006-06-21-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:data="Mastek1" xmlns:LearningActivityRef="Mastek2" xmlns:LAProvider="Mastek3" xmlns:Ethnicity="Mastek4" exclude-result-prefixes="data LearningActivityRef LAProvider Ethnicity" >


<xsl:output method="html"/>

<xsl:key name="kLearningActivityProvider" match="//Pupils/Pupil/LearningActivity/LearningActivityProvider" use="."/>
<xsl:key name="kLearningActivityRef" match="//Pupils/Pupil/LearningActivity/LearningActivityReference" use="."/>
<xsl:key name="kEthnicity" match="//Pupils/Pupil/Ethnicity" use="."/>

<xsl:param name = "lang"/>			<!-- denotes language -->
<xsl:param name = "dateTime" /> 	<!-- denotes Date and Time in DD-MM-YYYY#hh:mm format -->
<xsl:param name = "errors" />     	<!-- denotes number of errors and number of warnings in "errors/warnings" format -->

<xsl:template match="/">
	<xsl:apply-templates select="SchoolSurvey"/>
	<html>
		<head>
			<title>PLASC07-SECONDARY SCHOOL SUMMARY</title>			
		</head>
		
		<body>
		<br/>
		<h3>Pupil Level Annual Census - January 2007</h3>
			<table border="0">
				<tr>			
					<xsl:if test = "$lang='Welsh'"><td><b><u>Crynodeb ar gyfer </u></b></td></xsl:if>
					<xsl:if test = "$lang='English'"><td><b><u>Summary for  </u></b></td>	</xsl:if>
					<td><b><xsl:value-of select="Message/School/Name" /></b></td>
				</tr>
			</table><br/><br/>
			<table border="0">
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Cod AALl</td></xsl:if>
					<xsl:if test = "$lang='English'"><td>LEA code</td>	</xsl:if>
					<td>: <xsl:value-of select="Message/School/LEA" /></td>				
				</tr>
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Rhif ysgol</td></xsl:if>
					<xsl:if test = "$lang='English'">	<td>NAW school number</td></xsl:if>
					<td> : <xsl:value-of select="Message/School/Estab" /></td>				
				</tr>
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Rhif ffôn</td></xsl:if>
					<xsl:if test = "$lang='English'"><td>Telephone number</td>	</xsl:if>
					<td> : <xsl:value-of select="Message/School/PhoneNo" /></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Rhif ffacs</td></xsl:if>
					<xsl:if test = "$lang='English'"><td>Fax number</td>	</xsl:if>
					<td> : <xsl:value-of select="Message/School/FaxNo" /></td>
				</tr>		
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Cyfeiriad e-bost</td></xsl:if>
					<xsl:if test = "$lang='English'"><td>E-mail address</td>	</xsl:if>
					<td> : <xsl:value-of select="Message/School/Email" /></td>
				</tr>		
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Cyfeiriad rhyngrwyd</td></xsl:if>
					<xsl:if test = "$lang='English'"><td>Internet address</td>	</xsl:if>
					<td> : <xsl:value-of select="Message/School/InternetAddress" /></td>
				</tr>	
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Math o ysgol</td></xsl:if>
					<xsl:if test = "$lang='English'"><td>Type of school</td>	</xsl:if>
					<td> : <xsl:value-of select="Message/School/SchoolType" /></td>
				</tr>	
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Categori yr ysgol</td></xsl:if>
					<xsl:if test = "$lang='English'"><td>School category</td>	</xsl:if>
					<td> : <xsl:value-of select="Message/School/Governance" /></td>
				</tr>	
				<tr>
					<xsl:if test = "$lang='Welsh'"><td>Ysgol Bechgyn/Merched/Cymysg</td></xsl:if>
					<xsl:if test = "$lang='English'"><td>Boys,Girls or Mixed school</td>	</xsl:if>
					<td> : <xsl:value-of select="Message/School/GenderMix" /></td>
				</tr>													
			</table>
			<br/><br/>
			
			<xsl:if test = "$lang='English'"><b><u>1.1.1 Pupils registered on roll: by gender,age and year group : Boys</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>1.1.1 Disgyblion ar y gofrestr: yn ôl rhyw, oedran a blwyddyn ysgol : Bechgyn</u></b></xsl:if>
			<br/><br/>
			<table border="1" cellpadding="7" cellspacing="0">
			<xsl:if test = "$lang='English'">
				<tr>			
					<th rowspan="2">Age</th>
					<th rowspan="2">Date of Birth</th>
					<th colspan="8" width="70%">Boys in year group</th>  								
  				</tr>
  			</xsl:if>
  			
  			<xsl:if test = "$lang='Welsh'">
				<tr>
					<th rowspan="2">Oedran</th>
					<th rowspan="2">Dyddiad Geni</th>
					<th colspan="8" width="70%">Bechgyn yn y grŵp blwyddyn</th> 
	 					
  				</tr>
  			</xsl:if>
			
			<tr>
				<th>7</th> <th>8</th> <th>9</th><th>10</th> <th>11</th> <th>12</th> <th>13</th> <th>Total</th>  					
			</tr>  
			<tr>
				<xsl:if test = "$lang='English'">
					<td> 19 or over</td><td>31/8/87 or earlier </td>
				</xsl:if>
				<xsl:if test = "$lang='Welsh'">
					<td>19 neu'n hŷn</td><td>31/8/87 neu'n gynt </td>					
				</xsl:if>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 18 </td><td>1/9/87 - 31/8/88 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 17 </td><td>1/9/88 - 31/8/89 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 16 </td><td>1/9/89 - 31/8/90 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 15 </td><td>1/9/90 - 31/8/91 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 14 </td><td>1/9/91 - 31/8/92 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 13 </td><td>1/9/92 - 31/8/93 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 12 </td><td>1/9/93 - 31/8/94 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 11 </td><td>1/9/94 - 31/8/95 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 10 </td><td>1/9/95 - 31/8/96 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<xsl:if test = "$lang='English'"><td> Less than 10</td><td>1/9/96 or later </td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td> Llai na 10</td><td>1/9/96 neu'n ddiweddarach </td></xsl:if>	
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>			
			</tr>
			<tr>
				<xsl:if test = "$lang='English'"><td colspan="2"><b> All ages</b></td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td colspan="2"><b> Pob oedran</b></td></xsl:if>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>			
			</table>
		
				
		<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>1.1.1 Pupils registered on roll: by gender,age and year group : Girls</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>1.1.1 Disgyblion ar y gofrestr: yn ôl rhyw, oedran a blwyddyn ysgol : Merched</u></b></xsl:if>
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0">
			<xsl:if test = "$lang='English'">
				<tr>			
					<th rowspan="2">Age</th>
					<th rowspan="2">Date of Birth</th>
					<th colspan="8" width="70%">Girls in year group</th>  								
  				</tr>
  			</xsl:if>
  			
  			<xsl:if test = "$lang='Welsh'">
				<tr>
					<th rowspan="2">Oedran</th>
					<th rowspan="2">Dyddiad Geni</th>
					<th colspan="8" width="70%">Merched yn y grwp blwyddyn </th> 
	 					
  				</tr>
  			</xsl:if>
			
			<tr>
				<th>7</th> <th>8</th> <th>9</th><th>10</th> <th>11</th> <th>12</th> <th>13</th> <th>Total</th>  					
			</tr>  
			<tr>
				<xsl:if test = "$lang='English'">
					<td> 19 or over</td><td>31/8/87 or earlier </td>
				</xsl:if>
				<xsl:if test = "$lang='Welsh'">
					<td>19 neu'n hŷn</td><td>31/8/87 neu'n gynt </td>					
				</xsl:if>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 18 </td><td>1/9/87 - 31/8/88 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 17 </td><td>1/9/88 - 31/8/89 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 16 </td><td>1/9/89 - 31/8/90 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 15 </td><td>1/9/90 - 31/8/91 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 14 </td><td>1/9/91 - 31/8/92 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 13 </td><td>1/9/92 - 31/8/93 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 12 </td><td>1/9/93 - 31/8/94 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 11 </td><td>1/9/94 - 31/8/95 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<td> 10 </td><td>1/9/95 - 31/8/96 </td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>
			<tr>
				<xsl:if test = "$lang='English'"><td> Less than 10</td><td>1/9/96 or later </td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td> Llai na 10</td><td>1/9/96 neu'n ddiweddarach </td></xsl:if>	
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>			
			</tr>
			<tr>
				<xsl:if test = "$lang='English'"><td colspan="2"><b> All ages</b></td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td colspan="2"><b> Pob oedran</b></td></xsl:if>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=7] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=8] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=9] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=10] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=11] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=12] )" /></td>
				<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=13] )" /></td>
				<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and (NCyearActual=7 or NCyearActual=8 or NCyearActual=9 or NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )" /></b></td>
			</tr>			
			</table>
		</P>	
		
		<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>1.1.2 Source of funding</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>1.1.2 Ffynhonnell cyllid</u></b></xsl:if>
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="40%">
				<xsl:if test = "$lang='English'">
					<tr>
						<th>Source of funding</th>
						<th width="30%">Number of pupils aged 18 or under at 31 August 2006</th>
					</tr>
				</xsl:if>
				<xsl:if test = "$lang='Welsh'">
					<tr>
						<th>Ffynhonnell cyllid</th>
						<th width="30%">Nifer y disgyblion 18 oed neu'n iau ar 31 Awst 2006</th>
					</tr>
				</xsl:if>
				<tr>
					<xsl:if test = "$lang='English'"><td>Franchised</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td> O dan Ddetholfraint</td></xsl:if>
					<td><xsl:value-of select="//SchoolSurvey/PupilFranchised"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Sponsored</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td> O dan Nawdd </td></xsl:if>
					<td><xsl:value-of select="//SchoolSurvey/PupilSponsored"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Full cost recovery</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td> Adennill costau llawn</td></xsl:if>
					<td><xsl:value-of select="//SchoolSurvey/PupilCostRecovery"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Other</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td> Arall</td></xsl:if>
					<td><xsl:value-of select="//SchoolSurvey/OtherFundedPupils"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b> Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="//SchoolSurvey/PupilFranchised + //SchoolSurvey/PupilSponsored + //SchoolSurvey/PupilCostRecovery + //SchoolSurvey/OtherFundedPupils"/></b></td>
				</tr>
			</table>
			<br/><br/><br/>
		
			<xsl:if test = "$lang='English'"><b><u>1.1.3 Post-16 Leavers:by gender and age</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>1.1.3 Pobl ifanc 16+ sy'n gadael ysgol: yn ôl rhyw ac oedran</u></b></xsl:if>
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0">
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Age</th><th>Date of Birth</th>
						<th>Boys</th><th>Girls</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Oedran</th><th>Dyddiad Geni</th>
						<th>Bechgyn</th><th>Merched</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<td>19 or over</td>
						<td>31/8/87 or earlier</td>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<td>19 neu'n hŷn</td>
						<td>31/8/87 neu cyn hynny</td>
					</xsl:if>
					<td><xsl:value-of select="count(//Leavers/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='M'] )" /></td>
					<td><xsl:value-of select="count(//Leavers/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and Gender='F'] )" /></td>				
				</tr>
				<tr>
					<td>18</td>
					<td>1/9/87 - 31/8/88</td>
					<td><xsl:value-of select="count(//Leavers/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='M'] )" /></td>
					<td><xsl:value-of select="count(//Leavers/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and Gender='F'] )" /></td>				
				</tr>
				<tr>
					<td>17</td>
					<td>1/9/88 - 31/8/89</td>
					<td><xsl:value-of select="count(//Leavers/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='M'] )" /></td>
					<td><xsl:value-of select="count(//Leavers/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and Gender='F'] )" /></td>				
				</tr>
				<tr>
					<td>16</td>
					<td>1/9/89 - 31/8/90</td>
					<td><xsl:value-of select="count(//Leavers/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='M'] )" /></td>
					<td><xsl:value-of select="count(//Leavers/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and Gender='F'] )" /></td>				
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td colspan="2"><b>All ages</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td colspan="2"><b>Pob oed</b></td></xsl:if>
					<td><b><xsl:value-of select="count(//Leavers/Pupil[Gender='M'])" /></b></td>
					<td><b><xsl:value-of select="count(//Leavers/Pupil[Gender='F'])" /></b></td>				
				</tr>
			</table>
		</P> 
		
		<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>1.2 Total number of full-time pupils present on Census day </u> =  </b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>1.2 Nifer y disgyblion yn bresennol yn yr ysgol ar ddiwrnod y cyfrif </u> =  </b></xsl:if>
			<xsl:value-of select="//SchoolSurvey/FullTimeAttendanceCensusDay"/>
			<br/><br/>
		
			<xsl:if test = "$lang='English'"><b><u>1.3.1 Teaching groups / Classes and Pupils as taught</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>1.3.1 Grwpiau / Dosbarthiadau Addysgu a disgyblion fel y'u haddysgir</u></b></xsl:if>
			<br/><br/>
			
			<table border="1" cellpadding="7"  cellspacing="0" width="50%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th width="20%">Year Group</th><th width="20%">Number of teaching groups / classes</th><th width="25%">Number of pupils</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th width="20%">Grwp Blwyddyn</th><th width="20%">Nifer y grwpiau / dosbarthiadau dysgu</th><th width="25%">Nifer y disgyblion</th>
					</xsl:if>
				</tr>
				<tr>
					<td>7</td>
					<td><xsl:value-of select="count(//SchoolSurvey/Classes/Class[YearGroup=7])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual=7])"/></td>
				</tr>
				<tr>
					<td>8</td>
					<td><xsl:value-of select="count(//SchoolSurvey/Classes/Class[YearGroup=8])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual=8])"/></td>
				</tr>
				<tr>
					<td>9</td>
					<td><xsl:value-of select="count(//SchoolSurvey/Classes/Class[YearGroup=9])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual=9])"/></td>
				</tr>
				<tr>
					<td>10</td>
					<td><xsl:value-of select="count(//SchoolSurvey/Classes/Class[YearGroup=10])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual=10])"/></td>
				</tr>
				<tr>
					<td>11</td>
					<td><xsl:value-of select="count(//SchoolSurvey/Classes/Class[YearGroup=11])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual=11])"/></td>
				</tr>
				<tr>
					<td>12</td>
					<td><xsl:value-of select="count(//SchoolSurvey/Classes/Class[YearGroup=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual=12])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>13 and above</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>13 ac uwch</td></xsl:if>
					<td><xsl:value-of select="count(//SchoolSurvey/Classes/Class[YearGroup &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual &gt; 12])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="count(//SchoolSurvey/Classes/Class[YearGroup &gt;= 7])"/></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[NCyearActual &gt;= 7])"/></b></td>
				</tr>
			</table>
			<br/>
				<xsl:if test = "$lang='English'"><b>1.3.2 Total number of teachers present in the school but not teaching in the classroom = </b></xsl:if>
				<xsl:if test = "$lang='Welsh'"><b>1.3.2 Nifer yr athrawon a oedd yn bresennol yn yr ysgol ond heb fod yn addysgu yn y dosbarth = </b></xsl:if>
				<xsl:value-of select="//SchoolSurvey/NotTeaching"/>
			<br/><br/>
				<xsl:if test = "$lang='English'"><b><u>1.4 Pupils' national identity</u></b></xsl:if>
				<xsl:if test = "$lang='Welsh'"><b><u>1.4 Hunaniaeth Genedlaethol y disgyblion</u></b></xsl:if>
				<br/><br/>				
			<table border="1" cellpadding="7"  cellspacing="0">
				<tr>
					<xsl:if test = "$lang='English'"><th>Nationality</th><th>Number of pupils</th></xsl:if>
					<xsl:if test = "$lang='Welsh'"><th>Hunananiaeth Genedlaethol</th><th>Nifer y disgybion </th></xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Welsh</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cymreig</td></xsl:if>				 
					<td><xsl:value-of select="count(//Pupils/Pupil[NationalIdentity='WAL'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>English</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Saesnig</td></xsl:if>				 
					<td><xsl:value-of select="count(//Pupils/Pupil[NationalIdentity='ENG'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Scottish </td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Albanaidd</td></xsl:if>				 
					<td><xsl:value-of select="count(//Pupils/Pupil[NationalIdentity='SCO'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Irish </td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Gwyddelig</td></xsl:if>				 
					<td><xsl:value-of select="count(//Pupils/Pupil[NationalIdentity='IRE'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>British</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Prydeinig</td></xsl:if>				 
					<td><xsl:value-of select="count(//Pupils/Pupil[NationalIdentity='BRI'])"/></td>
				</tr>				
				<tr>
					<xsl:if test = "$lang='English'"><td>Other</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Arall</td></xsl:if>				 
					<td><xsl:value-of select="count(//Pupils/Pupil[NationalIdentity='OTH'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Parent/pupil preferred not to say</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Rhiant/disgybl yn ffafrio peidio cofnodi'r gwybodaeth</td></xsl:if>				 
					<td><xsl:value-of select="count(//Pupils/Pupil[NationalIdentity='REF'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Information not yet obtained</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Dim gwybodaeth hyd yn hyn</td></xsl:if>	
					<td><xsl:value-of select="count(//Pupils/Pupil[NationalIdentity='NOS'])"/></td>			 
				</tr>
			</table>
	</P> 
		
		<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>1.5 Pupils' ethnicity</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>1.5 Cefndir ethnig y disgyblion</u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="5"  cellspacing="0">
				<tr>
					<xsl:if test = "$lang='English'"><th>Ethnic group</th><th>Number of pupils</th></xsl:if>
					<xsl:if test = "$lang='Welsh'"><th>Grwp ethnig (Categoriau NEWYDD)</th><th>Nifer y disgybion </th></xsl:if>
				</tr>	
				
			<!--<xsl:for-each select="document('.\PLASC07-Lookups.xsl')/xsl:stylesheet/Ethnicity:row/@code">
				<xsl:variable name="code" select="."/>
				<xsl:variable name="description" select="../../Ethnicity:row[@code=$code]/@description"/>
				<tr>
					<td><xsl:value-of select="$description"/></td>
					<td><xsl:value-of select="count($rootelement/SchoolSurvey/Pupils/Pupil[Ethnicity=$code])"/></td>					
				</tr>
			</xsl:for-each>-->
			<xsl:for-each select = "//Pupils/Pupil/Ethnicity">
					<xsl:sort order = "ascending" />
					<xsl:if test="generate-id(.) = generate-id(key('kEthnicity', .)[1])">
						<xsl:variable name="Ethnicity" select="."/>
					<tr>
						<td><xsl:value-of select="document('.\PLASC07-Lookups.xsl')/xsl:stylesheet/Ethnicity:row[@code=$Ethnicity]/@description"/></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 5 and Ethnicity = $Ethnicity ])" /></td>
					</tr>
					</xsl:if>			
			</xsl:for-each>			 
			</table>
			</P>
			
		<P CLASS="breakhere"> 
			<xsl:if test = "$lang='English'"><b><u>2.1 Experience of work during the 2005/2006 academic year</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.1 Profiad gwaith yn ystod y flwyddyn academaidd 2005/2006 </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="5"  cellspacing="0" width="70%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2">Experience on</th><th colspan="2">Year 10</th><th colspan="2">Year 11</th><th colspan="2">Year 12</th>
						<th colspan="2">Year 13</th><th colspan="2">Year 14</th><th colspan="2">Total</th><th colspan="2" width="15%">Of whom,pupils with statements of SEN</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2">Profiad yn </th><th colspan="2">Blwyddyn 10</th><th colspan="2">Blwyddyn 11</th><th colspan="2">Blwyddyn 12</th>
						<th colspan="2">Blwyddyn 13</th><th colspan="2">Blwyddyn 14</th><th colspan="2">Cyf-answm</th><th colspan="2" width="15%">O'r rheini, y nifer a datganiad o AAA </th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Boys</th><th>Girls</th><th>Boys</th><th>Girls</th><th>Boys</th><th>Girls</th>
						<th>Boys</th><th>Girls</th><th>Boys</th><th>Girls</th><th>Boys</th><th>Girls</th><th>Boys</th><th>Girls</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Bechgyn</th><th>Merched</th><th>Bechgyn</th><th>Merched</th><th>Bechgyn</th><th>Merched</th>
						<th>Bechgyn</th><th>Merched</th><th>Bechgyn</th><th>Merched</th><th>Bechgyn</th><th>Merched</th><th>Bechgyn</th><th>Merched</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Employers' Premises</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Adeiladau'r cyflogwyr</td></xsl:if>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='M' and ../NCyearActual=10])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='F' and ../NCyearActual=10])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='M' and ../NCyearActual=11])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='F' and ../NCyearActual=11])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='M' and ../NCyearActual=13])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='F' and ../NCyearActual=13])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='M' and ../NCyearActual=14])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='F' and ../NCyearActual=14])"/></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='M'])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='E' and ../Gender='F'])"/></b></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperienceSENPupils[../WorkExperienceCategory='E' and ../Gender='M' and (../NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperienceSENPupils[../WorkExperienceCategory='E' and ../Gender='F' and (../NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>School or College Premises</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Adeiladau'r Ysgol neu'r Coleg</td></xsl:if>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='M' and ../NCyearActual=10])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='F' and ../NCyearActual=10])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='M' and ../NCyearActual=11])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='F' and ../NCyearActual=11])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='M' and ../NCyearActual=13])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='F' and ../NCyearActual=13])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='M' and ../NCyearActual=14])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='F' and ../NCyearActual=14])"/></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='M'])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='S' and ../Gender='F'])"/></b></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperienceSENPupils[../WorkExperienceCategory='S' and ../Gender='M' and (../NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperienceSENPupils[../WorkExperienceCategory='S' and ../Gender='F' and (../NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Both</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cyflogwyr ac Ysgol neu Coleg</td></xsl:if>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='M' and ../NCyearActual=10])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='F' and ../NCyearActual=10])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='M' and ../NCyearActual=11])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='F' and ../NCyearActual=11])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='M' and ../NCyearActual=13])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='F' and ../NCyearActual=13])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='M' and ../NCyearActual=14])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='F' and ../NCyearActual=14])"/></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='M'])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../WorkExperienceCategory='B' and ../Gender='F'])"/></b></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperienceSENPupils[../WorkExperienceCategory='B' and ../Gender='M' and (../NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)])"/></td>
					<td><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperienceSENPupils[../WorkExperienceCategory='B' and ../Gender='F' and (../NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='M' and ../NCyearActual=10])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='F' and ../NCyearActual=10])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='M' and ../NCyearActual=11])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='F' and ../NCyearActual=11])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='M' and ../NCyearActual=12])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='F' and ../NCyearActual=12])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='M' and ../NCyearActual=13])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='F' and ../NCyearActual=13])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='M' and ../NCyearActual=14])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='F' and ../NCyearActual=14])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='M'])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperiencePupils[../Gender='F'])"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperienceSENPupils[../Gender='M' and (../NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)] )"/></b></td>
					<td><b><xsl:value-of select="sum(//WorkExperience/CategoryDetails/WorkExperienceSENPupils[../Gender='F' and (../NCyearActual=10 or NCyearActual=11 or NCyearActual=12 or NCyearActual=13)])"/></b></td>
				</tr>
			</table>
		</P>
		
	<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>2.2 Number of pupils by learning activity type,gender and age group</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.2 Nifer y disgyblion yn ôl cwrs astudiaeth, rhyw ac oedran </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="80%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="3" width="40%">Learning activity type</th><th colspan="6" width="40%">Count of pupils</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="3">Learning activity type</th><th colspan="6" width="40%">Cyfrif o weithgareddau dysgu</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th colspan="3">Year 12</th><th colspan="3">Year 13 and above</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th colspan="3">Blwyddyn 12</th><th colspan="3">Blwyddyn13 ac yn uwch</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Boys</th><th>Girls</th><th>Total</th>
						<th>Boys</th><th>Girls</th><th>Total</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>GCE A levels</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>TAG Safonau Uwch</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='321'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='321'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='321'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='321'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='321'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='321'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>GCE AS level</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>TAG Safonau Uwch Atodol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='320'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='320'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='320'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='320'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='320'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='320'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Advanced VCE (Double award)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>VCE Uwch (Dyfarniad Dwbl)</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='332'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='332'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='332'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='332'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='332'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='332'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Advanced VCE</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>VCE Uwch</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='331'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='331'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='331'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='331'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='331'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='331'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Advanced Subsidiary VCE</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>VCE Uwch Gyfrannol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='330'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='330'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='330'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='330'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='330'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='330'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Intermediate GNVQ (Full)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>GNVQ Canolradd(Llawn)</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='352'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='352'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='352'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='352'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='352'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='352'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Intermediate GNVQ (Part 1)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>GNVQ Canolradd (Rhan 1)</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='353'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='353'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='353'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='353'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='353'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='353'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>GCSEs</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Arholiadau TGAU</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='310' or substring(LearningActivityReference,1,3)='311' or substring(LearningActivityReference,1,3)='312'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='310' or substring(LearningActivityReference,1,3)='311' or substring(LearningActivityReference,1,3)='312'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='310' or substring(LearningActivityReference,1,3)='311' or substring(LearningActivityReference,1,3)='312'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='310' or substring(LearningActivityReference,1,3)='311' or substring(LearningActivityReference,1,3)='312'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='310' or substring(LearningActivityReference,1,3)='311' or substring(LearningActivityReference,1,3)='312'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='310' or substring(LearningActivityReference,1,3)='311' or substring(LearningActivityReference,1,3)='312'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Foundation GNVQ (Full)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>GNVQ Sylfaen (Llawn)</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='350'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='350'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='350'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='350'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='350'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='350'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Foundation GNVQ (Part1)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>GNVQ Sylfaen (Rhan 1) </td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='351'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='351'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='351'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='351'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='351'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='351'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Key Skills Unit</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Uned Sgiliau Allweddol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='340'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='340'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='340'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='340'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='340'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='340'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Free standing maths qualifications</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cymwysterau mathemateg annibynnol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='360'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='360'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='360'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='360'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='360'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='360'] and NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Other</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Arall</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='490'] and NCyearActual=12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='490'] and NCyearActual=12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='490'] and NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='490'] and NCyearActual &gt;12 and Gender='M'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='490'] and NCyearActual &gt; 12 and Gender='F'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[descendant::LearningActivity[substring(LearningActivityReference,1,3)='490'] and NCyearActual &gt; 12])"/></b></td>
				</tr>				
			</table>
			
		</P> 
		
			<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>2.3 Learning activity of pupils in years 12 or above : aggregate</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.3  Cyrsiau astudio disgyblion 16 oed a throsodd ym mlwyddyn 12 neu'n uwch: agregedig </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="80%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="3" width="40%">Learning activity type</th><th colspan="6" width="40%">Count of learning activities</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="3">Learning activity type</th><th colspan="6" width="40%">Cyfrif o weithgareddau dysgu</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th colspan="3">Year 12</th><th colspan="3">Year 13 and above</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th colspan="3">Blwyddyn 12</th><th colspan="3">Blwyddyn13 ac yn uwch</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Boys</th><th>Girls</th><th>Total</th>
						<th>Boys</th><th>Girls</th><th>Total</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>GCE A levels</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>TAG Safonau Uwch</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '321' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '321' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '321' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '321' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '321' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '321' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>GCE AS level</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>TAG Safonau Uwch Atodol</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '320' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '320' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '320' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '320' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '320' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '320' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Advanced VCE (Double award)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>VCE Uwch (Dyfarniad Dwbl)</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '332' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '332' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '332' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '332' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '332' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '332' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Advanced VCE</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>VCE Uwch</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '331' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '331' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '331' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '331' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '331' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '331' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Advanced Subsidiary VCE</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>VCE Uwch Gyfrannol</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '330' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '330' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '330' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '330' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '330' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '330' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Intermediate GNVQ (Full)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>GNVQ Canolradd(Llawn)</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '352' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '352' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '352' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '352' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '352' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '352' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Intermediate GNVQ (Part 1)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>GNVQ Canolradd (Rhan 1)</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '353' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '353' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '353' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '353' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '353' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '353' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>GCSEs</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Arholiadau TGAU</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[(substring(LearningActivityReference, 1, 3) = '310' or substring(LearningActivityReference, 1, 3) = '311' or substring(LearningActivityReference, 1, 3) = '312') and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[(substring(LearningActivityReference, 1, 3) = '310' or substring(LearningActivityReference, 1, 3) = '311' or substring(LearningActivityReference, 1, 3) = '312') and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[(substring(LearningActivityReference, 1, 3) = '310' or substring(LearningActivityReference, 1, 3) = '311' or substring(LearningActivityReference, 1, 3) = '312') and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[(substring(LearningActivityReference, 1, 3) = '310' or substring(LearningActivityReference, 1, 3) = '311' or substring(LearningActivityReference, 1, 3) = '312') and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[(substring(LearningActivityReference, 1, 3) = '310' or substring(LearningActivityReference, 1, 3) = '311' or substring(LearningActivityReference, 1, 3) = '312') and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[(substring(LearningActivityReference, 1, 3) = '310' or substring(LearningActivityReference, 1, 3) = '311' or substring(LearningActivityReference, 1, 3) = '312') and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Foundation GNVQ (Full)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>GNVQ Sylfaen (Llawn)</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '350' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '350' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '350' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '350' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '350' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '350' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Foundation GNVQ (Part1)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>GNVQ Sylfaen (Rhan 1) </td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '351' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '351' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '351' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '351' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '351' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '351' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Key Skills Unit</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Uned Sgiliau Allweddol</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '340' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '340' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '340' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '340' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '340' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '340' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Free standing maths qualifications</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cymwysterau mathemateg annibynnol</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '360' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '360' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '360' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '360' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '360' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '360' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Other</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Arall</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '490' and ../Gender='M' and ../NCyearActual='12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '490' and ../Gender='F' and ../NCyearActual='12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '490' and ../NCyearActual='12'])" /></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '490' and ../Gender='M' and ../NCyearActual &gt; '12'])" /></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '490' and ../Gender='F' and ../NCyearActual &gt; '12'])" /></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[substring(LearningActivityReference, 1, 3) = '490' and ../NCyearActual &gt; '12'])" /></b></td>
				</tr>		
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total number of learning activities</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm nifer y gweithgareddau dysgu</b></td></xsl:if>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='M' and ../NCyearActual='12'])" /></b></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='F' and ../NCyearActual='12'])" /></b></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../NCyearActual='12'])" /></b></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='M' and ../NCyearActual &gt; '12'])" /></b></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='F' and ../NCyearActual &gt; '12'])" /></b></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../NCyearActual &gt; '12'])" /></b></td>
				</tr>			
			</table>
		</P> 
		
	<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>2.4 Courses of study of pupils in year 12 or above : detailed</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.4 Cwrs astudiaeth disgyblion ym mlwyddyn 12 neu'n yn uwch </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="80%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2" width="40%" colspan="3">Learning activity </th><th colspan="6" width="40%">Count of learning activities</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2" width="40%" colspan="3">Learning activity </th><th colspan="6" width="40%">Cyfrif o weithgareddau dysgu</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">						
						<th colspan="3">Year 12</th><th colspan="3">Year 13 and above</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th colspan="3">Blwyddyn 12</th><th colspan="3">Blwyddyn13 ac yn uwch</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Reference</th><th>Subject</th><th>Level</th>
						<th>Boys</th><th>Girls</th><th>Total</th>
						<th>Boys</th><th>Girls</th><th>Total</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Reference</th><th>Subject</th><th>Level</th>
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
					</xsl:if>
				</tr>	
							
				<xsl:for-each select = "//Pupils/Pupil/LearningActivity/LearningActivityReference">
					<xsl:sort order = "ascending" />
					<xsl:if test="generate-id(.) = generate-id(key('kLearningActivityRef', .)[1])">
						<xsl:variable name="LearningActivityReference" select="."/>
					<tr>
						<td><xsl:value-of select="$LearningActivityReference"/></td>						
						<td><xsl:value-of select="document('.\PLASC07-Lookups.xsl')/xsl:stylesheet/LearningActivityRef:row[@REFERENCE=$LearningActivityReference]/@SUBJECT"/></td>
						<td><xsl:value-of select="document('.\PLASC07-Lookups.xsl')/xsl:stylesheet/LearningActivityRef:row[@REFERENCE=$LearningActivityReference]/@LEVEL"/></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='M' and ../NCyearActual ='12' and LearningActivityReference = $LearningActivityReference ])" /></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='F' and ../NCyearActual ='12' and LearningActivityReference = $LearningActivityReference ])" /></td>
						<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../NCyearActual ='12' and LearningActivityReference = $LearningActivityReference ])" /></b></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='M' and ../NCyearActual &gt; '12' and LearningActivityReference = $LearningActivityReference ])" /></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='F' and ../NCyearActual &gt; '12' and LearningActivityReference = $LearningActivityReference ])" /></td>
						<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../NCyearActual &gt; '12' and LearningActivityReference = $LearningActivityReference ])" /></b></td>
					</tr>
					</xsl:if>			
			</xsl:for-each>
			
			</table>
			</P> 
			
			<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>2.5 Pupils studying for a Welsh Baccalaureate by gender and year group</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.5 Disgyblion sy'n astudio ar gyfer Bagloriaeth Gymreig yn ôl rhyw a grŵp blwyddyn </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="80%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2" width="40%">Welsh Baccalureate</th><th colspan="3">Boys</th><th colspan="3">Girls</th><th colspan="3">Pupils</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2" width="40%">Y Fagloriaeth Gymreig </th><th colspan="3">Bechgyn</th><th colspan="3">Merched</th><th colspan="3">Disgyblion</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>12</th><th>13+</th><th>Total</th>
						<th>12</th><th>13+</th><th>Total</th>
						<th>12</th><th>13+</th><th>Total</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>12</th><th>13+</th><th>Cyfanswm</th>
						<th>12</th><th>13+</th><th>Cyfanswm</th>
						<th>12</th><th>13+</th><th>Cyfanswm</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Count of Pupils undertaking some learning activities as part of a Welsh Baccalureate</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cyfrif y Disgyblion sy'n ymgymryd â rhai gweithgareddau dysgu fel rhan o'r Fagloriaeth Gymreig</td></xsl:if>
					<td><xsl:value-of select = "count(//Pupils/Pupil[Gender='M' and NCyearActual = 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil[Gender='M' and NCyearActual &gt; 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil[Gender='M' and NCyearActual &gt;= 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil[Gender='F' and NCyearActual = 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil[Gender='F' and NCyearActual &gt; 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil[Gender='F' and NCyearActual &gt;= 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></b></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil[NCyearActual = 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></td>
					<td><xsl:value-of select = "count(//Pupils/Pupil[NCyearActual &gt; 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></td>
					<td><b><xsl:value-of select = "count(//Pupils/Pupil[NCyearActual &gt;= 12 and translate(normalize-space(WelshBaccalaureate),$vLower,$vUpper)='TRUE'])"/></b></td>
				</tr>
			</table>			
			<br/><br/>
			
			<xsl:if test = "$lang='English'"><b><u>2.6 Pupils with learning difficulties and/or disabilities by gender and year group </u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.6 Disgyblion ag anawsterau dysgu a/neu anableddau yn ôl rhyw a grŵp blwyddyn </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2" width="40%"></th><th colspan="3">Boys</th><th colspan="3">Girls</th><th colspan="3">Pupils</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2" width="40%"> </th><th colspan="3">Bechgyn</th><th colspan="3">Merched</th><th colspan="3">Disgyblion</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>12</th><th>13+</th><th>Total</th>
						<th>12</th><th>13+</th><th>Total</th>
						<th>12</th><th>13+</th><th>Total</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>12</th><th>13+</th><th>Cyfanswm</th>
						<th>12</th><th>13+</th><th>Cyfanswm</th>
						<th>12</th><th>13+</th><th>Cyfanswm</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Enrolled on mainstream and discrete learning activities</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Wedi'u cofrestru ar weithgareddau dysgu'r prif ffrwd a rhai ar wahân</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual &gt; 12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual &gt;=12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual &gt; 12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual &gt;=12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual=12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual &gt; 12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[NCyearActual &gt;=12 and (LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1)])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Enrolled on mainstream learning activities only</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Wedi'u cofrestru ar weithgareddau dysgu'r prif ffrwd yn unig</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual &gt;12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual &gt;=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual &gt;12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual &gt;=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[NCyearActual &gt;12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[NCyearActual &gt;=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 2])" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Enrolled on discrete learning activities only</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Wedi'u cofrestru ar weithgareddau dysgu ar wahân yn unig</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual &gt; 12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual &gt;=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual &gt; 12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and NCyearActual &gt;=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and NCyearActual &gt; 12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[NCyearActual &gt;=12 and not(LearningActivity/LLDDLearner = 2 and LearningActivity/LLDDLearner = 1) and LearningActivity/LLDDLearner = 1])" /></b></td>
				</tr>
			</table>
			</P>
			<br/><br/>
			
			<xsl:if test = "$lang='English'"><b><u>2.7 Number of learning activities by medium of delivery, gender and year group</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.7 Nifer y gweithgareddau dysgu yn ôl cyfrwng eu cyflwyno, rhyw a grŵp blwyddyn</u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="3" width="50%">Medium of delivery for learning activity</th><th colspan="6">Count of learning activities</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="3" width="50%">Cyfrwng cyflwyno'r gweithgaredd dysgu </th><th colspan="6">Cyfrif y gweithgareddau dysgu</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th colspan="3">Year 12</th><th colspan="3">Year 13 and above</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th colspan="3">Blwyddyn 12</th><th colspan="3">Blwyddyn 13 ac uwch</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Boys</th><th>Girls</th><th>Total</th>
						<th>Boys</th><th>Girls</th><th>Total</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>English only</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Saesneg yn unig</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='E' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='E' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='E' and ../NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='E' and ../Gender='M' and ../NCyearActual &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='E' and ../Gender='F' and ../NCyearActual &gt; 12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='E' and ../NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Welsh only</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cymraeg yn unig</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='C' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='C' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='C' and ../NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='C' and ../Gender='M' and ../NCyearActual &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='C' and ../Gender='F' and ../NCyearActual &gt; 12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='C' and ../NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Formal Bilingual model</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Model Dwyieithog ffurfiol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='P' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='P' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='P' and ../NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='P' and ../Gender='M' and ../NCyearActual &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='P' and ../Gender='F' and ../NCyearActual &gt; 12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='P' and ../NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Informal Bilingual model</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Model Dwyieithog anffurfiol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='Q' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='Q' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='Q' and ../NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='Q' and ../Gender='M' and ../NCyearActual &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='Q' and ../Gender='F' and ../NCyearActual &gt; 12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='Q' and ../NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Separate language groups in same class</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Grwpiau iaith ar wahân yn yr un dosbarth</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='R' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='R' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='R' and ../NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='R' and ../Gender='M' and ../NCyearActual &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='R' and ../Gender='F' and ../NCyearActual &gt; 12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='R' and ../NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>English tuition, Welsh assessment</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Hyfforddiant yn Saesneg, asesiad yn Gymraeg</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='S' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='S' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='S' and ../NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='S' and ../Gender='M' and ../NCyearActual &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='S' and ../Gender='F' and ../NCyearActual &gt; 12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='S' and ../NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>English tuition, Welsh assessment (with Welsh enrichment component) </td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Hyfforddiant yn Saesneg, asesiad yn Gymraeg (gyda chydran gyfoethogi Gymraeg)</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='T' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='T' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='T' and ../NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='T' and ../Gender='M' and ../NCyearActual &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='T' and ../Gender='F' and ../NCyearActual &gt; 12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='T' and ../NCyearActual &gt; 12])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Oral Welsh, written English</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cymraeg llafar, Saesneg ysgrifenedig</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='U' and ../Gender='M' and ../NCyearActual=12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='U' and ../Gender='F' and ../NCyearActual=12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='U' and ../NCyearActual=12])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='U' and ../Gender='M' and ../NCyearActual &gt; 12])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='U' and ../Gender='F' and ../NCyearActual &gt; 12])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil/LearningActivity[WelshMediumLearningActivity='U' and ../NCyearActual &gt; 12])"/></b></td>
				</tr>
			</table>
			
			
			<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>2.8 Number of learning activities by provider delivering learning, gender and year group</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.8 Nifer y gweithgareddau dysgu yn ôl y darparwr sy'n cyflwyno'r dysgu, rhyw a grŵp blwyddyn</u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="3" width="50%">Name of provider delivering learning</th><th colspan="6">Count of learning activities</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="3" width="50%">Enw'r Darparwr sy'n cyflwyno'r dysgu</th><th colspan="6">Cyfrif y gweithgareddau dysgu</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th colspan="3">Year 12</th><th colspan="3">Year 13 and above</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th colspan="3">Blwyddyn 12</th><th colspan="3">Blwyddyn 13 ac uwch</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Boys</th><th>Girls</th><th>Total</th>
						<th>Boys</th><th>Girls</th><th>Total</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
					</xsl:if>
				</tr>
				<xsl:for-each select = "//Pupils/Pupil/LearningActivity/LearningActivityProvider">
					<xsl:sort order = "ascending" />
					<xsl:if test="generate-id(.) = generate-id(key('kLearningActivityProvider', .)[1])">
						<xsl:variable name="LearningActivityProvider" select="."/>
					<tr>
						<td><xsl:value-of select="document('.\PLASC07-Lookups.xsl')/xsl:stylesheet/LAProvider:row[@CODE=$LearningActivityProvider]/@DESCRIPTION"/></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='M' and ../NCyearActual =12 and LearningActivityProvider = $LearningActivityProvider ])" /></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='F' and ../NCyearActual =12 and LearningActivityProvider = $LearningActivityProvider ])" /></td>
						<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../NCyearActual =12 and LearningActivityProvider = $LearningActivityProvider ])" /></b></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='M' and ../NCyearActual &gt; 12 and LearningActivityProvider = $LearningActivityProvider ])" /></td>
						<td><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../Gender='F' and ../NCyearActual &gt; 12 and LearningActivityProvider = $LearningActivityProvider ])" /></td>
						<td><b><xsl:value-of select = "count(//Pupils/Pupil/LearningActivity[../NCyearActual &gt; 12 and LearningActivityProvider = $LearningActivityProvider ])" /></b></td>
					</tr>
					</xsl:if>			
			</xsl:for-each>
			</table>
			</P>
			
			<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>2.9 Basic skills assessments at start of course</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>2.9 Asesiad sgiliau sylfaenol ar ddechrau cwrs</u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="80%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2" width="50%">Outcome</th><th colspan="3">Literacy</th><th colspan="3">Numeracy</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2" width="50%">Canlyniad</th><th colspan="3">Llythrennedd</th><th colspan="3">Rhifedd</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Boys</th><th>Girls</th><th>Total</th>
						<th>Boys</th><th>Girls</th><th>Total</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
						<th>Bechgyn</th><th>Merched</th><th>Cyfanswm</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Not screened</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Heb eu sgrinio</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart='NS'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart='NS'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart='NS'])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart='NS'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart='NS'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart='NS'])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Not assessed since no basic skills identified through screening</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Heb eu hasesu gan na chafwyd bod anghenion sgiliau sylfaenol wrth sgrinio</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart='NA'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart='NA'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart='NA'])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart='NA'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart='NA'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart='NA'])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Below entry level</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>O dan y lefel mynediad</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart='BE'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart='BE'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart='BE'])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart='BE'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart='BE'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart='BE'])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Entry level 1</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Lefel mynediad 1</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart='E1'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart='E1'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart='E1'])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart='E1'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart='E1'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart='E1'])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Entry level 2</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Lefel mynediad 2</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart='E2'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart='E2'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart='E2'])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart='E2'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart='E2'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart='E2'])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Entry level 3</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Lefel mynediad 3</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart='E3'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart='E3'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart='E3'])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart='E3'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart='E3'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart='E3'])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Level 1</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Lefel 1</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart='L1'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart='L1'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart='L1'])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart='L1'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart='L1'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart='L1'])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Above level 1</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Uwch na lefel 1</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart='L2'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart='L2'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart='L2'])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart='L2'])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart='L2'])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart='L2'])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Not known (e.g. refusals or not assessed despite need)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Ddim yn hysbys (e.e. wedi gwrthod neu heb eu hasesu er gwaetha'r angen)</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart=99])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart=99])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart=99])"/></b></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart=99])"/></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart=99])"/></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart=99])"/></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfLiteracyAtStart])"/></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfLiteracyAtStart])"/></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfLiteracyAtStart])"/></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and BasicSkills/LevelOfNumeracyAtStart])"/></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and BasicSkills/LevelOfNumeracyAtStart])"/></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[BasicSkills/LevelOfNumeracyAtStart])"/></b></td>
				</tr>
			</table>
			</P>  
			
			<P CLASS="breakhere"> 
			<xsl:if test = "$lang='English'"><b><u>3.1 Teaching staff</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>3.1 Staff addysgu</u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="90%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2" width="40%"></th><th colspan="2">Full-time staff</th><th colspan="4">Part time staff</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2" width="40%"></th><th colspan="2">Staff amser-llawn</th><th colspan="4">Staff rhan-amser</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Men</th><th>Women</th>
						<th>Men</th><th width="10%">Total directed hours per week</th><th>Women</th><th width="10%">Total directed hours per week</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Dynion</th><th>Menywod</th>
						<th>Dynion</th><th width="10%">Cyfanswm oriau o dan gyfarwyddyd</th><th>Menywod</th><th width="10%">Cyfanswm oriau o dan gyfarwyddyd</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Head or acting head teacher</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Pennaeth neu bennaeth gweithredol</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='HT' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='HT' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='HT' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='HT' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='HT' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='HT' and ../Gender='F' and ../Tenure='P'])"/></td>					
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Deputy head</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Dirprwy bennaeth</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='DH' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='DH' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='DH' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='DH' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='DH' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='DH' and ../Gender='F' and ../Tenure='P'])"/></td>					
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Other qualified teachers</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Athrawon cymwysedig eraill</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='QT' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='QT' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='QT' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='QT' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='QT' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='QT' and ../Gender='F' and ../Tenure='P'])"/></td>					
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Number of unqualified (e.g. students) teachers or instructors</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Nifer yr athrawon neu hyfforddwyr anghymwysedig (ee myfyrwyr)</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='NQ' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='NQ' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='NQ' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='NQ' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='NQ' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='NQ' and ../Gender='F' and ../Tenure='P'])"/></td>					
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Peripatetic teachers in school on the enumeration date</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Athrawon peripatetig yn yr ysgol ar y dyddiad cyfrif</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='PT' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='PT' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='PT' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='PT' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='PT' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='PT' and ../Gender='F' and ../Tenure='P'])"/></td>					
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Foreign language assistants</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cynorthwywyr ieithoedd tramor</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='FA' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='FA' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='FA' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='FA' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../TeacherCategory='FA' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../TeacherCategory='FA' and ../Gender='F' and ../Tenure='P'])"/></td>					
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../Gender='M' and ../Tenure='F'])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../Gender='F' and ../Tenure='F'])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../Gender='M' and ../Tenure='P'])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../Gender='M' and ../Tenure='P'])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/Headcount[../Gender='F' and ../Tenure='P'])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/PartTimeHours[../Gender='F' and ../Tenure='P'])"/></b></td>
				</tr>
			</table>
			<br/><br/>
			
			
			<xsl:if test = "$lang='English'"><b><u>3.2 Qualified teachers on contracts of one year or less</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>3.2 Athrawon cymwysedig sydd ar gontractau o un flwyddyn neu lai</u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2" width="30%"></th><th rowspan="2">Number of full-time teachers</th><th colspan="2">Part-time teachers</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2" width="30%"></th><th rowspan="2">Nifer yr athrawon llawn-amser</th><th colspan="2">Athrawon rhan-amser</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Number of teachers</th><th>Hours per week</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Nifer yr athrawon</th><th>Oriau yr wythnos</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Men</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Dynion</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContracts[../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContracts[../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContractsPartTimeHours[../Gender='M' and ../Tenure='P'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Women</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Menywod</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContracts[../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContracts[../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContractsPartTimeHours[../Gender='F' and ../Tenure='P'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Total</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cyfanswm</td></xsl:if>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContracts[../Tenure='F'])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContracts[../Tenure='P'])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/Teachers/CategoryDetails/TeacherContractsPartTimeHours[../Tenure='P'])"/></b></td>
				</tr>				
			</table>
			</P> 
			
			<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>3.3 Qualified to teach Welsh but not doing so</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>3.3 Cymwys i addysgu Cymraeg ond ddim yn ei </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0">
				<tr>
					<xsl:if test = "$lang='English'">
						<th></th><th>Full-time teachers</th><th>Part-time teachers</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th></th><th>Nifer yr athrawon llawn-amser</th><th>Athrawon rhan-amser</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Men</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Dynion</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='NW' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='NW' and ../Gender='M' and ../Tenure='P'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Women</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Menywod</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='NW' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='NW' and ../Gender='F' and ../Tenure='P'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Total</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Cyfanswm</td></xsl:if>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='NW' and ../Tenure='F'])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='NW' and ../Tenure='P'])"/></b></td>
				</tr>				
			</table>
			<br/><br/>
			
			<xsl:if test = "$lang='English'"><b><u>3.4 Teachers teaching Welsh</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>3.4 Athrawon sy'n addysgu Cymraeg </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="90%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2" width="35%"></th><th colspan="4" width="30%">Full-time</th><th colspan="4" width="30%">Part-time</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2" width="35%"></th><th colspan="4">Athrawon amser-llawn</th><th colspan="4">Athrawon rhan-amser</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>Men</th><th>Hours per week</th><th>Women</th><th>Hours per week</th>
						<th>Men</th><th>Hours per week</th><th>Women</th><th>Hours per week</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Dynion</th><th>Oriau yr wythnos</th><th>Menywod</th><th>Oriau yr wythnos</th>
					</xsl:if>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Teaching Welsh as a first language</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Yn addysgu drwy gyfrwng y Gymraeg</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TC' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TC' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TC' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TC' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TC' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TC' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TC' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TC' and ../Gender='F' and ../Tenure='P'])"/></td>
				</tr> 
				<tr>
					<xsl:if test = "$lang='English'"><td>Teaching Welsh as a second language only</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Yn addysgu Cymraeg fel ail iaith yn unig</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TW' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TW' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TW' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TW' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TW' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TW' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TW' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TW' and ../Gender='F' and ../Tenure='P'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Teaching other subjects through the medium of Welsh</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Yn addysgu pynciau eraill drwy gyfrwmg y Gymraeg</td></xsl:if>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TO' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TO' and ../Gender='M' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TO' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TO' and ../Gender='F' and ../Tenure='F'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TO' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TO' and ../Gender='M' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../TeachingWelshCategory='TO' and ../Gender='F' and ../Tenure='P'])"/></td>
					<td><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../TeachingWelshCategory='TO' and ../Gender='F' and ../Tenure='P'])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../Gender='M' and ../Tenure='F' and(../TeachingWelshCategory='TO' or ../TeachingWelshCategory='TW' or ../TeachingWelshCategory='TC')])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../Gender='M' and ../Tenure='F' and(../TeachingWelshCategory='TO' or ../TeachingWelshCategory='TW' or ../TeachingWelshCategory='TC')])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../Gender='F' and ../Tenure='F' and(../TeachingWelshCategory='TO' or ../TeachingWelshCategory='TW' or ../TeachingWelshCategory='TC')])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../Gender='F' and ../Tenure='F' and(../TeachingWelshCategory='TO' or ../TeachingWelshCategory='TW' or ../TeachingWelshCategory='TC')])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../Gender='M' and ../Tenure='P' and(../TeachingWelshCategory='TO' or ../TeachingWelshCategory='TW' or ../TeachingWelshCategory='TC')])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../Gender='M' and ../Tenure='P' and(../TeachingWelshCategory='TO' or ../TeachingWelshCategory='TW' or ../TeachingWelshCategory='TC')])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/Headcount[../Gender='F' and ../Tenure='P' and(../TeachingWelshCategory='TO' or ../TeachingWelshCategory='TW' or ../TeachingWelshCategory='TC')])"/></b></td>
					<td><b><xsl:value-of select="sum(//SchoolSurvey/WelshTeachers/CategoryDetails/TeachingWelshHours[../Gender='F' and ../Tenure='P' and(../TeachingWelshCategory='TO' or ../TeachingWelshCategory='TW' or ../TeachingWelshCategory='TC')])"/></b></td>
				</tr>
			</table>
		</P> 
			
			<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>3.5 Non-teaching staff / Education support staff</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>3.5 Staff heblaw'r staff addysgu / Staff cymorth addysg </u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="90%">
			<tr>
				<xsl:if test = "$lang='English'">
					<th rowspan="2" width="50%"></th><th rowspan="2" width="15%">Number of full-time staff</th><th colspan="2" width="30%">Part-time staff</th>
				</xsl:if>
				<xsl:if test = "$lang='Welsh'">
					<th rowspan="2" width="50%"></th><th rowspan="2" width="15%">Nifer y staff amser-llawn</th><th colspan="2" width="30%">Staff rhan-amser</th>
				</xsl:if>				
			</tr>
			<tr>
				<xsl:if test = "$lang='English'">
					<th width="15%">Number of staff</th><th width="15%">Hours per week</th>
				</xsl:if>
				<xsl:if test = "$lang='Welsh'">
					<th width="15%">Nifer y staff</th><th width="15%">Oriau yr wythnos</th>
				</xsl:if>
			</tr>			
			<tr>
				<xsl:if test = "$lang='English'"><td>Special Needs Support Staff (including ancillary sessional workers)</td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td>Staff Cymorth Anghenion Arbennig (gan gynnwys gweithwyr sesiynol ategol)</td></xsl:if>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='SN' and ../Tenure='F'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='SN' and ../Tenure='P'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/PartTimeHours[../SupportCategory='SN' and ../Tenure='P'])"/></td>
			</tr>		
			<tr>
				<xsl:if test = "$lang='English'"><td>Laboratory or workshop technicians</td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td>Technegwyr labordy neu weithdy</td></xsl:if>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='TE' and ../Tenure='F'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='TE' and ../Tenure='P'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/PartTimeHours[../SupportCategory='TE' and ../Tenure='P'])"/></td>
			</tr>		
			<tr>
				<xsl:if test = "$lang='English'"><td>Resource technicians</td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td>Technegwyr adnoddau</td></xsl:if>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='RT' and ../Tenure='F'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='RT' and ../Tenure='P'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/PartTimeHours[../SupportCategory='RT' and ../Tenure='P'])"/></td>
			</tr>		

			<tr>
				<xsl:if test = "$lang='English'"><td>Nurses / matrons (including NHS employees)</td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td>Nyrsys / metronau (gan gynnwys gweithwyr yr NHS)</td></xsl:if>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='ME' and ../Tenure='F'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='ME' and ../Tenure='P'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/PartTimeHours[../SupportCategory='ME' and ../Tenure='P'])"/></td>
			</tr>		
			<tr>
				<xsl:if test = "$lang='English'"><td>Office or clerical staff including library assistants</td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td>Staff swyddfa neu staff clerigol gan gynnwys cynorthwywyr llyfrgell</td></xsl:if>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='AC' and ../Tenure='F'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../SupportCategory='AC' and ../Tenure='P'])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/PartTimeHours[../SupportCategory='AC' and ../Tenure='P'])"/></td>
			</tr>		
			<tr>
				<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
				<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm</b></td></xsl:if>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../Tenure='F' and(../SupportCategory='SN' or ../SupportCategory='TE' or ../SupportCategory='RT' or ../SupportCategory='ME' or ../SupportCategory='AC')])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/Headcount[../Tenure='P' and(../SupportCategory='SN' or ../SupportCategory='TE' or ../SupportCategory='RT' or ../SupportCategory='ME' or ../SupportCategory='AC')])"/></td>
				<td><xsl:value-of select="sum(//SupportStaff/CategoryDetails/PartTimeHours[../Tenure='P' and(../SupportCategory='SN' or ../SupportCategory='TE' or ../SupportCategory='RT' or ../SupportCategory='ME' or ../SupportCategory='AC')])"/></td>
			</tr>
			</table>
				<br/><br/>
			
			<xsl:if test = "$lang='English'"><b><u>4.1 Teaching of the Welsh language</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>4.1 Dysgu Cymraeg</u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="80%">
				<tr>
					<xsl:if test = "$lang='English'">
						<th rowspan="2" width="50%">How pupils are taught</th><th colspan="5">Year</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th rowspan="2"  width="50%">Dysgu Cymraeg</th><th colspan="5">Blwyddyn</th>
					</xsl:if>					
				</tr>
				<tr>
					<xsl:if test = "$lang='English'">
						<th>7</th><th>8</th><th>9</th><th>10</th><th>11</th>
					</xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>7</th><th>8</th><th>9</th><th>10</th><th>11</th>
					</xsl:if>		
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Taught Welsh as a first language</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Yn dysgu Cymraeg fel iaith gyntaf</td></xsl:if>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=1 and NCyearActual=7])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=1 and NCyearActual=8])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=1 and NCyearActual=9])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=1 and NCyearActual=10])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=1 and NCyearActual=11])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Taught Welsh as a second language</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Yn dysgu Cymraeg gel ail iaith</td></xsl:if>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=2 and NCyearActual=7])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=2 and NCyearActual=8])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=2 and NCyearActual=9])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=2 and NCyearActual=10])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=2 and NCyearActual=11])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Taught other Welsh course</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Yn dysgu cwrs Cymraeg arall</td></xsl:if>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=3 and NCyearActual=7])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=3 and NCyearActual=8])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=3 and NCyearActual=9])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=3 and NCyearActual=10])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=3 and NCyearActual=11])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Not taught Welsh at all</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Dim yn dysgu Cymraeg o gwbl</td></xsl:if>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=4 and NCyearActual=7])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=4 and NCyearActual=8])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=4 and NCyearActual=9])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=4 and NCyearActual=10])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=4 and NCyearActual=11])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Disapplied from curriculum by SEN statement</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Wedi datgymhwyso o'r cwricwlwm oherwydd datganiad AAA</td></xsl:if>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=5 and NCyearActual=7])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=5 and NCyearActual=8])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=5 and NCyearActual=9])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=5 and NCyearActual=10])"/></td>
					<td><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[StudyWelsh=5 and NCyearActual=11])"/></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[NCyearActual=7])"/></b></td>
					<td><b><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[NCyearActual=8])"/></b></td>
					<td><b><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[NCyearActual=9])"/></b></td>
					<td><b><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[NCyearActual=10])"/></b></td>
					<td><b><xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[NCyearActual=11])"/></b></td>
				</tr>
			</table>
			</P> 
			
			<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>4.2 Home / spoken language</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>4.2 Iaith gartref/lafar</u></b></xsl:if>				 
			<br/><br/>
			<table border="1" cellpadding="7"  cellspacing="0" width="90%">
				<tr>
					 <xsl:if test = "$lang='English'">
						<th>Pupils age at 31.8.2006</th><th>DOB</th><th>Does not speak Welsh at home</th>
						<th>Speak Welsh at home</th><th>Can speak Welsh fluently</th><th>Speaks Welsh but not fluently</th>
						<th>Cannot speak Welsh at all</th>
					 </xsl:if>
					<xsl:if test = "$lang='Welsh'">
						<th>Disgyblion a'u hoedran at 31.08.02</th><th>Dyddiad Geni</th>
						<th>Ddim yn siarad Cymraeg gartref</th><th>Yn siarad Cymraeg adref</th><th>Yn gallu siarad Cymraeg yn rhugl</th>
						<th>Yn gallu siarad Cymraeg ond ddim yn rhugl</th><th>Ddim yn gallu siarad Cymraeg o gwbl</th>
					</xsl:if>
				</tr>
				<tr>
					 <xsl:if test = "$lang='English'"><td>19 or over</td><td>31/8/87 or earlier</td></xsl:if>
					 <xsl:if test = "$lang='Welsh'"><td>19 neu'n hŷn</td><td>31/8/87 neu'n gynt</td></xsl:if>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 18 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>18</td><td>1/9/87 - 31/8/88</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 18 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>17</td><td>1/9/88 - 31/8/89</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 17 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>16</td><td>1/9/89 - 31/8/90</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 16 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>15</td><td>1/9/90 - 31/8/91</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 15 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>14</td><td>1/9/91 - 31/8/92</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 14 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>13</td><td>1/9/92 - 31/8/93</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 13 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>12</td><td>1/9/93 - 31/8/94</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 12 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>11</td><td>1/9/94 - 31/8/95</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 11 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<td>10</td><td>1/9/95 - 31/8/96</td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) = 10 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					 <xsl:if test = "$lang='English'"><td>Less than 10</td><td>1/9/96 or later</td></xsl:if>
					 <xsl:if test = "$lang='Welsh'"><td>Llai na 10</td><td>1/9/96 neu'n ddiweddarach</td></xsl:if>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and HomeWelsh=0] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and HomeWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and SpeakWelsh=1] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and SpeakWelsh=2] )" /></td>
					 <td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 10 and SpeakWelsh=3] )" /></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td colspan="2"><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td colspan="2"><b>Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[HomeWelsh=0])" /></b></td>
					 <td><b><xsl:value-of select="count(//Pupils/Pupil[HomeWelsh=1])" /></b></td>
					 <td><b><xsl:value-of select="count(//Pupils/Pupil[SpeakWelsh=1])" /></b></td>
					 <td><b><xsl:value-of select="count(//Pupils/Pupil[SpeakWelsh=2])" /></b></td>
					 <td><b><xsl:value-of select="count(//Pupils/Pupil[SpeakWelsh=3])" /></b></td>
				</tr>				
			</table>
		</P> 
		
		<P CLASS="breakhere">
			<xsl:if test = "$lang='English'"><b><u>4.3 The number of foundation subjects taught consistently and entirely through the medium of Welsh or bilingually =</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>4.3 Nifer y pynciau sylfaenol a ddysgir drwy gyfrwng y Gymraeg neu'n ddwyieithog =</u></b></xsl:if>				 
			<xsl:value-of select="//SchoolSurvey/WelshMediumSubjects"/>
			<br/><br/>
			
			<xsl:if test = "$lang='English'"><b><u>5.1 School meals</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>5.1 Prydau ysgol</u></b></xsl:if>
				<br/>
				<table border="0" cellpadding="5" cellspacing="0">
					<tr>
						<xsl:if test = "$lang='English'">
							<td>Number of pupils eligible for free school meals	</td>
						</xsl:if>
						<xsl:if test = "$lang='Welsh'">
							<td>Nifer y disgyblion ar y gofrestr sydd a hawl i gael prydau am ddim </td>
						</xsl:if>
						<td> = <xsl:value-of select="count(//SchoolSurvey/Pupils/Pupil[FSMeligible=1 or translate(normalize-space(FSMeligible),$vLower,$vUpper)='TRUE'])"/></td>
					</tr>
					<tr>
						<xsl:if test = "$lang='English'">
							<td>Number of pupils who had a free school meal on Census day </td>
						</xsl:if>
						<xsl:if test = "$lang='Welsh'">						
							<td>Nifer y dsigyblion yn cymryd prydau canol dydd am ddim ar ddiwrnod y cyfrif </td>
						</xsl:if>
							<td> = <xsl:value-of select="(//SchoolSurvey/FreeMeals)"/></td>
					</tr>
				</table>
				 <br/>		
			
			<xsl:if test = "$lang='English'"><b><u>6.1 Pupils with statements of special education needs</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>6.1 Disgyblion a Datganiad o Anghenion Addysgol Arbennig</u></b></xsl:if>				 
			<br/>
			
			<table border="1" cellpadding="7"  cellspacing="0" width="90%">
				<xsl:if test = "$lang='English'">
					<tr>
						<th rowspan="3">Description of major need</th>
						<th colspan="6">Pupils with statements aged (ages as at 31.8.06)</th>
						<th rowspan="2" colspan="2" width="20%">Total number of pupils with statements</th>
					</tr>
					<tr>
						<th colspan="2">Under 11</th><th colspan="2">11 - 15</th><th colspan="2"> 16 and over</th>
					</tr>
					<tr>
							<th>Boys</th><th>Girls</th>	<th>Boys</th><th>Girls</th>
							<th>Boys</th><th>Girls</th>	<th>Boys</th><th>Girls</th>
					</tr>
				</xsl:if>
				<xsl:if test = "$lang='Welsh'">
					<tr>
						<th rowspan="3">Disgrifiad o'r prif angen</th>
						<th colspan="6">Disgyblion a datganiad (oed ar 31.8.06)</th>
						<th rowspan="2" colspan="2" width="20%">Cyfanswm nifer y disgyblion a datganiad</th>
					</tr>
					<tr>
						<th colspan="2">O dan 11 oed</th><th colspan="2">11 - 15</th><th colspan="2">16 a throsodd</th>
					</tr>
					<tr>
							<th>Bechgyn</th><th>Merched</th><th>Bechgyn</th><th>Merched</th>
							<th>Bechgyn</th><th>Merched</th><th>Bechgyn</th><th>Merched</th>
					</tr>
				</xsl:if>
				<tr>
					<xsl:if test = "$lang='English'"><td>Moderate Learning Difficulties</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Anawsterau dysgu cymedrol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MLD' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MLD' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MLD' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Severe Learning Difficulties</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Anawsterau dysgu difrifol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SLD' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SLD' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SLD' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Profound and multiple learning difficulties</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Anawsterau dysgu dwys a lluosog</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='PMLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='PMLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='PMLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='PMLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='PMLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='PMLD' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='PMLD' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='PMLD' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Specific learning difficulties</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Anawsterau dysgu penodol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SPLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SPLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SPLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SPLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SPLD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SPLD' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SPLD' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SPLD' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Autistic Spectrum Disorder</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Afiechyd sbectrwm Awtistiaeth</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='ASD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='ASD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='ASD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='ASD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='ASD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='ASD' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='ASD' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='ASD' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Physical disabilities</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Anableddau corfforol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='PD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='PD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='PD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='PD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='PD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='PD' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='PD' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='PD' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Hearing impairment</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Nam ar y cliw</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='HI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='HI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='HI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='HI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='HI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='HI' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='HI' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='HI' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Visual impairment</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Nam ar y golwg</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='VI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='VI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='VI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='VI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='VI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='VI' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='VI' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='VI' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Multi sensory impairment</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Nam amlsynhwyraidd</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MSI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MSI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MSI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MSI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MSI' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MSI' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MSI' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MSI' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Speech, language and communication difficulties</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Anawsterau lleferydd, iaith  a chyfathrebu</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SLCD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SLCD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SLCD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SLCD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SLCD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SLCD' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='SLCD' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='SLCD' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Emotional and behavioural difficulties</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Anawsterau emosiynol ac ymddygiadol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='EBD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='EBD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='EBD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='EBD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='EBD' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='EBD' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='EBD' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='EBD' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Medical difficulties</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Anawsterau meddygol</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MED' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MED' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MED' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MED' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MED' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MED' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='MED' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='MED' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td>Other</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Arall</td></xsl:if>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='OTH' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='OTH' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='OTH' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='OTH' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='OTH' and SENtypeRank=1]] )" /></td>
					<td><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='OTH' and SENtypeRank=1]] )" /></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtype='OTH' and SENtypeRank=1]] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtype='OTH' and SENtypeRank=1]] )" /></b></td>
				</tr>
				<tr>
					<xsl:if test = "$lang='English'"><td><b>Total</b></td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td><b>Cyfanswm</b></td></xsl:if>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtypeRank=1 and SENtype != 'DNA']] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt; 11 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtypeRank=1 and SENtype != 'DNA']]  )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtypeRank=1 and SENtype != 'DNA']] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[((substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 11 and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &lt;= 15)and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtypeRank=1 and SENtype != 'DNA']] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtypeRank=1 and SENtype != 'DNA']] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[(substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt; 15 and Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtypeRank=1 and SENtype != 'DNA']]  )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and SENstatus='S' and SENneeds/SENneed[SENtypeRank=1 and SENtype != 'DNA']] )" /></b></td>
					<td><b><xsl:value-of select="count(//Pupils/Pupil[Gender='F' and SENstatus='S' and SENneeds/SENneed[SENtypeRank=1 and SENtype != 'DNA']]  )" /></b></td>
				</tr>
				
			</table>
		</P> 
		
		<P CLASS="breakhere"> 
			<table>
				<tr>
					<td><xsl:if test = "$lang='English'">6.1.1 The number of boys aged 15 with a statement of SEN  </xsl:if>
						<xsl:if test = "$lang='Welsh'">6.1.1 Nifer y bechgyn 15 oed gyda datganiad o AAA</xsl:if></td>
						<td><xsl:value-of select="count(//Pupils/Pupil[Gender='M' and (SENstatus='S') and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 15  and SENneeds/SENneed/SENtype ='MLD'])"/></td>
				</tr>
				<tr>
					<td><xsl:if test = "$lang='English'">6.1.2 The number of girls aged 15 with a statement of SEN</xsl:if>
					<xsl:if test = "$lang='Welsh'">6.1.2 Nifer y merched 15 oed gyda datganiad o AAA</xsl:if></td>
					<td> <xsl:value-of select="count(//Pupils/Pupil[Gender='F' and ( SENstatus='S') and (substring($AcademicYear, 1, 4) - substring(DOB, 1, 4 ) - (substring(DOB, 6, 2 ) > $Month)) &gt;= 15  and SENneeds/SENneed/SENtype ='MLD'])"/></td>
				</tr>		
			</table>
			<br/><br/>
				<xsl:if test = "$lang='English'"><b><u>6.2 Number of pupils with special needs but no statement </u></b></xsl:if>
				<xsl:if test = "$lang='Welsh'"><b><u>6.2 Nifer y disgyblion ag Anghenion Addysgol Arbennig ond heb ddatganiad </u></b></xsl:if>
				<br/>
			<table>
				<tr>
					<td><xsl:if test = "$lang='English'">Boys</xsl:if><xsl:if test = "$lang='Welsh'">Bechgyn</xsl:if></td>
					<td> : <xsl:value-of select="count(//Pupils/Pupil[Gender='M' and (SENstatus='A' or SENstatus='P' or SENstatus='Q') and SENneeds/SENneed/SENtype !='DNA'])"/></td>
				</tr>
				<tr>
					<td><xsl:if test = "$lang='English'">Girls</xsl:if><xsl:if test = "$lang='Welsh'">Merched</xsl:if></td>
					<td> : <xsl:value-of select="count(//Pupils/Pupil[Gender='F' and (SENstatus='A' or SENstatus='P' or SENstatus='Q') and SENneeds/SENneed/SENtype !='DNA'])"/></td>
				</tr>
			</table>

				
				<br/><br/>
				<xsl:if test = "$lang='English'"><b><u>6.3 Special classes</u></b></xsl:if>
				<xsl:if test = "$lang='Welsh'"><b><u>6.3 Dosbarthiadau Arbennig</u></b></xsl:if>
				<br/><br/>
				<table>
					<tr>
						<td>
						<xsl:if test = "$lang='English'">Number of LEA designated special classes in the school</xsl:if>	
						<xsl:if test = "$lang='Welsh'">Nifer y dosbarthiadau arbennig yn eich ysgol a ddynodwyd gan yr AALI</xsl:if>
						<td> : <xsl:value-of select="//SchoolSurvey/LEASpecialClass"/></td>
						</td>
					</tr>
					<tr>
						<td>
						<xsl:if test = "$lang='English'">Number of pupils in such classes</xsl:if>	
						<xsl:if test = "$lang='Welsh'">Nifer y disgyblion yn y fath yma o ddosbarthiadau </xsl:if>
						<td> : <xsl:value-of select="//SchoolSurvey/PupilInLEASpecialClass + //SchoolSurvey/PupilOSLEASpecialClass"/></td>
						</td>
					</tr>
					<tr>
						<td>
						<xsl:if test = "$lang='English'">Are any of the pupils entered above on roll at another school</xsl:if>	
						<xsl:if test = "$lang='Welsh'">A yw unrhyw ddisgybl a nodir uchod wedi'I gofrestru mewn ysgol arall?</xsl:if>
						<td>
							<xsl:if test = "//SchoolSurvey/PupilOSLEASpecialClass &gt; 0"> : Y </xsl:if>
							<xsl:if test = "//SchoolSurvey/PupilOSLEASpecialClass &lt;= 0"> : N </xsl:if>
						</td>
						</td>
					</tr>
				</table>
				<br/><br/>
				<xsl:if test = "$lang='English' and (//HeadGovernor) = 1"><b>7.1 Is the Headteacher a member of the school&apos;s governing body? Y </b></xsl:if>
				<xsl:if test = "$lang='Welsh' and (//HeadGovernor) = 1"><b>7.1  A yw'r Pennaeth yn aelod o gorff llywodraethu&apos;r ysgol? Y</b></xsl:if>
				<xsl:if test = "$lang='English' and (//HeadGovernor) = 0"><b>7.1 Is the Headteacher a member of the school&apos;s governing body? N </b></xsl:if>
				<xsl:if test = "$lang='Welsh' and (//HeadGovernor) = 0"><b>7.1  A yw'r Pennaeth yn aelod o gorff llywodraethu&apos;r ysgol? N</b></xsl:if>
				<br/> <br/>			 
			
			
			<xsl:if test = "$lang='English'"><b><u>7.2 Serving governors</u></b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b><u>7.2 Llywodraethwyr sydd mewn swydd</u></b></xsl:if>
			<br/><br/>
			<table border="1" width="90%" cellpadding="7"   cellspacing="0">
				<xsl:if test = "$lang='English'">
					<tr>
						<th width="40%"></th><th width="15%">Male</th><th width="15%">Female</th><th width="15%">Total</th><th width="15%">Of whom Welsh speakers</th>
					</tr>
				</xsl:if>
				<xsl:if test = "$lang='Welsh'">
					<tr>
						<th width="40%"></th><th width="15%">Dynion</th><th width="15%">Menywod</th><th width="15%">Cyfanswm</th><th width="15%">Y nifer ohonynt sy'n siarad Cymraeg</th>
					</tr>
				</xsl:if>
				<tr>
					<xsl:if test = "$lang='English'"><td>Number of serving governors (including headteacher if applicable)</td></xsl:if>
					<xsl:if test = "$lang='Welsh'"><td>Nifer y llywodraethwyr mewn swydd (gan gynnwys y Pennaeth os yw'n lywodraethwr)</td></xsl:if>
					<td><xsl:value-of select="//SchoolSurvey/MaleGovernor"/></td>
					<td><xsl:value-of select="//SchoolSurvey/FemaleGovernor"/></td>
					<td><xsl:value-of select="//SchoolSurvey/MaleGovernor + //SchoolSurvey/FemaleGovernor"/></td>
					<td><xsl:value-of select="//SchoolSurvey/WelshGovernor"/></td>
				</tr>				
			</table>
			<br/><br/>
			
			<xsl:if test = "$lang='English'"><b>7.3 Number of vacancies on the school's governing body = </b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b>7.3 Nifer y swyddi gwag ar gorff llywodraethu'r ysgol = </b></xsl:if>
			<xsl:value-of select="//SchoolSurvey/GovernorVacancy"/>
			<br/><br/>
			<xsl:if test = "$lang='English'"><b>8.1 Number of permanent exclusions in the 2005/06 school year = </b></xsl:if>
			<xsl:if test = "$lang='Welsh'"><b>8.1 Nifer y gwaharddiadau parhaol or ysgol yn y flwyddyn academaidd 2005/06 = </b></xsl:if>
			<xsl:value-of select="count(//SchoolSurvey/Exclusions/Exclusion)"/>
			<br/><br/>
			
			<table>
				<tr>
					<td>
						<xsl:if test = "$lang='English'">Number of unresolved validation errors </xsl:if>
						<xsl:if test = "$lang='Welsh'">Nifer y camgymeriadau dilysu heb ateb </xsl:if>						
					</td>
					<td> = <xsl:value-of select = "substring-before($errors,'/')" /></td>
				</tr>		
				<tr></tr>
				<tr>
					<td>
						<xsl:if test = "$lang='English'">Number of validation queries </xsl:if>
						<xsl:if test = "$lang='Welsh'">Nifer y cwestiynau dilysu </xsl:if>						
					</td>
					<td> = <xsl:value-of select = "substring-after($errors,'/')" /></td>
				</tr>		
			</table>
			<br/><br/>
			<xsl:if test = "$lang='English'">
					This summary relates to the return dated <b><xsl:value-of select ="substring($dateTime,1,2)" />/<xsl:value-of select ="substring($dateTime,4,2)" />/
			<xsl:value-of select ="substring($dateTime,7,4)" /></b> at  <b><xsl:value-of select = "substring-after($dateTime,'#')" /></b><br/><br/><br/>
					DECLARATION<br/><br/>Signature .......................................................................<br/><br/><br/>
					Name  ............................................................................<br/><br/>
					Date  ...............................................................................
			</xsl:if>
			<xsl:if test = "$lang='Welsh'">
					Mae'r crynodeb hwn yn berthnasol i'r wybodaeth yr adroddwyd arni yn ddyddiedig <b><xsl:value-of select ="substring($dateTime,1,2)" />/<xsl:value-of select ="substring($dateTime,4,2)" />/
			<xsl:value-of select ="substring($dateTime,7,4)" /></b> am  <b><xsl:value-of select = "substring-after($dateTime,'#')" /></b><br/><br/><br/>
					DATGANIAD<br/><br/>Llofnod  .......................................................................<br/><br/><br/>
					Enw   ............................................................................<br/><br/>
					Dyddiad  ...............................................................................
			</xsl:if>	
		</P> 	
		<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-899238-2";
urchinTracker();
</script>
</body>
	</html>
</xsl:template>


<!--***										Global Variables											*** -->
	<xsl:variable name="rootelement" select="/Message"/>
	<xsl:variable name="AcademicYear" select="2006"/>
	<xsl:variable name="Month" select="08"/>
	<xsl:variable name="vLower"  select="'abcdefghijklmnopqrstuvwxyz'"/>
	<xsl:variable name="vUpper"  select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
	<xsl:variable name="Sentype" select="' MLD SLD PMLD SPLD ASD PD HI VI MSI SLCD EBD OTH '"/>
</xsl:stylesheet>


			