替换内容控件中的内容报错:The reference node is not a child of this node

Aspose.words for java 16.4.0,替换内容控件中的内容报错:The reference node is not a child of this node

但是其他位置的数据替换正常,我如何在 16.4.0 的版本中兼容解决这种错误。

input.docx (24.3 KB)

public static void main(String[] args) throws Exception {
    String filename1 = "D:\\input.docx";
    String filename2 = "D:\\output.docx";
    Document document = new Document(filename1);

    BookmarkCollection bookmarkList = document.getRange().getBookmarks();
    for (Bookmark bookmark : bookmarkList) {
        if (bookmark.getName().contains("PO_")) {
            System.out.println(bookmark.getName());
            bookmark.setText(" ");
        }
    }

    document.save(filename2);
}

@whitemeen 我这边使用最新版的 Aspose.Words for Java 26.5 无法重现此问题。请尝试使用最新版本,并告知我们您那边是否仍然存在此问题。