Sorry here's an updated copy of the stylesheet.  The previous one I posted was 
missing the <xsl:stylesheet> node

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
    <!ENTITY nbsp "&#x00A0;"> <!-- NO-BREAK SPACE -->
]>


    <xsl:output method="html" indent="yes" />

    <xsl:param name="rowstart">1</xsl:param>
    <xsl:param name="rowlimit">20</xsl:param>
    <xsl:param name="sortcolumn">5</xsl:param>
    <xsl:param name="sorttype">number</xsl:param>
    <xsl:param name="sortorder">descending</xsl:param>

    <xsl:template match="/">
        <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="*/p">
        <xsl:copy-of select="." />
    </xsl:template>

    <xsl:template match="*/pre">
        <xsl:copy-of select="." />
    </xsl:template>

    <xsl:template match='*/tab...@class="summary"]'>
      <xsl:copy-of select="." />
    </xsl:template>

    <xsl:template name="getActualRowstart">
      <xsl:param name="totalrows" />
      <xsl:choose>
        <xsl:when test="0 = $totalrows">
          <xsl:text>0</xsl:text>
        </xsl:when>
        <xsl:when test="$rowstart &gt; $totalrows">
          <xsl:value-of select="(floor(($totalrows - 1) div $rowlimit) * 
$rowlimit) + 1"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$rowstart"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>

    <xsl:template match='*/tab...@class="formatted"]'>
        <xsl:variable name="totalrows"><xsl:value-of select="count(tbody/tr)" 
/></xsl:variable>
        <xsl:variable name="actualRowstart">
          <xsl:call-template name="getActualRowstart">
            <xsl:with-param name="totalrows" select="$totalrows"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:copy>
            <xsl:copy-of select="@*" />
            <xsl:apply-templates />
        </xsl:copy>
        <div class="table-metadata" style="display: none;">
            <span class="table-metadata-total-rows"><xsl:value-of 
select="$totalrows" /></span>
        </div>
        <div class="table-metadata" style="display: none;">
            <span class="table-metadata-row-start"><xsl:value-of 
select="$actualRowstart" /></span>
        </div>
    </xsl:template>

    <xsl:template match="thead|tfoot">
        <xsl:copy-of select="." />
    </xsl:template>

    <xsl:template match="tbody">
        <xsl:variable name="totalrows"><xsl:value-of select="count(tr)" 
/></xsl:variable>
        <xsl:variable name="actualRowstart">
          <xsl:call-template name="getActualRowstart">
            <xsl:with-param name="totalrows" select="$totalrows"/>
          </xsl:call-template>
        </xsl:variable>
        <tbody>
            <xsl:for-each select="tr">
                <xsl:sort select="td[position() = $sortcolumn]" 
order="{$sortorder}" data-type="{$sorttype}" />
                    <xsl:if test="position() &gt;= $actualRowstart and 
position() &lt; $actualRowstart + $rowlimit">
                      <xsl:element name="tr">
                        <xsl:choose>
                          <xsl:when test="position() mod 2 = 1">
                            <xsl:attribute name="class">shaded</xsl:attribute>
                          </xsl:when>
                        </xsl:choose>
                        <xsl:copy-of select="*" />
                      </xsl:element>
                    </xsl:if>
            </xsl:for-each>
        </tbody>
    </xsl:template>

</xsl:stylesheet>




________________________________
From: Henry Zongaro <zong...@ca.ibm.com>
To: xalan-dev@xml.apache.org
Sent: Tue, January 12, 2010 8:56:51 AM
Subject: Re: NullPointerException with Java 1.6 on AIX


Hi, Robert. 

Robert Quan <monoplyf...@yahoo.com> wrote on
01/11/2010 09:07:07 PM:
> I have a problem with executing a simple transformation using a 
> translet on AIX 5.2 with JAVA 1.6; it throws the following exception: 

Thanks for providing the Java source
code for the transformation.  I suspect that you will have to provide
a stylesheet and input document that are needed to reproduce the problem. 

I would encourage you to report this
as a bug in Jira.[1] 

Thanks,

Henry 
[1] https://issues.apache.org/jira/browse/XALANJ
------------------------------------------------------------------
Henry Zongaro
XML Transformation & Query Development
IBM Canada Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:zong...@ca.ibm.com 



      

Reply via email to