#749198 libxml2: incorrect Relax NG parser error with included grammar

Package:
libxml2
Source:
libxml2
Description:
GNOME XML library
Submitter:
Vincent Lefevre
Date:
2021-07-07 11:51:03 UTC
Severity:
normal
Tags:
#749198#5
Date:
2014-05-25 01:01:45 UTC
From:
To:
Relax NG is broken: I get an Relax NG parser error on correct .rng files.
I've attached a testcase.

$ xmllint --relaxng test1.rng test.xml
test1.rng:3: element include: Relax-NG parser error : xmlRelaxNG: include docbook.rng has a define subscript but not the included grammar
dbpoolx.rng:10078: element define: Relax-NG parser error : Some defines for subscript needs the combine attribute
Relax-NG schema test1.rng failed to compile
<?xml version="1.0"?>
<para>test</para>

But if I replaced the <include href="dbpoolx.rng"/> in docbook.rng
by the referenced file (with the needed changes such as removing
the grammar element), the error disappears:

$ xmllint --relaxng test2.rng test.xml
<?xml version="1.0"?>
<para>test</para>
test.xml validates

This issue is similar to:

https://mail.gnome.org/archives/xml/2003-March/msg00037.html

but the testcase on this page works fine with this libxml2 version.

#749198#14
Date:
2017-12-25 03:25:20 UTC
From:
To:
Control: forwarded -1 https://bugzilla.gnome.org/show_bug.cgi?id=326174
Control: found -1 2.9.4+dfsg1-5.2

This is actually due to comments before the root element grammar.
Removing these comments makes the failure disappear.