RelaxNG parser error due to comment before root element in rng file
A comment before the root element of a rng file may yield a RelaxNG parser error.
Testcase: archive libxml2-rng-test2.tar.xz, or the individual files: test.xml test.rng test-aux1.rng test-aux2.rng
$ xmllint --noout --relaxng test.rng test.xml
test.rng:3: element include: Relax-NG parser error : xmlRelaxNG: include test-aux1.rng has a start but not the included grammar
test.rng:9: element element: Relax-NG parser error : Some <start> element miss the combine attribute
Relax-NG schema test.rng failed to compile
The error disappears if I remove the comment from test-aux2.rng
.
This is old bug 326174 on GNOME's Bugzilla, which I reported in January 2006 against libxml2 2.6.22. This bug is still present in libxml2 2.9.10.