Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2203

ClassCastException when calling XPathExpressionImpl.evaluate with item argument of type NodeList

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.7
    • None
    • XPath
    • None
    • Java 5

    Description

      When calling XPathExpressionImpl.evaluate(Object item, QName returnType), if item is of type NodeList, a ClassCastException is thrown.

      I've looked at the source code. The problem seems to happen in XPathExpressionImpl.eval(Object contextItem). There is a section of code that reads:

      Node contextNode = (Node)contextItem;
      // We always need to have a ContextNode with Xalan XPath implementation
      // To allow simple expression evaluation like 1+1 we are setting

      The type cast is what causes the exception. Is there a fix or a work-around for this?

      Attachments

        Activity

          People

            Unassigned Unassigned
            evilches Eduardo Vilches
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: