xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "杨莹" <y_m1...@163.com>
Subject appendChild exception!
Date Sun, 08 Mar 2009 15:47:33 GMT

	   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 		
View raw message