DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=30229>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=30229 "StylesheetExecutionContext::getVariable(name)" crahes if variable "name" was not found. Summary: "StylesheetExecutionContext::getVariable(name)" crahes if variable "name" was not found. Product: XalanC Version: 1.8 Platform: Sun OS/Version: Solaris Status: NEW Severity: Blocker Priority: Other Component: XalanC AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Here is what I can read in the documentation : ---------------------------------------------------------------------------- virtual const XObjectPtr StylesheetExecutionContext::getVariable(const XalanQName &name, const LocatorType *locator=0) [pure virtual] Given a name, locate a variable in the current context, and return a pointer to the object. Parameters: theName name of variable Returns: pointer to an XObject if the variable was found, 0 if it was not ---------------------------------------------------------------------------- In my program, I call the method like this : aXObjectPtr = m_pStylesheetExecutionContext->getVariable(aXalanQName); if(aXObjectPtr.null() == true) { /* Some error handling code ... */ } 1/ I have one remark about the documentation : aXObjectPtr is not a pointer but a pointer object (in fact, this is an object value) Consequently, it can not be returned as the 0 integer value. 2/ Instead of returning 0 or a null reference, my program crahes in the method when the variable name was not found so no error can be handled. PS: I had to const cast away the "m_executionContext" reference from the "SelectionEvent" "TraceListener" object to be able to call the "getVariable () method from the TraceListener. Perhaps it is a side-effect of doing like this. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
