I have some word templates(dot/dotx) files that contain xml tags along with plain text.
At run time, I need to replace the xml tags with their respective mail merge fields. I am using Aspose to run mail merge for all my documents.
So, need to parse the document for these xml tags and replace them with merge fields.
I was using Regex to find and replace these xml tags. But I was suggested to use XML parser to parse for XML tags. The sample document is attached.
One more note, the angle brackets are typed manually by end user in the template, so not sure if the XML processor will understand them as XML tags or not.
I tried using XMLReader, but got error as my documents have no root tags on their own. Then I tried inserting start and end tag for root node myself at run-time, but still got the same error.
Please guide if I should stick to Regex or is there any way to use XML Parser for these tags.