XSLT File (/WEB-INF/xsl/accountFinancialHistory.xsl)

The XSLT transform "pulls" data from the XML result document into HTML by name-matching.

In examining the XSLT file, note the split between header/data rows. You can see how the metainfo defining the data types for the columns is introduced, via the numberLabelCell and dateLabelCell. You can see that the XSLT file minimizes explicit formatting (for example, of column widths), preferring to let the browser lay things out as it sees fit.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSLTransform">
  <xsl:output method="html" />
  <xsl:strip-space elements="*" />
  <xsl:param name="sequenceId" />
  <xsl:include href="include.xsl" />
  <xsl:template match="/">
    <xsl:variable name="list" select="/pageBody/list[@name='ACCT_​FT_​HIST']/listBody" />
    <xsl:if test="count($list) > 0">
      <table class="dataTable" cellpadding="2" cellspacing="0">
        <tr class="zoneGridLabel">
          <xsl:call-template name="emptyCell" />
          <xsl:call-template name="dateLabelCell">
            <xsl:with-param name="key" select="'$ARS_​DT'" />
          </xsl:call-template>
          <xsl:call-template name="labelCell">
            <xsl:with-param name="key" select="'$FT_​TYPE_​FLG'" />
          </xsl:call-template>
          <xsl:call-template name="numberLabelCell">
            <xsl:with-param name="key" select="'CI_​FT$CUR_​AMT'" />
          </xsl:call-template>
          <xsl:call-template name="numberLabelCell">
            <xsl:with-param name="key" select="'$CURRENT_​BALAN_​WRK'" />
          </xsl:call-template>
          <xsl:call-template name="numberLabelCell">
            <xsl:with-param name="key" select="'CI_​FT$TOT_​AMT'" />
          </xsl:call-template>
          <xsl:call-template name="numberLabelCell">
            <xsl:with-param name="key" select="'$DERIVED_​AMT_​WRK'" />
          </xsl:call-template>
        </tr>
        <xsl:apply-templates select="$list" />
      </table>
    </xsl:if>
  </xsl:template>
  <xsl:template match="listBody">
    <xsl:variable name="financialTransactionType">
      <xsl:value-of select="field[@name='FT_​TYPE_​FLG']" />
    </xsl:variable>
    <xsl:variable name="payEventId">
      <xsl:value-of select="field[@name='PAY_​EVENT_​ID']" />
    </xsl:variable>
    <xsl:variable name="parentId">
      <xsl:value-of select="field[@name='PARENT_​ID']" />
    </xsl:variable>
    <xsl:variable name="siblingId">
      <xsl:value-of select="field[@name='SIBLING_​ID']" />
    </xsl:variable>
    <tr>
      <xsl:attribute name="position">
        <xsl:value-of select="position()" />
      </xsl:attribute>
      <xsl:call-template name="rowClass" />
      <td class="gridTd" width="1">
        <img src="/images/goto_​sm.gif" xsl:use-attribute-sets="imageButton" onclick="handleAccountFinancialHistoryContext('{$financialTransactionType}', '{$payEventId}', '{$parentId}', '{$siblingId}')" />
      </td>
      <xsl:variable name="currentAmount" select="field[@name='CUR_​AMT']" />
      <xsl:variable name="currentBalance" select="field[@name='CUR_​BAL']" />
      <xsl:variable name="payoffAmount" select="field[@name='TOT_​AMT']" />
      <xsl:variable name="payoffBalance" select="field[@name='TOT_​BAL']" />
      <xsl:call-template name="dateCell">
        <xsl:with-param name="value" select="field[@name='ARS_​DT']" />
      </xsl:call-template>
      <xsl:call-template name="valueCell">
        <xsl:with-param name="value" select="field[@name='DESCR']" />
      </xsl:call-template>
      <xsl:call-template name="numberCell">
        <xsl:with-param name="value" select="$currentAmount" />
      </xsl:call-template>
      <xsl:call-template name="numberCell">
        <xsl:with-param name="value" select="$currentBalance" />
      </xsl:call-template>
      <xsl:call-template name="numberCell">
        <xsl:with-param name="value" select="$payoffAmount" />
        <xsl:with-param name="dimmed" select="$currentAmount = $payoffAmount" />
      </xsl:call-template>
      <xsl:call-template name="numberCell">
        <xsl:with-param name="value" select="$payoffBalance" />
        <xsl:with-param name="dimmed" select="$currentBalance = $payoffBalance" />
      </xsl:call-template>
    </tr>
    <script type="text/javascript" defer="defer">
            function handleAccountFinancialHistoryContext(financialTransactionType, payEventId, parentId, siblingId) {
                switch (financialTransactionType) {
                    case 'PS' :
                    case 'PX' : {
                        handleGotoContext('paymentEventMaint', 'PAY_​EVENT_​ID', payEventId);
                        break;
                    }
                    case 'BS' :
                    case 'BX' : {
                        handleGotoContext('billMaint', 'BILL_​ID', parentId);
                        break;
                    }
                    case 'AD' :
                    case 'AX' : {
                        handleGotoContext('adjustmentMaint', 'ADJ_​ID', siblingId);
                        break;
                    }
                }
            }
    </script>
  </xsl:template>
</xsl:stylesheet>