Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1188

Text nodes are lost when an element is included with the XPointer element scheme

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.8.1
    • None
    • XInclude 1.0
    • None
    • Java 1.5.0_07

    Description

      When an element is included using the XPointer element scheme some text nodes are removed from the included element when they are preceded by an auto closing tag in the same including element. All the child nodes should be preserved when they are included using the XPointer element scheme.

      For example: a.xml is

      <a>
      <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="b.xml" xpointer="element(/1/2/1)">
      <xi:fallback>404</xi:fallback>
      </xi:include>
      </a>

      and b.xml is:

      <a>
      <b/>
      <c>
      <d>
      <e>will appear in result</e>
      <f></f>
      <g>
      <h>If element f is auto closing tag his text does not appear in result</h>
      </g>
      </d>
      </c>
      </a>

      The result of xi:include is correct:

      <a>
      <d xml:base="b.xml">
      <e>will appear in result</e>
      <f/>
      <g>
      <h>If element f is auto closing tag his text does not appear in result</h>
      </g>
      </d>
      </a>

      If I change <f></f> to <f/> in b.xml the result of xi:include is:

      <a>
      <d xml:base="b.xml">
      <e>will appear in result</e>
      <f/><g><h/></g></d>
      </a>

      and this is wrong.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sorin Sorin Ristache
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: