xsl-list
[Top] [All Lists]

use variable as node-set for key get NullPointerException

2002-12-24 14:11:36
Hi,

        I declared a variable and then use the variable as
the node-set for key, I get a NullPointerException
with Saxon:
        
<!-- Find all lineitems, key on LineItemLotName -->
<xsl:variable name="LineItems">
        <xsl:choose>
                <!-- if there are bids under the line items, process
up to bid header -->
                <xsl:when test="$BidHeaderRow &gt; 0">
                        <xsl:apply-templates
select="following-sibling::row[(_at_)row &gt;
$LineItemHeaderRow and @row &lt; $BidHeaderRow]"
mode="LineItem"/>
                </xsl:when>
                <xsl:otherwise>
                        <xsl:apply-templates
select="following-sibling::row[(_at_)row &gt;
$LineItemHeaderRow]" mode="LineItem"/>
                </xsl:otherwise>
        </xsl:choose>
</xsl:variable>
<xsl:variable name="LineItemLotColumn" select="6"/>
<xsl:key name="lineitemLotsKey"
match="$LineItem[cell[(_at_)column=$LineItemLotColumn]]"
use="cell[(_at_)column=$LineItemLotColumn]"/>

I get the following exception:
java.lang.NullPointerException
        at
com.icl.saxon.KeyManager.constructIndex(KeyManager.java:105)
        at
com.icl.saxon.KeyManager.buildIndex(KeyManager.java:83)
        at
com.icl.saxon.KeyManager.selectByKey(KeyManager.java:185)
        at
com.icl.saxon.functions.Key.findKey(Key.java:100)
        at
com.icl.saxon.functions.Key.enumerate(Key.java:68)
        at
com.icl.saxon.functions.Key.evaluate(Key.java:50)
        at
com.icl.saxon.expr.Expression.enumerate(Expression.java:156)
        
How to best work around this problem?

Thanks,

Xiaocun
xiaocunxu(_at_)yahoo(_dot_)com

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>