We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Enumeration starts everytime at 1

Hello Team,

i do a replacement with the replace method of the Aspose API

getAllNodesBetween(start, ende);

DocumentBuilder builder = new DocumentBuilder(doc);

for (Iterator nodes = allNodesBetweenBookmarks.iterator(); nodes.hasNext():wink:
Node currentNode = nodes.next();
Node startNode = currentNode;


Node dstNode = doc.importNode(startNode, true, ImportFormatMode.KEEP_SOURCE_FORMATTING);

// / geht… fügt eine node an
// der richtigen stelle ein
Paragraph currentPar = (Paragraph) builder.getCurrentNode().getAncestor(NodeType.PARAGRAPH);

currentPar.getParentNode().insertBefore(dstNode, currentPar);


Now i have a problem. The source dcument contain a enumeration Number 1 to 3.

When i put it in the destination document, all enumerations are 1.

Please see attachted Documents. What do i wrong?

With best regards



<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. To preserve numbering you should use NodeImporter instead of Document.importNode method. Please see the following link for more information;


Hope this helps. Please let me know if you need more assistance, I will be glad to help you.

Best regards.