Commons JXPath
  1. Commons JXPath
  2. JXPATH-91

KeyManager should support nodeset selection

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2 Final
    • Fix Version/s: 1.3
    • Labels:
      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

      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

        Hide
        Sergey Vladimirov added a comment -

        Source Code patch to implement feature

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

        Test case patch totest the feature

        Show
        Sergey Vladimirov added a comment - Test case patch totest the feature
        Hide
        Matt 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.
        Show
        Matt 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.
        Hide
        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
        Show
        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
        Hide
        Sergey Vladimirov added a comment -

        Patch for source code is updated using Matt comments.

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

        Remove reformat of apache code

        Show
        Sergey Vladimirov added a comment - Remove reformat of apache code
        Hide
        Matt 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.

        Show
        Matt 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

          • Assignee:
            Unassigned
            Reporter:
            Sergey Vladimirov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development