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

Free Support Forum - aspose.com

Aspose Words- incorrect order of tags if they are inside of MS Word's table

Hi

We faced the following issue after updating the Aspose Words library from version 7.0.0 to 16.8.0:

java.lang.IllegalStateException: Cannot perform further replacements since the document has been changed

when we called class Range, method public int replace(Pattern pattern, IReplacingCallback handler, boolean isForward).

Based on recommendation here: <a href="https://forum.aspose.com/t/30498</a> we changed the calling from</div><div><br></div><div><i>doc.getRange().replace(TAG_PATTERN, masterEvaluator, true);</i></div><div><br></div><div>to </div><div><br></div><div><i>FindReplaceOptions options = new FindReplaceOptions();</i></div><div><i>options.setDirection(FindReplaceDirection.FORWARD);</i></div><div><i>options.ReplacingCallback = masterEvaluator;</i></div><div><i>doc.getRange().replace(TAG_PATTERN, "", options);

This however caused another problem:
If we have a tag inside of MS Word's table, then this tag is passed to IReplacingCallback (masterEvaluator in our implementation) after all other tags are processed. This causes a lot of problems for us as we rely on the exact order of our tags (especially in the list).

Could you please confirm if this is the known issue in the version 16.8.0 and/or there is a workaround?

Please find the simple template that can be used for reproducing the issue (the tags are incorrectly processed in the following order: LIST: LICENCES, NAME, LIST:END, REF)

Thanks
Lubos

Hi Lubos,


Please create a standalone runnable Java application (source code without compilation errors) that helps us reproduce your problem with Aspose.Words for Java 16.10.0 on our end and attach it here for testing. Thanks for your cooperation.

Best regards,

Hi Awais,


I upgraded Aspose.Words library v16.8.0 to the version 16.10.0 but the bug still occurs there.

Please find the attached simple application that you can use to reproduce the issue

Lubos

Hi Lubos,


Thanks for your inquiry.

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14319. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Please also confirm that the correct processing order is as follows:

  • LIST: LICENCES
  • NAME
  • REF
  • LIST:END

Best regards,

Yes, the correct order should be

  • LIST: LICENCES
  • NAME
  • REF
  • LIST:END
Is it possible to have access to your tracking system? I would like to check the progress of the issue as we need it to be fixed as soon as possible

Hi Lubos,


Thanks for your inquiry. Unfortunately, there is no direct way that you can use to track issues by yourself. But, you are welcome to ask your issue status via forum threads. We will verify the status from our internal issue tracking system and reply you back. This issue is currently pending for analysis and is in the queue. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

Best regards,

Hi Awais,


do you have any update on the issue?

Lubos

Hi Lubos,


Thanks for your inquiry. Unfortunately, this issue is not resolved yet. This issue is currently pending for analysis and is in the queue. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-14319) have been fixed in this Aspose.Words for .NET 17.4 update and this Aspose.Words for Java 17.4 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Is there an update on the issue?

@Lubos7,

Your issue WORDSNET-14319 has already been resolved. Please upgrade to the latest version of Aspose.Words for Java 17.7 from the following link:

Download Latest Version of Aspose.Words for Java API

Hope, this helps.

Best regards,
Awais Hafeez