Parent node of Run node returns null after replacing text of Run node using C#

Hi

We have found an issue with the Range.Replace method on a Run. It is blanking out the text rather than replacing and the ParentNode becomes null. This worked on the now deprecated Replace( Regex, iReplacingCallback, bool) version of the method.

The attached project demonstrates the issue. The same issue is also present when not using Replace with a callback (see commented out code).

Thanks
AsposeReplaceOnRunNode.zip (19.3 KB)

@LNGLEEVFDEV

Could you please share some more detail about your use case in which you need to call SplitElements method? Please also share complete detail of your requirement. Perhaps, there is some other way to achieve your requirement. We will then provide you more information about your query.

@tahir.manzoor
We have our own text ‘tags’ that are placed in the Word doc to perform certain operations. In this case we are looking for the start and end tag for a loop function whereby the contents in between the start and end tags are duplicated a number of times. The SplitElements method is to ensure that the tags are in their own runs so that they can be manipulated separately from any other text.

@LNGLEEVFDEV

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-20007 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@tahir.manzoor
Hi
That’s good news.
Are you able to provide any rough indication of how long it will take to resolve and release us with a fix. This has a critical impact on our business.

Regards
Nick

@LNGLEEVFDEV

We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. We work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, your issue is pending for analysis and is in the queue. Once we complete the analysis of your issue, we will then be able to provide you an estimate.

Thanks Tahir.

I appreciate the feedback. We are just keen to see a resolution.

Any update that can be provided would be much appreciated.

Nick

@LNGLEEVFDEV

We have completed the analysis of this issue and root cause has been identified. Instead of bug, it is a missing feature in Aspose.Words. We will planned the implementation of this feature and will provide you the estimate via this forum thread.

Thanks for your patience and understanding.

Thankyou for the update.

We were a little surprised to hear this has been allocated as an enhancement considering that the functionality worked in the deprecated version of this method.

However I would be grateful if you explain the difference in priority between a defect and a new feature. Does this being classified as a new feature mean this will take longer to resolve than a defect.

regards
Nick

@LNGLEEVFDEV

Could you please share Aspose.Words version in which this issue does not appear? Moreover, please share working code example to test this case. We will investigate the issue and provide you more information on it.

AsposeReplaceOnRunNode.zip (245.8 KB)

@tahir.manzoor
I’ve modified my solution so that it uses v18.11 of Aspose and there’s now two buttons. One which uses the Range.Replace (Regex, IReplacingCallback, bool) method which works and one using the newer method which does not
image.png (6.9 KB)

The issue with the new Replace method

  1. Node text is blank
  2. Node.ParentNode is null

These values are as expected with the old Replace method. The textbox at the bottom of the form displays these values

Any questions, let me know!

Regards
Shuikit

@LNGLEEVFDEV

Thanks for sharing the detail. We have logged this detail in our issue tracking system. We will check this case and update you via this forum thread once there is any news available on this issue.

We apologize for your inconvenience.

Could you please let me know if this has been reviewed and accepted as a defect?

@LNGLEEVFDEV

Unfortunately, there is no update available on this issue at the moment. We will fix this issue or add new feature for this test case. We will inform you via this forum thread once there is an update available on it. Thanks for your patience and understanding.

Is there any further update you could provide please?

@LNGLEEVFDEV

Unfortunately, there is no news available on this issue at the moment. You reported this issue in free support forum and it will be treated with normal priority. To speed up the progress of issue’s resolution, we suggest you please check our paid support policies from following link.
Paid Support Policies

The issues you have found earlier have been fixed in this Aspose.Words for .NET 20.12 update and this Aspose.Words for Java 20.12 update.