Folks,
A little help please,
I've tried every iteration of "removing DOM node" I can find, they all fail.
Can someone give me a pointer in the right direction and/or help me
understand the error message? Which I have to say, regardless of my pesent
level of understanding, seems a bit cryptic; more sage minds than mine can
correct me on that point.
Thanks,
The code in question follows:
SVGOMDocument sd = (SVGOMDocument)ad;
Element svgRoot = sd.getDocumentElement();
// Get rid of the previous Graph
Node rn = sd.getElementById("BarChart"); //.getParentNode();
// while(rn.hasChildNodes()){
sd.removeChild(rn);
// }
rn = sd.getElementById("dropshadow"); //.getParentNode();
// while(rn.hasChildNodes()){
sd.removeChild(rn);
// }
if(sd.getElementById("dropshadow")!=null) sd.removeChild(
d.getElementById("dropshadow"));
if(sd.getElementById("BarChart") !=null) sd.removeChild(
d.getElementById("BarChart"));
// Import the new document's parent node to the svg root element
by
// building the import node off the original document and then
appending the import node.
Node n = sd.importNode(d.getElementById("dropshadow"), true);
And the error produced: "The child node (type: 1, name: g) is missing."
Caused by: org.w3c.dom.DOMException: The child node (type: 1, name: g) is
missing.
at org.apache.batik.dom.AbstractNode.createDOMException(Unknown Source)
at org.apache.batik.dom.AbstractParentNode.removeChild(Unknown Source)
at
com.bluepearlsystems.Client.Controller.RateReturnSlide.DOMAttrModified(
RateReturnSlide.java:96)
... 33 more