deepClone copies w14:paraId

Hello,

when using sensitivity labels in Word, I noticed that parts of a document generated with Aspose.Words (24.1) are displayed twice.
I have only noticed this in one organization so far. The function sensitivity labels seems to be different in organizations.
The reason for this are w14:paraIds that are not unique in the document. According to the documentation, the w14:paraId should be unique: [MS-DOCX]: paraId | Microsoft Learn. If the IDs are changed manually in the XML after saving, the parts are not displayed twice.
Why are there duplicate IDs in the document? Two table rows were duplicated in the document using Node.deepClone(). deepClone also seems to copy the w14:paraId attribute.

Steps to reproduce:
template.docx (37.3 KB)
The attached document is loaded and the two table rows are copied with the following code.

Document doc = new Document("..\\template.docx");

NodeCollection<Row> rows = doc.getChildNodes(NodeType.ROW, true);
Node refNode = rows.get(0);
for (Node row : rows) {
    Node clone = row.deepClone(true);
    refNode.getParentNode().insertBefore(clone, refNode);
}

doc.save("..\\test.docx");

In the saved document, you can see in the document.xml file that the w14:paraIds in the table are not unique.

Further findings
I have found WORDSNET-21436. With a version prior to 20.12, the w14:paraIds are actually unique.

Solution Idea
Is it possible to access the w14:paraIds and change them?
Is it correct that the w14:paraIds are also copied when using deepClone?
Is it possible to remove the w14:paraIds when saving a document (SaveOptions)?

Best regards
Ingo

@gutzeit

Is it possible to access the w14:paraIds and change them?

No unfortunately, there is no public API to access w14:paraId

Is it correct that the w14:paraIds are also copied when using deepClone?

w14:paraId is an identifier for the row that is unique within the document part. So the behavior is not correct.

Is it possible to remove the w14:paraIds when saving a document (SaveOptions)?

No, there is no such save option.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-26698

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as WORDSNET-26698) have been fixed in this Aspose.Words for Java 24.8 update.