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 |