Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-629

org.apache.xmlbeans.XmlObject.selectPath(String arg0) API returns wrong values after org.apache.xmlbeans.XmlCursor.moveXml(XmlCursor arg0) API call

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Version 2.3, Version 3.1.0, Version 5.1.1
    • None
    • XPath
    • None
    • Windows/Linux

    Description

      When I search for an XmlObject within the root xml document using org.apache.xmlbeans.XmlObject.selectPath(String arg0) API with following query expression selectPath() is returning the matching XmlObject.

      selectPath("declare namespace wf='http://www.example.org/SimplifiedSchema' //wf:data[@id='data.85']")

      but calling the same method with same query expression returns no matching XmlObjects after moving one child xml object from one location to another location within using org.apache.xmlbeans.XmlCursor.moveXml(XmlCursor arg0) API.

      As per my xml schema my xml have the following structure.

      <session>
          <task>
              <task>
                  <data><data/>
              </task>
          </task>
      </session>

      root document is session. Inside session we can have task. Inside task we can have task and data.

      The issue arises when I search for a data using it's id after moving one child task to new location within a parent task.

      I have attached the schema file and sample code to reproduce the issue for reference.

      Attachments

        1. XMLBeanBugTest.zip
          29.69 MB
          Shinith

        Activity

          People

            Unassigned Unassigned
            shinith Shinith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: