I am using XSLT to generate PDF document. which pulls seperate footer.html documents to use for the footers. (different countries different addresses) i need to add page numbers of the xslt document to be displayed in the footer. was wondering how you go about doing this. can anyone help?
Will put the code for the footer and the xslt document below with removing certain names from the code
FooterUK.html
<html>
<head>
<style>
.footer {
width: 100%;
}
.centre {
margin-left: auto;
margin-right: auto;
margin-top: 110px;
width: 80%;
text-align: center;
}
.left {
float: left;
text-align: left;
width: 50%;
}
.right {
float: right;
text-align: right;
width: 100%;
}
.large {
color: #C50B21;
font-size: 14px;
}
.medium {
color: #023869;
font-size: 12px;
}
.small {
color: #023869;
font-size: 10px;
}
</style>
</head>
<body>
<div id="footer" class="footer">
<div id="maindiv" class="footer">
<div id="french" class="left">
</div>
<div id="regular" class="right">
<span class='large'> <br /></span>
<span class='large'>Company Name<br /></span>
<span class='medium'>Address<br /></span>
<span class='medium'>Registered in England Number <br /></span>
<span class='medium'>VAT Number<br /></span>
<span class='medium'>Tel: Email:<br /></span>
<span class='medium'>website</span>
</div>
</div>
<div id="centre" class="centre">
<span class='small'> Offices: Australia · Brazil · China · France · Hong Kong · Malaysia · UK · USA</span>
</div>
</div>
</body>
</html>
Invoice.xslt
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="html" indent="no"/>
<xsl:variable name="docRegion" select="/root/DataSet/DocumentRegion"/>
<xsl:variable name="countryCode" select="/root/DataSet/Client/CountryCode"/>
<xsl:variable name="docType" select="'Invoice'"/>
<xsl:variable name="currency" select="root/DataSet/VATDetails[1]/InvoiceCurrency"/>
<xsl:variable name="localCurrency" select="root/DataSet/VATDetails[1]/LocalCurrency"/>
<xsl:variable name="bankDetailsChanged" select="'yes'"/>
<xsl:variable name="taxName">
<xsl:choose>
<xsl:when test="$docRegion='aus'">
<xsl:text>GST</xsl:text>
</xsl:when>
<xsl:when test="$docRegion='fra'">
<xsl:text>TVA</xsl:text>
</xsl:when>
<xsl:when test="$docRegion='eur'">
<xsl:text>TVA</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>VAT</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="invoiceCurrency">
<xsl:choose>
<xsl:when test="(($docRegion='aus') and ($currency!='USD') and ($currency!='NZD') )">
<xsl:text>AUD</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$currency"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="showVAT">
<xsl:choose>
<xsl:when test="($docRegion='uk' or $docRegion='eur' or $docRegion='fra' or ($docRegion='aus' and $currency!='USD'))">
<xsl:text>yes</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>no</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="invoiceFR">
<!-- does this invoice need a number beginning with 'FR' -->
<xsl:choose>
<xsl:when test="($docRegion='fra' or $docRegion='eur')">
<xsl:text>yes</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>no</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:strip-space elements="img"/>
<xsl:include href="Logo.xslt"/>
<xsl:include href="CompanyDetails.xslt"/>
<xsl:include href="General.xslt"/>
<xsl:include href="FAO.xslt"/>
<xsl:include href="FSC.xslt"/>
<xsl:include href="BankDetails.xslt"/>
<xsl:include href="AccountDetails.xslt"/>
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>
<xsl:value-of select="$docType"/>
</TITLE>
<LINK href="Style/JobDocuments.css" rel="stylesheet" type="text/css"/>
</HEAD>
<BODY>
<xsl:call-template name="Logo"/>
<xsl:call-template name="CompanyDetails"/>
<xsl:call-template name="Spacer"/>
<xsl:call-template name="FAO"/>
<xsl:call-template name="Spacer"/>
<xsl:call-template name="InvoiceNumber"/>
<xsl:call-template name="FSC"/>
<xsl:call-template name="Spacer"/>
<xsl:call-template name="Notes"/>
<xsl:call-template name="Spacer"/>
<xsl:call-template name="InvoiceLines"/>
<xsl:call-template name="Spacer"/>
<xsl:call-template name="InvoiceVAT"/>
<xsl:call-template name="Spacer"/>
<xsl:call-template name="PaymentTerms"/>
<xsl:call-template name="PaymentInstructions"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template name="InvoiceNumber">
<table width="100%" class="BorderBox" border="1">
<tr>
<td width="15%" class="BorderBox">
<b>Invoice No:</b>
</td>
<td width="15%" class="BorderBox">
<b>
<xsl:value-of select="root/DataSet/InvoiceDetails[1]/InvoiceNumber"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="root/DataSet/InvoiceDetails[1]/RaisedByInitials"/>
</b>
</td>
<td width="40%" class="BorderBox">
<b>
<xsl:value-of select="root/DataSet/InvoiceDetails[1]/JobName"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="root/DataSet/InvoiceDetails[1]/JobCode"/>
</b>
</td>
<td width="15%" class="BorderBox">
<b>
Invoice Date:
</b>
</td>
<td width="15%" class="BorderBox">
<b>
<xsl:value-of select="format-dateTime(root/DataSet/InvoiceDetails[1]/InvoiceDate, '[D01] [MN,*-3] [Y0001]')"/>
</b>
</td>
</tr>
<!-- only do the next line if the client reference exists-->
<xsl:if test="root/DataSet/InvoiceDetails/ClientReference != ''">
<tr>
<td width="15%" class="BorderBox">
<b>Your Ref:</b>
</td>
<td width="15%" class="BorderBox">
<b>
<xsl:value-of select="root/DataSet/InvoiceDetails/ClientReference"></xsl:value-of>
</b>
</td>
<td width="40%" class="BorderBox"></td>
<td width="15%" class="BorderBox">
<b>Customs Number:</b>
</td>
<td width="15%" class="BorderBox">
<b>
<xsl:value-of select="root/DataSet/InvoiceDetails/CustomsNumber"></xsl:value-of>
</b>
</td>
</tr>
</xsl:if>
</table>
</xsl:template>
<xsl:template name="Notes">
<xsl:if test="/root/DataSet/InvoiceDetails/SupplementaryNotes!=''">
<table width="100%">
<tr>
<td>
<xsl:call-template name="Break">
<xsl:with-param name="text" select="/root/DataSet/InvoiceDetails/SupplementaryNotes" />
</xsl:call-template>
</td>
</tr>
</table>
</xsl:if>
</xsl:template>
<xsl:template name="InvoiceLines">
<!-- table titles-->
<table width="100%">
<tr>
<td width="55%">
</td>
<td width="15%" align="right">
Unit Price
</td>
<td width="15%" align="right">
Quantity
</td>
<td width="15%" align="right">
Total Price
</td>
</tr>
<!-- currency codes-->
<xsl:for-each select="root/DataSet/LineItems">
<xsl:if test="position() = 1">
<tr>
<td></td>
<td align="right">
<b>
<xsl:value-of select="$invoiceCurrency"/>
</b>
</td>
<td></td>
<td align="right">
<b>
<xsl:value-of select="$invoiceCurrency"/>
</b>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<!-- loop through line items-->
<xsl:for-each select="root/DataSet/LineItems">
<tr>
<td>
<xsl:value-of select="./InvoiceItemName"/>
</td>
<td align="right">
<xsl:choose>
<xsl:when test="./ThreeDP='true'">
<xsl:value-of select="format-number(./InvoiceItemUnitSellPrice, '###,##0.000')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(./InvoiceItemUnitSellPrice, '###,##0.00')"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td align="right">
<xsl:value-of select="./InvoiceItemQuantity"/>
</td>
<td align="right">
<xsl:choose>
<xsl:when test="./ThreeDP='true'">
<xsl:value-of select="format-number(./InvocieItemTotalSellPrice, '###,##0.000')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(./InvocieItemTotalSellPrice, '###,##0.00')"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<!-- check if we need to display sub line items-->
<xsl:if test="./ShowDetail='true'">
<xsl:call-template name="SubLineItems">
<xsl:with-param name="lineItem" select="./InvoiceItemID"/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
</table>
<!-- display the total line-->
<table width="100%" class="BorderBox" border="1">
<tr>
<td width="25%" class="BorderBox">
<xsl:choose>
<xsl:when test="$docRegion='uk'">
<b>
Total Ex VAT
</b>
</xsl:when>
<xsl:when test="(($docRegion='aus') and ($currency!='USD'))">
<b>
Total Ex GST
</b>
</xsl:when>
<xsl:otherwise>
<b>
Total
</b>
</xsl:otherwise>
</xsl:choose>
</td>
<td width="75%" class="BorderBox" align="right">
<b>
<xsl:value-of select="$invoiceCurrency"/>
<xsl:text> </xsl:text>
<xsl:value-of select="format-number(sum(/root/DataSet/LineItems/InvocieItemTotalSellPrice), '###,##0.00')"/>
</b>
</td>
</tr>
</table>
</xsl:template>
<xsl:template name="SubLineItems">
<xsl:param name="lineItem" />
<tr>
<td colspan="4">
<i>Breakdown as follows</i>
</td>
</tr>
<!-- loop through sub line items -->
<!-- note the '/' at the start of the select below. this is to get back to the doc root and start parsing from there-->
<xsl:for-each select = "/root/DataSet/SubLineItems">
<xsl:if test="./InvoiceItemID = $lineItem">
<tr>
<td style="text-align:left" class="breakdown">
     <xsl:value-of select="./ItemName"/>
</td>
<td class="breakdown">
<xsl:choose>
<xsl:when test="./ThreeDP='true'">
<xsl:value-of select="format-number(./SellPrice, '###,##0.000')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(./SellPrice, '###,##0.00')"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td class="breakdown">
<xsl:value-of select="./Quantity"/>
</td>
<td class="breakdown">
<xsl:choose>
<xsl:when test="./Lump='true'">
<xsl:choose>
<xsl:when test="./ThreeDP='true'">
<xsl:value-of select="format-number(./SellPrice, '###,##0.000')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(./SellPrice, '###,##0.00')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="./ThreeDP='true'">
<xsl:value-of select="format-number(./Quantity * ./SellPrice, '###,##0.000') "/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(./Quantity * ./SellPrice, '###,##0.00') "/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="InvoiceVAT">
<!-- only do this section for UK/EUR/FRA/AUS - NY and CAL don't use it -->
<xsl:if test="($showVAT='yes')">
<!-- table titles-->
<table width="100%">
<tr>
<td width="55%">
</td>
<td width="15%" align="right">
<b>
Amount ex <xsl:value-of select="$taxName"/>
</b>
</td>
<td width="15%" align="right">
<b>
<xsl:value-of select="$taxName"/> Rate
</b>
</td>
<td width="15%" align="right">
<b>
<xsl:value-of select="$taxName"/> Amount in
</b>
</td>
</tr>
<tr>
<td width="55%">
<xsl:value-of select="/root/DataSet/InvoiceDetails/PMTDescription"/>
</td>
<td width="15%" align="right">
<b>
<xsl:value-of select="$invoiceCurrency"/>
</b>
</td>
<td width="15%" align="right">
<b></b>
</td>
<td width="15%" align="right">
<b>
<xsl:choose>
<xsl:when test="($invoiceFR='yes')">
<xsl:value-of select="$invoiceCurrency"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$localCurrency"/>
</xsl:otherwise>
</xsl:choose>
</b>
</td>
</tr>
<xsl:for-each select="root/DataSet/VATDetails">
<tr>
<td width="55%">
<xsl:choose>
<xsl:when test="./VATRateID=7">
<xsl:text>Intra EU - art 141 directive 2016/112 28/11/2006</xsl:text>
</xsl:when>
<xsl:when test="./VATRateID=1 and $docRegion='fra'">
<xsl:text></xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./RateDesc"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td width="15%" align="right">
<xsl:value-of select="format-number(./Amount, '###,##0.00')"/>
</td>
<td width="15%" align="right">
<xsl:choose>
<xsl:when test="./VATRateID=7 or VATRateID=1">
<!-- Intra EU Supply or Outside Scope of Tax -->
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./Rate"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td width="15%" align="right">
<xsl:choose>
<xsl:when test="($invoiceFR='yes')">
<xsl:value-of select="format-number(./VATinInvoiceCurrency, '###,##0.00')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(./VATInLocalCurrency, '###,##0.00')"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<!-- total line-->
<tr>
<td width="55%">
</td>
<td width="15%" align="right">
<b>
<xsl:value-of select="format-number(sum(root/DataSet/VATDetails/Amount), '###,##0.00')"/>
</b>
</td>
<td width="15%" align="right">
</td>
<td width="15%" align="right">
<b>
<xsl:choose>
<xsl:when test="($invoiceFR='yes')">
<xsl:value-of select="format-number(sum(root/DataSet/VATDetails/VATinInvoiceCurrency), '###,##0.00')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(sum(root/DataSet/VATDetails/VATInLocalCurrency), '###,##0.00')"/>
</xsl:otherwise>
</xsl:choose>
</b>
</td>
</tr>
</table>
<!-- total line with border-->
<table width="100%" class="BorderBox" border="1">
<tr>
<td width="25%" class="BorderBox">
<b>Total Payable</b>
</td>
<td width="75%" class="BorderBox" align="right">
<b>
<xsl:value-of select="$invoiceCurrency"/>
<xsl:text> </xsl:text>
<xsl:value-of select="format-number(sum(root/DataSet/VATDetails/VATinInvoiceCurrency) + sum(root/DataSet/VATDetails/Amount), '###,##0.00')"/>
</b>
</td>
</tr>
</table>
<!-- The exchange rate used -->
<xsl:for-each select="root/DataSet/VATDetails">
<xsl:if test="position()=1">
<xsl:if test="$invoiceFR='no' and (./LocalCurrency != ./InvoiceCurrency)">
<table width="100%">
<tr>
<td>
<!-- <xsl:text>For VAT Purposes the exchange rate between </xsl:text> -->
<!-- <xsl:value-of select="./InvoiceCurrency"></xsl:value-of> -->
<!-- <xsl:text> and </xsl:text> -->
<!-- <xsl:value-of select="./LocalCurrency"></xsl:value-of> -->
<!-- <xsl:text> was </xsl:text> -->
<!-- <xsl:value-of select="format-number(./ExchangeRate, '###,##0.000')"></xsl:value-of> -->
</td>
</tr>
</table>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
<xsl:template name="PaymentTerms">
<table width="100%" style="border: 1px solid black;">
<tr>
<td width="15%" >
<b>
Payment Terms
</b>
</td>
<td width="50%">
<xsl:value-of select="/root/DataSet/InvoiceDetails/PaymentTermsDefault"/>
</td>
<td width="15%">
<b>
<xsl:value-of select="/root/DataSet/InvoiceDetails/ScheduleItemLabel"/>
</b>
</td>
<td width="20%">
<xsl:choose>
<xsl:when test="root/DataSet/InvoiceDetails/InvoiceDate">
<xsl:value-of select="format-dateTime(root/DataSet/InvoiceDetails[1]/InvoiceDate, '[D01] [MN,*-3] [Y0001]')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-date(current-date(), '[D01] [MN,*-3] [Y0001]')"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td width="15%" >
<b>Payment Due:</b>
</td>
<td width="50%" >
<xsl:value-of select="format-dateTime(/root/DataSet/InvoiceDetails[1]/PaymentDueDate, '[D01] [MN] [Y0001]')"/>
</td>
<td width="15%">
<xsl:if test="$docRegion='uk'">
<b>Tax Point</b>
</xsl:if>
</td>
<td width="20%">
<xsl:if test="$docRegion='uk'">
<xsl:choose>
<xsl:when test="/root/DataSet/InvoiceDetails/TaxPoint">
<xsl:value-of select="format-dateTime(/root/DataSet/InvoiceDetails[1]/TaxPoint, '[D01] [MN] [Y0001]')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-date(current-date(), '[D01] [MN,*-3] [Y0001]')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</td>
</tr>
<tr>
<td width="15%" >
<b>
E & O E:
</b>
</td>
<td width="50%">
<xsl:choose>
<xsl:when test="$docRegion='uk'">
Any Queries to be raised within 14 days of Tax Point
</xsl:when>
<xsl:otherwise>
Any Queries to be raised within 14 days of Invoice Date
</xsl:otherwise>
</xsl:choose>
</td>
<td width="15%">
</td>
<td width="20%">
</td>
</tr>
</table>
</xsl:template>
<xsl:template name="PaymentInstructions">
<xsl:choose>
<!-- UK, OZ and iBiblios format -->
<xsl:when test="($docRegion='uk' or $docRegion='aus' or $docRegion='ibi' or $docRegion='fra' or $docRegion='eur')">
<table width="100%" style="border: 1px solid black;">
<tr>
<td width="100%" colspan="2">
<b>
Payment Instructions
</b>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
<xsl:value-of select="/root/DataSet/BankDetails/InvoiceInstructions"/>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
<b>
For <xsl:value-of select="$invoiceCurrency"/> Currency Payments Only
</b>
</td>
</tr>
<xsl:if test="$bankDetailsChanged = 'yes'">
<tr>
<td width="100%" colspan="2">
<table width="100%">
<tr>
<td width="30%"></td>
<td width="40%">
<b>Please note our bank details have changed</b>
</td>
<td width="30%"></td>
</tr>
</table>
</td>
</tr>
</xsl:if>
<tr>
<td width="50%">
<xsl:call-template name="BankDetails"/>
</td>
<td width="50%">
<xsl:call-template name="AccountDetails"/>
</td>
</tr>
</table>
</xsl:when>
<!-- rest of the world format -->
<xsl:otherwise>
<table width="100%" style="border: 1px solid black;" class="AccountDetails">
<tr>
<td width="100%" >
<b>
Payment Instructions
</b>
</td>
</tr>
<tr>
<td width="100%">
<xsl:value-of select="/root/DataSet/BankDetails/InvoiceInstructions"/>
</td>
</tr>
<xsl:choose>
<xsl:when test="/root/DataSet/BankDetails/BankName ='FGI USA (USD)'">
<td width="100%">
<xsl:call-template name="FGI_US_BankDetails"></xsl:call-template>
</td>
</xsl:when>
<xsl:otherwise>
<xsl:if test="/root/DataSet/BankDetails/AccountName = 'Imago Sales (USA) Inc'">
<tr>
<td width="100%" >
<xsl:text>By Wire Transfer, payable to: </xsl:text>
<xsl:value-of select="/root/DataSet/BankDetails/AccountName"/>
</td>
</tr>
</xsl:if>
<tr>
<td width="100%" >
Receiving Bank: <xsl:call-template name="BankDetails"/>
</td>
</tr>
<tr class="AccountDetails">
<td width="100%" class="AccountDetails" valign="top">
<!-- account details rest of world format-->
<xsl:call-template name="AccountDetails"/>
</td>
</tr>
</xsl:otherwise>
</xsl:choose>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>