ximion / appstream

Tools and libraries to work with AppStream metadata
http://www.freedesktop.org/wiki/Distributions/AppStream/
GNU Lesser General Public License v2.1
214 stars 114 forks source link

Version XML schema (don't discourage usage of XML namespaces) #280

Open marcusmueller opened 4 years ago

marcusmueller commented 4 years ago

The docs prominently discourage the use of the xmlns specifier.

Which, as someone who's had to maintain a file format over multiple versions of my own software, under my own control have found to be a bad idea: Should you ever need to somehow non-compatibly modify what your XML entities actually mean and what is legal and what not, you have no way of telling whether a file is of the old or of the new format.

An xmlns hurts nobody, but allows for revision, and also for the really crucial disambiguation between different versions, especially on multiple platforms, with parsers you might not control; metainfo is undubitably a metadata format that should have archival qualities, and not versioning one's metadata schema is a big no-no of file format design.

torkus commented 1 year ago

for anyone else who saw this in the docs:

The XML in metainfo files does not need any XML namespace, and adding one should generally be avoided. If you want to use a namespace though (maybe in case you want to embed the data in other contexts), the xmlns should be https://specifications.freedesktop.org/metainfo/1.0.

and went hunting for the spec regardless, discovered the URL is 404 (and probably never existed), found @marcusmueller's comment on Stackoverflow and read this:

Appstream used to have an XSD. They deleted it, because they didn't maintain it for four years and it fell out of sync with the documentation.

Then I suspect the last tagged release of the XSD files referred to can be found here:

And were removed 2018-10-22 in release 0.12.3:

With the commit comment:

The schema has not been updated for a while and at the moment it only confuses people instead of being useful. If you want to validate your AppStream metadata, use appstreamcli validate instead.

And while I disagree with that and find the current documentation ambiguous and difficult to navigate I'm certainly not putting my hand up to help reinstate a proper XML spec.