Uploaded image for project: 'Commons JXPath'
  1. Commons JXPath
  2. JXPATH-36

Variable evaluation problem ?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.0 Final
    • 1.0 Final
    • None
    • Operating System: All
      Platform: All

    • 8870

    Description

      We get a strange result with variable and/or pointer using.

      Work well :
      context.getVariables().declareVariable("v1", "Dmitri");
      Pointer pointer1 = context.getPointer("/employees
      [firstName=$v1]/lastName");
      Pointer pointer2 = context.getPointer("/employees[firstName=$v1]");

      Doesn't seem to work :
      context.getVariables().declareVariable("v1", "Dmitri");
      Pointer pointer1 = context.getPointer("/employees[firstName=$v1]");
      Pointer pointer2 = context.getPointer("/employees[firstName=$v1]");

      Reference pointer1 is a "BeanPointer".
      Reference pointer2 is a "NullPointer", so its "getValue" method return
      always "null".

      We can obtain only one pointer corresponding to a given expression. This
      problem appears only with path containing variables.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jpochat@sopragroup.com Jérôme Pochat
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: