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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2 Final, Nightly Builds
    • 1.3
    • 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

      Attachments

        1. UnionOperationTest.java
          1 kB
          Sergey Vladimirov

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: