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

Free Support Forum - aspose.com

Comparing documents explodes w:hyperlinks into sequence of w:fldchars

The following document has only a hyperlink (defined with a w:hyperlink) in it.

hyperlink.docx (11.1 KB)

When this document is compared to itself, the following document is produced.

self-compared.docx (10.6 KB)

This document looks the same in Word, but the hyperlink’s internal representation has changed to a sequence of w:fldChars, and the \h switch has been added.

Note that this seems to happen with hyperlinks in all kinds of situations when comparing documents. The intent of this simple reproduction is to demonstrate that it happens even when the hyperlink cannot possibly be different because the two documents being compared are the same.

Java, version 22.1.

Filed internally as #8476.

@epaulet-society Indeed, WordprocessingML internal markup content changes, while neither the printable layout nor the displayed fields content (Alt + F9 in MS Word) change. Please inform if this is of crucial significance to you. Could you please describe the cases where this is really important?

I can’t provide too much detail, but: I programmatically analyze the compared documents, and the change from w:hyperlink to a bunch of w:fldChars was setting off false positives. Most positives require manual inspection for my purposes, so this behavior was generating a lot of manual work for me. I’ve since added a workaround to ignore this case, but I wanted to bring it to your attention since it’s surprising and seems unintentional. The workaround is fairly involved, and an upstream fix from Aspose would allow me to delete it.

When using Word to perform the same operation, it pops up a dialog to tell me it found no changes. (I had to duplicate the file as Word doesn’t let you pick the same path twice.)

Edit: and just to be really clear, I don’t generally try to compare a document to itself. But this representational change happens to a lot of (possibly all?) hyperlinks in compared documents.

@epaulet-society We have logged the issue as WORDSNET-23465. We will keep you informed and let you know once it has been resolved. We apologize for your inconvenience.

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