Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: qa@g.o, Gentoo Council <council@g.o>
Subject: [gentoo-dev] XML Schema files for metadata.xml, projects.xml and repositories.xml, for review and testing
Date: Sun, 06 Mar 2016 12:32:48
Message-Id: 20160306104345.2636bbf0.mgorny@gentoo.org
1 Hello, everyone.
2
3 As you may be aware, we were considering replacing the DTD files for
4 our XML documents with a more modern and more complete format. As part
5 of considering options for this, I've written XML Schema files [1] that
6 provide a more correct replacement for the current DTD files and I'd
7 like you to review it.
8
9 XML Schema not only allows us to express our data formats more
10 correctly than DTD but also gives some degree of value checks.
11 In particular, it finds a number of existing issues that DTD can't
12 find.
13
14 For example:
15
16 $ xmllint --noout --schema projects.xsd projects.xml
17 projects.xml:864: element project: Schemas validity error : Element 'project': Duplicate key-sequence ['desktop-misc@g.o'] in key identity-constraint 'projectKey'.
18 projects.xml fails to validate
19
20 which means there are two projects using the same e-mail address
21 (and therefore being ambiguous for metadata references).
22
23 Aside to the usual structure errors, my schemas find:
24
25 - duplicate keys (project e-mails, repository names),
26
27 - duplicate supposedly-unique values (like duplicate
28 <longdescription/>s in the same language),
29
30 - some data well-formedness errors (e.g. <pkg/> tags referencing
31 things that are not correct qualified package names),
32
33 - some random weirdnesses (like using multiple <use/> blocks for
34 flags, for no good reason).
35
36 I should note that I've based those schemas on existing DTDs, PMS
37 and some understanding guesswork, so they may be over- or understrict.
38 If someone can provide better PMS-y package name regexps, I'd
39 appreciate.
40
41 Please test and review. I'm going to reply to this mail with the list
42 of current metadata.xml validation failures (it's quite long).
43
44 [1]:https://github.com/mgorny/gentoo-xml-schema
45
46 --
47 Best regards,
48 Michał Górny
49 <http://dev.gentoo.org/~mgorny/>