ASPOSE WORD for Android: importNode method throws exception

Hi there,

I am evaluating ASPOSE WORD library for Android. Everything went smoothly except the following scenario,

When I try to create new word document from the existing word document which contains a DrawingML as one of the node, it throws exception at importNode method. I am using importNode method of Document class to import nodes and then trying to use appendChild method to add node at specific location in the document. Could you please suggest any solution for this problem?

Here is the code snippet,

node = mSrcDoc.importNode((DrawingML) tag, false);
mDoc.getFirstSection().getBody().getLastParagraph().appendChild(node);

Exception while importing drawingML:

org.w3c.dom.DOMException: Cannot copy node of type 9
at org.apache.harmony.xml.dom.DocumentImpl.shallowCopy(DocumentImpl.java:154)
at org.apache.harmony.xml.dom.DocumentImpl.cloneOrImportNode(DocumentImpl.java:220)
at org.apache.harmony.xml.dom.NodeImpl.cloneNode(NodeImpl.java:79)
at com.aspose.words.DrawingML.Ã(Unknown Source)
at com.aspose.words.NodeImporter.Z(Unknown Source)
at com.aspose.words.NodeImporter.Ã(Unknown Source)
at com.aspose.words.DocumentBase.Ã(Unknown Source)
at com.aspose.words.DocumentBase.importNode(Unknown Source)

Any help would be greatly appreciated. Thanks in advance.

Regards,
msankeshwari

Hi Mahantesh,

Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSANDROID-57 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.