Hello community,
first of all let me say that I do not know a lot about xml and I do not know a thing about xmlstarlet, except for having read (but not understood completely) its man page.
A while ago (in 2010 if time stamps are to be trusted) I had made a small bash script that extracts the meta.xml of an .odt file, changes some custom properties (using sed) and updates the meta.xml file into the .odt file. This small script had some problems (mainly because sed regular expressions match greedily).
In the meantime, .odt files allow for “custom properties” to specify the data type, which makes matching them with sed even more difficult (particularly if there are custom properties with data type defined and without data type defined in the same document.)
Googling a little around, I thought a more prudent idea, would be to use a tool designed to work with xml instead of regular text files. The two tools, that seem good for the job are xmlstarlet or xml-sed.
It would be nice if somebody could provide me an example of how to change the value of an .odt custom property, using xmlstarlet on the meta.xml file.
Thank you (I know this question kind of provokes a RTFM reaction, but I am a little dumb here)