batik-users,您好!
I get have two svg document instances. the docA and docB, I want to
insert docA to docB, because I know SVG tag can be nested. so I code followling:
Node node = docA.getFirstChild();// the svg root element
docB.appendChild(node); // nest svg
but I run the code and get the exception:
org.w3c.dom.DOMException: The node (type: 1, name: svg) cannot be
inserted, since the document node already has a node of type 1.
at
org.apache.batik.dom.AbstractNode.createDOMException(AbstractNode.java:408)
at
org.apache.batik.dom.AbstractDocument.checkChildType(AbstractDocument.java:855)
at
org.apache.batik.dom.AbstractParentNode.checkAndRemove(AbstractParentNode.java:455)
at
org.apache.batik.dom.AbstractParentNode.appendChild(AbstractParentNode.java:203)
why that exception happens? how can I fix it? thanks for reply.
Give my best wishes to you
Yours sincerely
杨莹
[email protected]
2009-03-08