On Tue, Jan 26, 2016 at 9:52 PM, Michael Orlitzky <m...@gentoo.org> wrote:
> I would appreciate examples of some common tasks like validating
> projects.xml, but since we don't have those now, it's not critical.
> This used to be kinda straightforward with xmllint,
>
>   $ xmllint --valid --noout projects.xml && echo "OK"

The closest equivalent for this is just:

xmllint --relaxng metadata.rng --noout metadata.xml && echo "OK"

I.e., you have to specify the schema file manually (also, as mentioned
before, libxml2 does not support RNC natively, so you have to convert
to RNG first -- but we can keep those around). You can use a non-HTTPS
URL for --relaxng, as well.

There is a standard to link an XML file to a RELAX NG (XML or compact
syntax) schema, here:

http://www.w3.org/TR/xml-model/

But libxml2 does not seem to support it; that is, substituting the
DOCTYPE for an xml-model processing instruction and then using xmllint
--valid does not do the right thing (it complains there's no DOCTYPE).

Cheers,

Dirkjan

Reply via email to