Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-789

DOMDocumentImpl::replaceChild should honor fDocElement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0
    • DOM
    • None
    • Operating System: Other
      Platform: Other
    • 16322

    Description

      DOMDocumentImpl::replaceChild (DOMNode *newChild, DOMNode *oldChild) just
      forwards to fParent.replaceChild, but should check for oldChild == fDocElement
      and update fDocElement if so.

      Maybe like this:

      DOMNode* DOMDocumentImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild)
      {
      if (oldChild == fDocElement &&
      newChild->getNodeType() != DOMNode::ELEMENT_NODE)
      throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0);

      fParent.replaceChild (newChild, oldChild);
      fDocElement=(DOMElement *)newChild;

      return oldChild;
      };

      Attachments

        Activity

          People

            Unassigned Unassigned
            ingo.miosga@datafactory.de ingo.miosga
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: