Commons JXPath
  1. Commons JXPath
  2. JXPATH-100

Core union operation does not sort result nodes according to document order

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2 Final, Nightly Builds
    • Fix Version/s: 1.3
    • Labels:
      None

      Description

      Source document:
      <MAIN><A>avalue</A><B>bvalue</B></MAIN>

      According to string() function defintion:
      "A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned."

      Following XPath calculated incorrectly:
      string(/MAIN/B | /MAIN/A)

      Expected result: "avalue"
      Actual value: "bvalue"

      Reason:
      sorting of result nodes is missing from CoreOperationUnion

      1. UnionOperationTest.java
        1 kB
        Sergey Vladimirov

        Activity

        Hide
        Sergey Vladimirov added a comment -

        Test case

        Show
        Sergey Vladimirov added a comment - Test case

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development