Error “Cannot insert a node of this type at this location” in documentBuilder.insertHtml API

Hello team.
We started encountering the exception “Cannot insert a node of this type at this location” in the version Aspose.Word 25.1 , as well as in the latest released version 25.3.
Note that this seems to be possible regression as it did not happen up to version 24.10.

Attached is the zip , containing the following:
DocWithTwoContentControls.docx - input word document with two Rich text controls
testSampleWordContent.html - small sample grid that is used to refresh second content control in the word doc;
WordContainerManagerTest.java - small main test that can be run as a standalone Java program;
WordContainerManager.java - small sample code that attempts to refresh content control;
AsposeWordUtility.java - supplemental helper program used by WordContainerManager
Aspose24_10_versus_24_11.png - image illustrating the issue when run with Aspose.Word 24.10 version 24.11 under Linux OS;
Aspose25_03.png - similarly, results of running the test with Aspose.Word library 25.3

Environment details:
java full version 1.8.0_441-b07
OS - Oracle Linux 7 Update 4

steps to reproduce:

  1. compile AsposeWordUtility: javac -cp .:commons-io-2.11.0.jar:aspose-words-25.1.jar AsposeWordUtility.java
  2. compile WordContainerManager: javac -cp .:commons-io-2.11.0.jar:aspose-words-25.1.jar WordContainerManager.java
  3. compile WordContainerManagerTest: javac -cp .:commons-io-2.11.0.jar:aspose-words-25.1.jar WordContainerManagerTest.java
  4. run WordContainerManagerTest: java -cp .:commons-io-2.11.0.jar:aspose-words-25.1.jar WordContainerManagerTest

Please let us know it you need additional details.
Thank you.

toAspose_CannotInsertNode.zip (719.9 KB)

Just a bit more detail to the original post:
There is a BOM byte (\uFEFF) at the beginning of the HTML sample to be updated in the rich text SDT.
Previously this was ignored in builder.insertHtml(String html. boolean useBuilderFormatting).
Is there a workaround that will allow to continue this API without having to strip off BOM ?

@oraspose
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSJAVA-3079

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.