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

KeyManager should support nodeset selection

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2 Final
    • 1.3
    • None

    Description

      KeyManager should support nodeset selection.

      In XSLT standart key() function can return not only singl node, but node set.
      KeyManager should support such functionality

      Attachments

        1. source-patch.txt
          6 kB
          Sergey Vladimirov
        2. testcase-patch.txt
          3 kB
          Sergey Vladimirov
        3. source-patch.txt
          24 kB
          Sergey Vladimirov
        4. source-patch.txt
          5 kB
          Sergey Vladimirov

        Activity

          Source Code patch to implement feature

          bsp Sergey Vladimirov added a comment - Source Code patch to implement feature

          Test case patch totest the feature

          bsp Sergey Vladimirov added a comment - Test case patch totest the feature
          mbenson Matthew Jason Benson added a comment - - edited

          This looks reasonable. A couple of issues with your source patch:

          • You have changed the signature of the protected functionKey() method in CoreFunction. All the followup code from computeValue() should be moved there and the signature preserved.
          • I see no need for NodePointer to implement getNodeSetByKey(); the JXPathContext is available in functionKey() so the method defined on the context should be sufficient.
          mbenson Matthew Jason Benson added a comment - - edited This looks reasonable. A couple of issues with your source patch: You have changed the signature of the protected functionKey() method in CoreFunction. All the followup code from computeValue() should be moved there and the signature preserved. I see no need for NodePointer to implement getNodeSetByKey(); the JXPathContext is available in functionKey() so the method defined on the context should be sufficient.
          • agree. Will preserve signarute.
          • code from computeValue() can't be moved to functionKey(). It should be saved in computeValue, because it's different from compute() case.
          • getNodeSetByKey() removed
          bsp Sergey Vladimirov added a comment - agree. Will preserve signarute. code from computeValue() can't be moved to functionKey(). It should be saved in computeValue, because it's different from compute() case. getNodeSetByKey() removed

          Patch for source code is updated using Matt comments.

          bsp Sergey Vladimirov added a comment - Patch for source code is updated using Matt comments.

          Remove reformat of apache code

          bsp Sergey Vladimirov added a comment - Remove reformat of apache code
          mbenson Matthew Jason Benson added a comment - - edited

          I have committed the basic change. I made some tweaks, including supporting a NodeSet for 2nd key() argument and support for passing in the context as the third key() argument.

          mbenson Matthew Jason Benson added a comment - - edited I have committed the basic change. I made some tweaks, including supporting a NodeSet for 2nd key() argument and support for passing in the context as the third key() argument.

          People

            Unassigned Unassigned
            bsp Sergey Vladimirov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: