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

Descendant or self axis does not work correctly at root node

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2 Final
    • 1.3
    • None
    • Operating System: other
      Platform: Other

    • 38586

    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.

      Attachments

        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

          People

            Unassigned Unassigned
            cocoa Simon Raess
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: