Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-430

"StylesheetExecutionContext::getVariable(name)" crahes if variable "name" was not found.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 1.8
    • None
    • XalanC
    • None
    • Operating System: Solaris
      Platform: Sun
    • 30229

    Description

      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.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--bug.txt
          5 kB
          David Bertoni

        Activity

          People

            Unassigned Unassigned
            philipips@yahoo.com Philip IPS
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: