Overwrite inline style of HTML tags while generating documents

Iam using Aspose.Word for JAVA package in our application. From the GUI we would receive a rich text html content, which is getting converted into MS-Word document and PDF document. During this process, i need to overwrite the instyle of some of the HTML tags. I would receive the HTML content with lot of <P>, <DIV>, <SPAN> tags. But, the <SPAN> tags would have instyle with the STYLE attribute. We are already given with a pre-defined template to generate WORD doc. and PDF doc., So, the content appearing in between the <P>, <SPAN> and <DIV> tags should follow the pre-defined styles. But, we follow different inline styles for the GUI. While, converting the html content received from the GUI int to the document, we need to overwrite the inline styles. Can you please, provide your suggestions or solutions to achieve this?

Hi
Thanks for your request. I think, you can use regular expressions to parse your input HTML in order to override inline styles.
Also, you can try using INodeChangingCallback:
https://reference.aspose.com/words/net/aspose.words/inodechangingcallback/
Hope this helps.
Best regards,