I understand that LibreOffice document files (.odt, .ods, etc) are compressed archives containing multiple XML files internally. XSLT (Extensible Stylesheet Language Transformations) is a useful tool for modifying content marked up with XML. How do I use XSLT to modify a LibreOffice document at the XML level?
Why modify the XML internal files directly? I might want to restore a corrupted document as in question, “Table changed multiple cells to 0”, which is also bug 131025. I might want to fix other problems. I might want to generate document content programmatically. I am looking for advice on using XSLT which is useful for a range of tasks.
Is there some common XSLT structure which would make my work faster? Are there some tips about how to use XSLT effectively and safely on LibreOffice document content? Are there pitfalls I should watch out for? Where can I find documentation on the various files which make up a LibreOffice document?
Let’s assume that I know how to uncompress a LibreOffice document to get its XML internals, then make a new document from them. That is the subject of a different question.
Let’s assume that I know how to use XSLT transforms, and the xsltproc tool, on my computer. This question is about tips specific to the LO document structure, not XSLT in general.
I am not asking about using an XSLT filter to import data into Calc, or using XSLT via the LibreOffice application. This question is about modifying a LO document outside of the LibreOffice application.