[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

use variable as node-set for key get NullPointerExcept

Subject: use variable as node-set for key get NullPointerException
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Tue, 24 Dec 2002 13:11:36 -0800 (PST)
key get
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[@row &gt;
$LineItemHeaderRow and @row &lt; $BidHeaderRow]"
mode="LineItem"/>
		</xsl:when>
		<xsl:otherwise>
			<xsl:apply-templates
select="following-sibling::row[@row &gt;
$LineItemHeaderRow]" mode="LineItem"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:variable>
<xsl:variable name="LineItemLotColumn" select="6"/>
<xsl:key name="lineitemLotsKey"
match="$LineItem[cell[@column=$LineItemLotColumn]]"
use="cell[@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@xxxxxxxxx

__________________________________________________
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.