Checked back again with another request which is linked on previous one, depicted over the following stackoverflow link:
XSLT get some calculated node value over next line node's value
I won't repeat the whole problem's details as they could be checked out through mentioned link. This second new request is also based over that upkeep share bills list .xml file provided and there is a need for displaying the same data but paged (pagination). Suppose I have dozens of lines in that .xml file, naturally one should do some pagination about it for a good, clean and effective display. In order to do that, I just used first michael.hor257k's solution for displaying the data and another guy's solution for pagination. These two approaches I did assembled over that .xsl file provided; but .. It didn't work ! Individually they're working smoothly, but put together the whole process fails ... Following I'll give you both my .xml file and that associated .xsl and some small .js file (which is helping for proper pagination) and I'm asking you guys to support me as I'm unable to come up with a solution. I know it's a bit complicated ... but .. that's the stuff I needed to display Thank you again very much ... and sorry for unable sort things out myself ..
1. xml file
<?xml version="1.0" encoding="utf-8"?>
<upkeepList>
<upkShare month_year="11_16-12_16" post_dte="01-20-17" due="02-04-17">
<OpngBlnce>22</OpngBlnce>
<mnthCrrntAmnt>77</mnthCrrntAmnt>
<Rcpt dte="01-26-17" No="5725">
<amnt>22</amnt>
<descrpt>"11/16" upkeep </descrpt>
</Rcpt>
<Rcpt dte="01-26-17" No="5726">
<amnt>41</amnt>
<descrpt>"12/16" upkeep </descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="01_17-02_17" post_dte="03-17-17" due="04-03-17">
<OpngBlnce/>
<mnthCrrntAmnt>74</mnthCrrntAmnt>
<Rcpt dte="03-30-17" No="5783">
<amnt>50</amnt>
<descrpt>"01/17-02/17" upkeep</descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="03-17" post_dte="04-16-17" due="05-02-17">
<OpngBlnce/>
<mnthCrrntAmnt>55</mnthCrrntAmnt>
<Rcpt dte="05-10-17" No="5815">
<amnt>40</amnt>
<descrpt>"03/17-04/17" upkeep 1</descrpt>
</Rcpt>
<Rcpt dte="05-15-17" No="5825">
<amnt>9</amnt>
<descrpt>"03/17-04/17" upkeep 2</descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="04_17-05_17" post_dte="06-05-17" due="06-30-17">
<OpngBlnce/>
<mnthCrrntAmnt>64</mnthCrrntAmnt>
<Rcpt dte="06-14-17" No="5858">
<amnt>37</amnt>
<descrpt>"05/17" upkeep 1</descrpt>
</Rcpt>
<Rcpt dte="06-18-17" No="5863">
<amnt>21</amnt>
<descrpt>"05/17" upkeep 2</descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="06_17" post_dte="07-16-17" due="07-30-17">
<OpngBlnce/>
<mnthCrrntAmnt>45</mnthCrrntAmnt>
<Rcpt dte="07-28-17" No="5948">
<amnt>38</amnt>
<descrpt>"06/17" upkeep</descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="07_17" post_dte="08-16-17" due="08-31-17">
<OpngBlnce/>
<mnthCrrntAmnt>54</mnthCrrntAmnt>
<Rcpt dte="07-28-17" No="6002">
<amnt>33</amnt>
<descrpt>"07/17" upkeep 1</descrpt>
</Rcpt>
<Rcpt dte="08-02-17" No="6017">
<amnt>12</amnt>
<descrpt>"07/17" upkeep 2</descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="08_17" post_dte="09-19-17" due="09-31-17">
<OpngBlnce></OpngBlnce>
<mnthCrrntAmnt>41</mnthCrrntAmnt>
<Rcpt dte="09-29-17" No="6026">
<amnt>41</amnt>
<descrpt>"08/17" upkeep </descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="09_17" post_dte="10-16-17" due="10-31-17">
<OpngBlnce/>
<mnthCrrntAmnt>34</mnthCrrntAmnt>
<Rcpt dte="10-26-17" No="6050" >
<amnt>34</amnt>
<descrpt>"09/17" upkeep </descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="10_17" post_dte="11-18-17" due="11-31-17">
<OpngBlnce></OpngBlnce>
<mnthCrrntAmnt>47</mnthCrrntAmnt>
<Rcpt dte="11-27-17" No="6052">
<amnt>10</amnt>
<descrpt>upkeep amount 1</descrpt>
</Rcpt>
<Rcpt dte="11-28-17" No="6084">
<amnt>8</amnt>
<descrpt>upkeep amount 2</descrpt>
</Rcpt>
<Rcpt dte="11-30-17" No="6104">
<amnt>27</amnt>
<descrpt>upkeep amount 3</descrpt>
</Rcpt>
</upkShare>
<upkShare month_year="11_17" post_dte="12-15-17" due="01-07-18">
<OpngBlnce></OpngBlnce>
<mnthCrrntAmnt>8</mnthCrrntAmnt>
<Rcpt dte="01-06-18" No="6135">
<amnt>17</amnt>
<descrpt>some upkeep amount</descrpt>
</Rcpt>
</upkShare>
</upkeepList>
2.xsl file :
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
<xsl:strip-space elements="*"/> <xsl:decimal-format name="coerce" NaN="0" />
<xsl:variable name="upkshr"> <!-- upkshr varbl -->
<xsl:for-each select="upkShare">
<upkp pstdte="{@post_dte}" rltedmnthyr = "{@month_year}" ob = "{format-number(OpngBlnce, '#', 'coerce')}"
mcamnt = "{format-number(mnthCrrntAmnt, '#','coerce')}" term = "{@due}" rcptsum = "{format-number(sum(Rcpt/amnt), '#','coerce')}" /> <!-- missing ob node's value forced to zero -->
</xsl:for-each>
</xsl:variable>
<xsl:param name="size" select="4"/>
<xsl:template match="upkeepList">
<html>
<head>
<script type="text/javascript" src="../js/scrpt_pagn.js"></script>
<h3 style="margin-left:45">Upkeep share bills list</h3>
</head>
<body onload="onInitialize()">
<xsl:apply-templates select="$upkshr[position() mod $size = 1]">
<xsl:with-param name="pages" select="ceiling(count($upkshr) div $size)"/>
</xsl:apply-templates>
</body>
</html>
</xsl:template>
<xsl:template match="$upkshr"> <xsl:param name="pages"/>
<xsl:variable name="page" select="position()"/>
<table border="1" id='content{$page}' width="300" height="170" style="text-align:center;margin-left:50; margin-top:22px; display:none">
<tr bgcolor="#9acd32">
<th>UpkpShare_Prd</th> <th>PostDate</th> <th>InitBalance</th>
<th>UpkpShare_Amount</th>
<th>DueDate</th> <th>FullAmnt</th> <th>FullAmntPayed</th>
<th>AmntDue</th>
</tr>
<xsl:for-each select="self::$upkshr | following-sibling::$upkshr[position()<$size]">
<xsl:for-each select="exsl:node-set($upkshr)/upkp">
<tr>
<td> <xsl:value-of select="@rltedmnthyr"/> </td> <!-- relatd mnthly year -->
<td> <xsl:value-of select="@pstdte"/> </td> <!-- post date -->
<xsl:variable name="initblnc" select="sum(preceding-sibling::upkp/@ob) + sum(preceding-sibling::upkp/@mcamnt) - sum(preceding-sibling::upkp/@rcptsum) + @ob" />
<td> <xsl:value-of select="$initblnc"/> <!-- initblnc = initial balance / opening balance -->
</td>
<td> <xsl:value-of select="@mcamnt"/> </td> <!-- monthly upkeep share amount -->
<td> <xsl:value-of select="@term"/> </div> </td> <!-- due -->
<td> <xsl:value-of select="$initblnc + @mcamnt"/> </td> <!-- full amount -->
<td> <xsl:value-of select="@rcptsum"/> </td> <!-- full amount payed -->
<td> <xsl:value-of select="$initblnc + @mcamnt - @rcptsum"/> </td> <!-- amount due / closing balance -->
</tr>
</xsl:for-each>
</xsl:for-each>
<tr>
<td colspan="8">
<xsl:choose>
<xsl:when test="$page = 1">
<xsl:text>pag</xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="$page"/>
<xsl:value-of select="'/'"/>
<xsl:value-of select="$pages"/>
<xsl:value-of select="' '"/>
<a href="#{$page+1}" onclick="nextPage({$page+1})">></a>
</xsl:when>
<xsl:when test="$page = $pages">
<xsl:value-of select="' '"/>
<a href="#{$page - 1}" onclick="prevPage({$page - 1})"><</a>
<xsl:text> </xsl:text> <xsl:text>pag</xsl:text>
<xsl:value-of select="' '"/>
<xsl:value-of select="$page"/>
<xsl:value-of select="'/'"/>
<xsl:value-of select="$pages"/>
</xsl:when>
<xsl:otherwise>
<a href="#{$page - 1}" onclick="prevPage({$page - 1})"><</a>
<xsl:text> </xsl:text> <xsl:text>pag</xsl:text>
<xsl:value-of select="' '"/>
<xsl:value-of select="$page"/>
<xsl:value-of select="'/'"/>
<xsl:value-of select="$pages"/>
<xsl:value-of select="' '"/>
<a href="#{$page+1}" onclick="nextPage({$page+1})">></a>
</xsl:otherwise>
</xsl:choose>
</td> </tr>
</table>
</xsl:template>
</xsl:stylesheet>
.. and finally .js file:
function onInitialize()
{
var i = 1;
document.getElementById("content"+i).style.display="" ;
}
function nextPage(num)
{
document.getElementById("content"+num).style.display="";
num--;
document.getElementById("content"+num).style.display="none";
}
function prevPage(num)
{
document.getElementById("content"+num).style.display="";
num++;
document.getElementById("content"+num).style.display="none";
}
This would be it. Again, you guys, help me with this (relatively difficult) issue !! Thank you very, very much in advance !!