How to preserve XML comments in Fodt?

I’m trying to use a fodt as a template to generate several documents with different data on them, the data is put into the document by the Google’s Golang “text/template” module and from there I get a PDF. However, in my fodt document I’m using some for-loop tags and conditional tags of “text/template” outside of the XML tree and when I open the template on LO to edit how it looks or whatever these special tags dissappear, I concluded this was normal given where they are, decided add these tags again and wrap them in XML comments but to my surprise the XML comments get removed too

I would like to know if there is a way to keep the XML comments at least?

1 Like

I have the same problem, though I’m using python jinja2 template tags like {{variable_name}}. I just included them within the formatted text and they seem to be preserved when I save, and jinja2 can fill them in, no problem. Still trying to figure out how to preserve control expressions like {% for names in names %}. I may create invisuble/tiny text to hold them.