On Thu, 27 Apr 2023 13:12:45 +0200 Per Jessen <per@opensuse.org> wrote:
Dave Howorth wrote:
On Thu, 27 Apr 2023 08:58:44 +0200 Per Jessen <per@opensuse.org> wrote:
per@office64:~> unzip -l Documents/surbl-stats.ods Archive: Documents/surbl-stats.ods Length Date Time Name -------- ---- ---- ---- 46 07-24-09 06:44 mimetype 423142 07-24-09 06:44 content.xml 6168 07-24-09 06:44 styles.xml 914 07-24-09 06:44 meta.xml 9768 07-24-09 06:44 Thumbnails/thumbnail.png [snip] 9069 07-24-09 06:44 settings.xml 1873 07-24-09 06:44 META-INF/manifest.xml -------- ------- 450980 15 files
Right, but there are no XML files there that could be accidently edited, so no need for any warnings about editing them :) So a poor choice of counterexample?
Yeah I admit it, it was a slightly poor example :-) Still, the key message remains the same - excluding certain common examples, XML files are not for human processing, accidentally or otherwise. When they are made human-readable with newlines and indentation, it is for debugging purposes.
Maybe these are better examples ?
/var/lib/wicked/ (three XML files) all openSUSE repodata (1270 files on my mirror)
Yes, I think so. (I have 4 files :) I think they may illustrate another point, which is that applications writing XML files should always use an XML library to do so. With something as short as a couple of those files, it's easy to be tempted to write them directly, but that's nearly always a bad idea. XML is a bit like cryptography - there's enough gotchas that you always want to use something that's been tested elsewhere. Corrupt XML files are a nightmare.