I am trying to perform a calculation in one section using values from another and apparently I am not referencing them correctly.
On line of 181 of the XSL document the following returns a value of NaN:
<TH style="text-align: right"><xsl:value-of select='format-number((num
ber(//po_t
otal_amoun
t) - number(//po_nimo_paid) - sum(//invoice_amount_paid)
)
,"$###,###,##0.00")'/>
0;</TH>
Thanks in advance
XML DOCUMENT:
==========================
==========
==========
=
<?xml version='1.0' ?>
<?xml-stylesheet type='text/xsl' href='invoice.xsl' ?>
<document>
<purchase_order>
<po_header>
<po_total_amount>$23,919.0
0</po_tota
l_amount>
<po_nimo_paid>$150.00</po_
nimo_paid>
</po_header>
</purchase_order>
<invoices>
<pyxis_invoice>
<invoice_amount_paid>500.0
0</invoice
_amount_pa
id>
</pyxis_invoice>
<pyxis_invoice>
<invoice_amount_paid>600.0
0</invoice
_amount_pa
id>
</pyxis_invoice>
<pyxis_invoice>
<invoice_amount_paid>800.0
0</invoice
_amount_pa
id>
</pyxis_invoice>
</invoices>
</document>
XSL DOCUMENT:
==========================
==========
==========
======
<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match='document'>
<HTML>
<HEAD>
<TITLE>Nine Mile Point - PO Invoices</TITLE>
<link rel='stylesheet' type='text/css' href='../../css/nucweb.css
' />
<STYLE type='text/css'>
TH {text-align:left; vertical-align:bottom ;}
TD {text-align:left; vertical-align:top ;}
</STYLE>
</HEAD>
<BODY>
<FORM method='get' action='../udt/ewc_po_invo
ices.com'>
Enter PO#
<INPUT type='text' id='po' name='po' size='10'></INPUT>
<INPUT type='submit' id='btnSubmit' name='btnSubmit' value='Go' ></INPUT>
<HR></HR>
</FORM>
<xsl:apply-templates select="errors" />
<xsl:apply-templates select="purchase_order" />
<xsl:apply-templates select="invoices" />
</BODY>
</HTML>
</xsl:template>
<xsl:template match="purchase_order" >
<xsl:apply-templates select='po_header' />
<xsl:apply-templates select='po_detail' />
</xsl:template>
<xsl:template match="po_header" >
<table border="1" width="100%">
<tr>
<th width="100%" height="19" style="text-align: center" bgcolor="silver"> NMP Purchase Order Information </th>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">PO Number</td>
<td width="25%" style="text-align: left"><xsl:value-of select='po_number'/> 
</td>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">Order Date</td>
<td width="25%" style="text-align: right"><xsl:value-of select='po_order_date'/>&#
160;</td>
</tr>
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Amount</
td>
<td width="25%" style="text-align: left"><xsl:value-of select='po_total_amount'/>
 </td
>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">Expire Date</td>
<td width="25%" style="text-align: center"><xsl:value-of select='po_expire_date'/>&
#160;</td>
</tr>
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Status</
td>
<td width="25%" style="text-align: left"><xsl:value-of select='po_status'/> 
</td>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">NIMO Paid</td>
<td width="25%" style="text-align: right"><xsl:value-of select='po_nimo_paid'/>
60;</td>
</tr>
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Type</td
>
<td width="25%" style="text-align: left"><xsl:value-of select='po_type'/> </
td>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">Payment Terms</td>
<td width="25%" style="text-align: right"><xsl:value-of select='po_terms'/> <
/td>
</tr>
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Buyer</t
d>
<td width="25%" style="text-align: left"><xsl:value-of select='buyer_name'/> 
;</td>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">Freight Terms</td>
<td width="25%" style="text-align: right"><xsl:value-of select='ship_via'/> <
/td>
</tr>
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Vendor</
td>
<td width="25%"><xsl:value-of select='vendor_number'/>&#
160;</td>
<td width="50%" colspan="2"><xsl:value-of select='vendor_name'/>
0;</td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td width="100%" height="19" style="text-align: left" bgcolor="#00FFFF">Descript
ion</td>
</tr>
<tr>
<td width="100%" style="text-align: left; vertical-align: top"><xsl:value-of select='po_description'/>&
#160;
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="po_detail" >
<xsl:apply-templates select='po_line' />
</xsl:template>
<xsl:template match="po_line" >
<table border="1" width="100%">
<tr>
<th width="100%" style="text-align: center" bgcolor="silver">NMP Detail Information</th>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Requisit
ion</td>
<td width="25%" style="text-align: left"><xsl:value-of select='po_req_number'/>&#
160;</td>
<td width="25%" style="text-align: right; vertical-align: middle" bgcolor="#00FFFF">Part Number</td>
<td width="25%" style="text-align: right"><xsl:value-of select='po_item'/> </
td>
</tr>
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Type</td
>
<td width="25%" style="text-align: left"><xsl:value-of select='po_req_type'/>
0;</td>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">Requeste
d Quantity</td>
<td width="25%" style="text-align: right"><xsl:value-of select='po_qty'/> </t
d>
</tr>
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Approver
Number</td>
<td width="25%" style="text-align: left"><xsl:value-of select='po_approver_number
'/> <
/td>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">Received
Quantity</td>
<td width="25%" style="text-align: right"><xsl:value-of select='item_rcvd_qty'/>&#
160;</td>
</tr>
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Approver
Limit</td>
<td width="25%" style="text-align: left"><xsl:value-of select='po_approver_amount
'/> <
/td>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">Unit Price</td>
<td width="25%" style="text-align: right"><xsl:value-of select='po_unit_price'/>&#
160;</td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td width="25%" style="text-align: left" bgcolor="#00FFFF">Approver
Name</td>
<td width="25%" style="text-align: left"><xsl:value-of select='po_approver_name'/
> </t
d>
<td width="25%" style="text-align: right" bgcolor="#00FFFF">Extended
Value</td>
<td width="25%" style="text-align: right"><xsl:value-of select='po_extended_price'
/> </
td>
</tr>
</table>
<xsl:apply-templates select='po_wbs_numbers' />
</xsl:template>
<xsl:template match='po_wbs_numbers'>
<xsl:for-each select='po_wbs_number'>
<table border="1" width="100%">
<tr>
<td width="25%" style="text-align: left; vertical-align: middle" bgcolor="#00FFFF">WBS Number</td>
<td width="75%" style="text-align: left"><xsl:value-of select='.'/> </td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match='errors'>
<xsl:apply-templates select='error' />
</xsl:template>
<xsl:template match='error'>
<font color='red'>ERROR: </font>
<xsl:value-of select='app_name' />
<br />
<xsl:value-of select='error_message' />
</xsl:template>
<xsl:template match='invoices'>
<TABLE border='1'>
<TR><TH colspan='7' bgcolor="silver">Invoice Information From Pyxis</TH></TR>
<TR >
<TH style="text-align: right"> </TH>
<TH style="text-align: right"> </TH>
<TH style="text-align: right">Totals</TH>
<TH style="text-align: right"><xsl:value-of select='format-number(sum(
//invoice_
amount),"$
###,###,##
0.00")' /> </TH>
<TH style="text-align: right"><xsl:value-of select='format-number(sum(
//invoice_
amount_pai
d),"$###,#
##,##0.00"
)'/> 
</TH>
<TH style="text-align: right">Remaining</TH>
<TH style="text-align: right"><xsl:value-of select='format-number((num
ber(//po_t
otal_amoun
t) - number(//po_nimo_paid) - sum(//invoice_amount_paid)
)
,"$###,###,##0.00")'/>
0;</TH>
</TR>
<TR><TH bgcolor="#00FFFF">Invoice Number </TH>
<TH bgcolor="#00FFFF">Invoice Date </TH>
<TH bgcolor="#00FFFF">Invoice Rcvd </TH>
<TH bgcolor="#00FFFF">Invoice Amount </TH>
<TH bgcolor="#00FFFF">Invoice Amt Paid </TH>
<TH bgcolor="#00FFFF">Contact </TH>
<TH bgcolor="#00FFFF">Voucher # </TH>
</TR>
<BR>
<xsl:apply-templates select='pyxis_invoice' /></BR>
</TABLE>
</xsl:template>
<xsl:template match='pyxis_invoice'>
<TR>
<TD ><xsl:value-of select='invoice_number' /> </TD>
<TD ><xsl:value-of select='invoice_date' /> </TD>
<TD ><xsl:value-of select='invoice_received_d
ate' /> </TD>
<TD style="text-align: right"><xsl:value-of select='format-number(invo
ice_amount
, "$###,###,##0.00")' /> </TD>
<TD style="text-align: right"><xsl:value-of select='format-number(invo
ice_amount
_paid, "$###,###,##0.00")' /> </TD>
<TD ><xsl:value-of select='invoice_contact_pe
rson' /> </TD>
<TD ><xsl:value-of select='voucher_num' /> </TD>
</TR>
</xsl:template>
</xsl:stylesheet>