This is the mail archive of the
mailing list .
Re: xsl:key problem (probably!)
- From: Joerg Heinicke <joerg dot heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 07 Feb 2002 13:11:16 +0100
- Subject: Re: [xsl] xsl:key problem (probably!)
- References: <200202071111.g17BBQv28833@mailgate5.cinetic.de>
- Reply-to: xsl-list at lists dot mulberrytech dot com
nothing seems to be wrong. Try to use the release version Xalan 2.2. I
never had such a bug.
> 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 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">
> <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!
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list