aspose file tools*
The moose likes XML and Related Technologies and the fly likes HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is no Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is no" Watch "HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is no" New topic
Author

HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is no

gowtham thurangi
Greenhorn

Joined: Apr 05, 2011
Posts: 13

Hi Every one,


In my servlet am using DOM to create a xml file . But it is showing an error like

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

Please any one help me.
Thanks
.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

This sometimes happens when you try to add a node to a document, but the node actually belongs to some other document (or doesn't belong to any document at all). If that's your problem, then check out the API documentation for Document, and you'll see there's a method which allows you to import (I think that's the word) a node into a document. Once you've done that, you can then add it wherever you like in that document.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is no