Hi Henry, Big thanks for responding and clarifying the cause for Null Pointer exception. I have done similar work around to make it work though I was not knowing exact cause until you have explained it now.
I feel this is a basic support required as it is no different from any programming concepts. Thanks again, Amar -----Original Message----- From: Henry Zongaro [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 4:12 PM To: Reddy Anapalli Amarendra-E65017C Cc: [email protected] Subject: Re: xsltc throws exception when xsl:choose condition is evaluated Hi, Amar. "Reddy Anapalli Amarendra-E65017C" <[EMAIL PROTECTED]> wrote on 2006-02-17 03:19:35 PM: > I have a template call as shown below to find out access_level. > This variable should be assigned to 3 after the template call returns. > but instead it throws runtime exception in translet while > transformation. I am unable understand the reason for failure.This > works just fine with interpretive processor.Please help. cut short > version of xsl is included. > Actual files which I am working are attached for transformations use. > <xsl:variable name="access_level"><xsl:call-template namjava.lang. > NullPointerException > at org.apache.xalan.xsltc.runtime.BasisLibrary. > compare(BasisLibrary.java:790) > at translet.configRackNew.getAccessLevel() > at translet.configRackNew.topLevel() I don't think anybody ever responded to you. This appears to be the same problem, with a different symptom described by Jira issue XALANJ-1742.[1] There is a reference to getAccessLevel inside the definition of the "access_level" global variable (in configRackNew.xsl), and getAccessLevel contains references to the global variables "TL1_ADMIN," "TL1_READ-WRITE," "TL1_READ-ONLY," and "TL1_NONE." However, XSLTC is generating code that defines the access_level variable before the code that defines the values of those TL1_* variables. The result is a NullPointerException for any of those undefined variables. The work-around is to modify your stylesheet to take into account dependencies between global variables. If GV2 uses the value of GV1, place the definition of GV1 closer to the start of the document than GV2 (or give it higher import precedence). I hope that helps. If you feel that work-around is not acceptable, please feel free to add a comment to the Jira issue. Thanks, Henry [1] http://issues.apache.org/jira/browse/XALANJ-1742 ------------------------------------------------------------------ Henry Zongaro Xalan development IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044 mailto:[EMAIL PROTECTED]
