How to Replace or Modify Hyperlinks Code Example Problem

Hi, I am having a problem with the latest version (15.7.0) of Aspose.Words for Java. Our application makes use of the example code found in the documentation in the “How to Replace or Modify Hyperlinks” section. (http://www.aspose.com/docs/display/wordsjava/How+to++Replace+or+Modify+Hyperlinks) We use this to parse the hyperlinks of a Word document. The problem we are having happens when it gets to the following line in the Hyperlink class constructor.


mFieldSeparator = findNextSibling(mFieldStart, NodeType.FIELD_SEPARATOR);

This is returning null and not returning the field separator. The exception is then thrown, preventing the hyperlink from being processed further. The version of Aspose.Words we are using that works fine with this is an older version (13.5.0) and the problem seems to happen with the versions (14.8.0 - 15.7.0) under New Releases in the Downloads section. Something must have changed between the version of 13 we are using and version 14 that is not being accounted for in the example code.

We are upgrading to version 15.7.0, as this addresses other problems one of our clients were having, but this problem is preventing a major feature of our application from functioning correctly. We cannot push this to our production environment until this issue is resolved, so any help would be greatly appreciated.

The example code actually does work as a Java console application after some further testing. Our application is web based and the source Word document being converted comes from an input stream of an uploaded file. The field separator is found when uploading with Chrome, but uploading with Firefox it isn’t working. This could possibly be some kind of encoding problem. Does Aspose.Words assume or require an input stream of a particular encoding when passed to the Document class constructor?