Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6092503

org.w3c.dom.Element.appendChild(Element) always adds child at end of parent node

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • 1.1
    • 8.1ee
    • xml

      During the transformation of elements from one domain.xml to another we noticed a problem in the past week regarding the order of children that are added to a element using appendChild.

      Given an element X which has child element types a,b,c and a DTD definition:

      <!ELEMENT X (a* , b*, c*)>

      and a target xml with an exsisting element X like:

      <X>
       <a> <a/>
       <b <b/>
       <c> <c/>
      <X/>

      calling X.appendChild(a) should (and previous to recent builds did) yield the following:

      <X>
       <a> <a/>
       <a> <a/>
       <b <b/>
       <c> <c/>
      <X/>

      but in the current JAXP we always get the added child appended to the end of the parent.

      <X>
       <a> <a/>
       <b <b/>
       <c> <c/>
       <a> <a/>
      <X/>

      this causes the XML to fail DTD conformance and in the case of domain.xml, causes appservDAS.exe to crash on startup.
      ###@###.### 7/22/04 15:38 GMT

            duke J. Duke
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: