HTML insert with styles in repeating sections

I tried inserting HTML with styles into repeating section XML, but it is rendered as plain text. Is it possible to insert HTML with styles for repeating sections?

Can you please provide more details about the specific Aspose product you are using and the code you have tried for inserting HTML into the repeating sections?

I’m using aspose words 21.6. Here is example of XML part:

<?xml version="1.0" encoding="UTF-8" ?>
<root>
    <Employee>
        <Name><div style="color:#40B3DF;">John Doe</div></Name>
        <HireDate>2018-03-01</HireDate>
        <Gender>Male</Gender>
        <Department>B</Department>
    </Employee>
    <Employee>
        <Name><div style="color:#40B3DF;">Jane Adams</div></Name>
        <HireDate>2017-01-17</HireDate>
        <Gender>Female</Gender>
        <Department>A</Department>
    </Employee>
</root>

@bz.anton.kh Unfortunately, it snot quite clear how to reproduce the problem. Could you please attach your input, output and expected output documents along with code that will allow us to test the scenario on our side?

@alexey.noskov I attached example (code + word template).
Example.zip (16.5 KB)

@bz.anton.kh Thank you for additional information. Unfortunately, I do not see any way to use HTML syntax in the SDT mapped value. Also, I do not see such option in MS Word.

@alexey.noskov maybe it can be done another way? I mean inject styled data into repeating sections.

@bz.anton.kh You can set formatting of SDT in your template. For example see the following modified template and output documents:
in.docx (19.5 KB)
out.docx (18.2 KB)

@alexey.noskov the main goal is to insert items with different styles

@bz.anton.kh I am afraid I do not see any way to achieve this using SDT mapping. You can consider using LINQ Reporting Engine to build the report. In this case you can insert HTML dynamically.

@alexey.noskov, ok, where can I see examples of template and code, maybe on GitLab?

@bz.anton.kh You can find examples in our GitHub:
https://github.com/aspose-words/Aspose.Words-for-Java/tree/master/Examples/DocsExamples/Java/src/main/java/DocsExamples/LINQ_Reporting_Engine
Please let us know in case of any difficulties. We will be glad to help you.

@alexey.noskov could you please provide template.docx document with a correct tag? I have an error Tag 'managers' is not well-formed. Token 'managers' is unexpected. I just added next text to the document body <<managers>><</managers>>. Also, does the LINQ reporting engine support inner repeating sections?

@bz.anton.kh You should use <<foreach>>. Please see our documentation more more information:
https://docs.aspose.com/words/net/outputting-sequential-data/

Yes, you can use inner <<foreach>> statements.