0

I have SOAPMessage, which created from parsed xml-file. How can I insert a new Element (SOAPElement or Node) between two other elements? Now it appends only like last child (with addChildElement or appendChild), in the end of current NodeList. The method insertBefore throws the exception:

"org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. "

  • Are you trying duplicate root element? Are you trying add node below or above root element? –  Oct 29 '16 at 20:52
  • Hm, no, i'm not. I just started to learn soap in java, please, could you show the example - what do you mean? – Mr.student Oct 29 '16 at 21:02
  • 1
    Are you researched info in: https://stackoverflow.com/questions/31778140/why-i-get-org-w3c-dom-domexception-hierarchy-request-err-here https://stackoverflow.com/questions/23520982/org-w3c-dom-domexception-hierarchy-request-err https://stackoverflow.com/questions/17864285/hierarchy-request-err-while-trying-to-add-elements-to-xml-file-in-a-for-loop –  Oct 29 '16 at 21:05
  • I'll start right now, thank you – Mr.student Oct 29 '16 at 21:16

0 Answers0