<?xml version='1.0' encoding='UTF-8'?>
<?altova_samplexml C:\Dev\Invoices\TaxInvoice\XML\taxinvoice.xml?>
<xsl:stylesheet exclude-result-prefixes="msdata n xsi" version="1.0" xmlns:n="http://tempuri.org/taxinvoice.xsd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
	<xsl:output method="html" omit-xml-declaration="no" indent="no" encoding="UTF-8" version="1.0" media-type="text/html"/>
	<xsl:template match="/">
	<html xmlns:n="http://tempuri.org/taxinvoice.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
		<meta content="text/html; charset=UTF-8"/><head/>
		<body style="font-family: times new roman">
			<p>
				<br/>
			</p>
			<p>
				<table width="100%" border="0">
					<tbody>
						<tr width="400">
							<td width="749">
								<table width="100%">
									<tbody>
										<tr>
											<td width="120">
												<span style="font-family: times new roman">Remittances to:</span>
											</td>
											<td>
												<xsl:for-each select="n:TaxInvoices/n:Invoice/n:BankName">
													<span style="font-family: times new roman">
														<xsl:apply-templates/>
													</span>
												</xsl:for-each>
											</td>
										</tr>
										<tr>
											<td width="120">
												<span style="font-family: times new roman">Account Number:</span>
											</td>
											<td>
												<xsl:for-each select="n:TaxInvoices/n:Invoice/n:BankAccountNumber">
													<span style="font-family: times new roman">
														<xsl:apply-templates/>
													</span>
												</xsl:for-each>
											</td>
										</tr>
										<tr>
											<td width="120">
												<span style="font-family: times new roman">TAX INVOICE</span>
											</td>
											<td>
												<xsl:for-each select="n:TaxInvoices/n:Invoice/@No">
													<span style="font-family: times new roman">
														<xsl:value-of select="."/>
													</span>
												</xsl:for-each>
											</td>
										</tr>
									</tbody>
								</table>
							</td>
							<td width="109">
								<img align="right" src="C:\Dev\Invoices\TaxInvoice\Images\fbr-logoRGB copy.gif" border="0" hspace="0"/>
							</td>
						</tr>
					</tbody>
				</table>
			</p>
			<p>
				<table width="100%">
					<tbody>
						<tr>
							<td width="130">
								<span style="font-family: times new roman">Case Reference:</span>
							</td>
							<td>
								<xsl:for-each select="n:TaxInvoices/n:Invoice/n:CaseRef">
									<span style="font-family: times new roman">
										<xsl:apply-templates/>
									</span>
								</xsl:for-each>
							</td>
						</tr>
						<tr>
							<td width="130">
								<span style="font-family: times new roman">Client Number:</span>
							</td>
							<td>
								<xsl:for-each select="n:TaxInvoices/n:Invoice/n:ClientNumber">
									<span style="font-family: times new roman">
										<xsl:apply-templates/>
									</span>
								</xsl:for-each>
							</td>
						</tr>
					</tbody>
				</table>
				<br/>
				<xsl:for-each select="n:TaxInvoices/n:Invoice/n:InvoiceDate">
					<span style="font-family: times new roman">
						<xsl:apply-templates/>
					</span>
				</xsl:for-each>
				<br/>
				<xsl:for-each select="n:TaxInvoices/n:Invoice/n:ClientName">
					<span style="font-family: times new roman">
						<xsl:apply-templates/>
					</span>
				</xsl:for-each>
				<br/>
				<xsl:for-each select="n:TaxInvoices/n:Invoice/n:ClientAttention">
					<span style="font-family: times new roman">
						<xsl:apply-templates/>
					</span>
				</xsl:for-each>
			</p>
			<xsl:for-each select="n:TaxInvoices/n:Invoice/n:ClientAddress">
				<span style="font-family: times new roman">
					<xsl:apply-templates/>
				</span>
			</xsl:for-each>
			<p>
				<table width="100%" border="0">
					<tbody>
						<tr>
							<td>
								<xsl:for-each select="n:TaxInvoices/n:Invoice/n:ReClause">
									<span style="font-family: times new roman">
										<xsl:apply-templates/>
									</span>
								</xsl:for-each>
							</td>
						</tr>
					</tbody>
				</table>
			</p>
			<p>
				<table width="100%">
					<tbody>
						<tr>
							<td style="font-weight: bold" colSpan="96">Professional Fees:</td>
							<td style="font-weight: bold" colSpan="4">Amount</td>
						</tr>
						<xsl:for-each select="n:TaxInvoices/n:Invoice/n:Fees/n:FeeLine" xml:space="">
							<xsl:sort case-order="" select="n:Type" order="ascending"/>
							<xsl:choose>
								<xsl:when test="(n:Type='P' or n:Type='R') and n:Text != 'Total' ">
										<tr>
											<td colSpan="96">
												<xsl:value-of select="n:Text"/>
											</td>
											<td colSpan="4" align="right">
												<xsl:choose>
													<xsl:when test="n:Type='R'">
														<u>
															<xsl:value-of select="n:Total"/>
														</u>
													</xsl:when>
													<xsl:otherwise>
														<xsl:value-of select="n:Total"/>
													</xsl:otherwise>
												</xsl:choose>
											</td>
										</tr>
									</xsl:when>
							</xsl:choose>
						</xsl:for-each>
						<xsl:for-each select="n:TaxInvoices/n:Invoice/n:Fees/n:FeeLine" xml:space="">
							<xsl:sort case-order="" select="n:Type" order="ascending"/>
							<xsl:choose>
								<xsl:when test="n:Type='P' and n:Text = 'Total' ">
										<tr>
											<td colSpan="96"/>
											<td colSpan="4">
												<xsl:value-of select="n:Total"/>
											</td>
										</tr>
									</xsl:when>
							</xsl:choose>
						</xsl:for-each>
						<tr/>
						<tr/>
						<tr/>
						<tr>
							<td style="font-weight: bold" colSpan="96">Disbursements and Other Costs:</td>
							<td style="font-weight: bold" colSpan="4"/>
						</tr>
						<xsl:for-each select="n:TaxInvoices/n:Invoice/n:Fees/n:FeeLine" xml:space="">
							<xsl:sort case-order="" select="n:Type" order="ascending"/>
							<xsl:choose>
								<xsl:when test="n:Type='D' and n:Text != 'Total' ">
									<xsl:variable name="LastDNode" select="count(n:Text)"></xsl:variable>
									<tr><xsl:value-of select="$LastDNode"></xsl:value-of></tr>
									<tr>
										<td colSpan="96">
											<xsl:value-of select="n:Text"/>
										</td>
										<td align="right" colSpan="4">
											<xsl:value-of select="n:Total"/>
										</td>
									</tr>
								</xsl:when>
							</xsl:choose>
						</xsl:for-each>
						<xsl:for-each select="n:TaxInvoices/n:Invoice/n:Fees/n:FeeLine" xml:space="">
							<xsl:sort case-order="" select="n:Type" order="ascending"/>
							<xsl:choose>
								<xsl:when test="n:Type='D' and n:Text = 'Total' ">
									<tr>
										<td colSpan="96"/>
										<td align="right" colSpan="4">
											<xsl:value-of select="n:Total"/>
										</td>
									</tr>
								</xsl:when>
							</xsl:choose>
						</xsl:for-each>
						<xsl:for-each select="n:TaxInvoices/n:Invoice/n:Fees/n:FeeLine" xml:space="">
							<xsl:sort case-order="" select="n:Type" order="ascending"/>
							<xsl:choose>
								<xsl:when test="n:Type='GT'">
									<tr>
										<td colSpan="96"/>
										<td align="right" style="border-bottom-style: double" colSpan="4">
											<xsl:value-of select="n:Total"/>
										</td>
									</tr>
								</xsl:when>
							</xsl:choose>
						</xsl:for-each>
					</tbody>
				</table>
				<br/>
				<br/>
				<br/>
				<table align="left" width="100%" border="0">
					<tbody>
						<tr>
							<td align="left">
								<img style="font-family: times new roman"><xsl:attribute name="border"/><xsl:attribute name="src">
											<xsl:text disable-output-escaping="yes">file:///C:\Dev\Invoices\TaxInvoice\Images\FBR_Footer.GIF</xsl:text>
										</xsl:attribute></img>
							</td>
						</tr>
					</tbody>
				</table>
				<br/>
			</p>
		</body>
	</html>
</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2004. Sonic Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="TaxInvoice" userelativepaths="yes" externalpreview="no" url="taxinvoice.xml" htmlbaseurl="" outputurl="" processortype="internal" profilemode="7" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition></MapperMetaTag>
</metaInformation>
-->