Commons JXPath
  1. Commons JXPath
  2. JXPATH-12

Descendant or self axis does not work correctly at root node

    Details

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

      Operating System: other
      Platform: Other

      Description

      Given the following XML document: <root id="1234"/>
      and the XPath: //root/@id/text().

      JXPath returns null instead of "1234".

      JXPathContext context = JXPathContext.newContext(doc);
      assertEquals(value, context.selectSingleNode("//root/@id/text()"));

      The attached JUnit test highlights the problem. It seems that JXPath does not
      find the root node if it is accessed with the axis descendant-or-self.

      1. ASF.LICENSE.NOT.GRANTED--DescendantOrSelfTest.java
        0.6 kB
        Simon Raess
      2. patch.jxpath-12.txt
        3 kB
        Marcin Sarniak
      3. xpathEvalBug.zip
        1 kB
        Murty Gurajada

        Activity

        Simon Raess created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 38586 12342897
        Henri Yandell made changes -
        Project Commons [ 12310458 ] Commons JXPath [ 12310480 ]
        Affects Version/s 1.2 Final [ 12311661 ]
        Component/s JXPath [ 12311120 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Key COM-2745 JXPATH-12
        Henri Yandell made changes -
        Affects Version/s 1.2 Final [ 12311699 ]
        Marcin Sarniak made changes -
        Attachment patch.jxpath-12.txt [ 12348255 ]
        Niall Pemberton made changes -
        Fix Version/s 1.3 [ 12312253 ]
        Matt Benson made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Matt Benson made changes -
        Summary [jxpath] Descendant or self axis does not work correctly at root node Descendant or self axis does not work correctly at root node
        Murty Gurajada made changes -
        Attachment xpathEvalBug.zip [ 12389942 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Simon Raess
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development