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

Re: xsl:key problem (probably!)

Subject: Re: xsl:key problem (probably!)
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 07 Feb 2002 13:11:16 +0100
xsl key exception
Hi Roland,

nothing seems to be wrong. Try to use the release version Xalan 2.2. I never had such a bug.

Joerg

roland_lechner@xxxxxx wrote:

Hi,

I got the following code:

...
<xsl:key name = "accountvalue"  match ="/STATEMENT_OF_CHANGE/ACCOUNT_VALUES/ACCOUNT_VALUE" use = "ACCOUNT_NUMBER" />
...

and then I call the key() function like this:
...
<xsl:variable name="accnr" select="@account_number" />
<xsl:variable name="accv" select="key('accountvalue', $accnr)" />
<!--<xsl:value-of <xsl:value-of select="$accv/VALUE[@currency='LW']" />
...


This works perfectly fine, when the "/STATEMENT_OF_CHANGE/ACCOUNT_VALUES/ACCOUNT_VALUE" node exists.
If it doesn't XALAN 2.0 throws a NullPointerException (in the value-of statement!)

I tried to test the existence of then node, using things like:

<xsl:if test="$accv">
or
<xsl:if test="$accv/VALUE">.
(Here you also get some type of exception...)

Is this noraml, a bug or is it just me not knowing what do to?

Thanks in advance!

Roland


--

System Development
VIRBUS AG
Fon  +49(0)341-979-7411
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


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.