Re: How can I replace one of the attributes in NamedNodeMap (DOM)?
Posted By:
Bozidar_Dangubic
Posted On:
Wednesday, September 26, 2001 11:01 AM
you are getting an error because you have to create nodes using the original Document object that created all the nodes in the Document you are modifying. At times, to get things working I had to pass the Document object around in order to overcome this limitation (in my opinion it is a limitation). Element elem1 = doc.createElement("animal") creates element that can be appended to doc, but Element elem2 = doc2.createElement("animal") creates an element that cannot be appended to doc but only to doc2. that you have to always be aware of.