Gentoo Archives: gentoo-dev

From: Dirkjan Ochtman <djc@g.o>
To: Gentoo Development <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] New schema language for metadata validation?
Date: Wed, 27 Jan 2016 09:22:46
Message-Id: CAKmKYaBxFkjv9_W95C7CeW2sfsS_h-uBSMA16iF=1pB+zmw1rQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] New schema language for metadata validation? by Michael Orlitzky
1 On Tue, Jan 26, 2016 at 9:52 PM, Michael Orlitzky <mjo@g.o> wrote:
2 > I would appreciate examples of some common tasks like validating
3 > projects.xml, but since we don't have those now, it's not critical.
4 > This used to be kinda straightforward with xmllint,
5 >
6 > $ xmllint --valid --noout projects.xml && echo "OK"
7
8 The closest equivalent for this is just:
9
10 xmllint --relaxng metadata.rng --noout metadata.xml && echo "OK"
11
12 I.e., you have to specify the schema file manually (also, as mentioned
13 before, libxml2 does not support RNC natively, so you have to convert
14 to RNG first -- but we can keep those around). You can use a non-HTTPS
15 URL for --relaxng, as well.
16
17 There is a standard to link an XML file to a RELAX NG (XML or compact
18 syntax) schema, here:
19
20 http://www.w3.org/TR/xml-model/
21
22 But libxml2 does not seem to support it; that is, substituting the
23 DOCTYPE for an xml-model processing instruction and then using xmllint
24 --valid does not do the right thing (it complains there's no DOCTYPE).
25
26 Cheers,
27
28 Dirkjan

Replies

Subject Author
Re: [gentoo-dev] New schema language for metadata validation? Michael Orlitzky <mjo@g.o>