After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 326174 - RNG schema fails to compile due to XML comments
RNG schema fails to compile due to XML comments
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: relaxng
2.6.22
Other All
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
: 730705 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-01-08 05:08 UTC by Vincent Lefevre
Modified: 2021-07-05 13:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vincent Lefevre 2006-01-08 05:08:02 UTC
Please describe the problem:
With http://www.vinc17.org/rngtest.tar.bz2, I get the following error:

$ xmllint --noout --relaxng test.rng test.xml
xmlRelaxNG: include xhtml/xhtml.rng has a start but not the included grammar
Some <start> element miss the combine attribute
Relax-NG schema test.rng failed to compile

But if I remove the comment at the beginning of xhtml/modules/struct.rng and
xhtml/modules/frames.rng, then the error disappears:

$ xmllint --noout --relaxng test.rng test.xml
test.xml validates

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Vincent Lefevre 2012-09-06 01:42:21 UTC
Still occurs with libxml2 2.8.
Comment 2 Vincent Lefevre 2012-09-06 03:25:48 UTC
Simpler testcase:

$ cat test.xml
<?xml version="1.0"?>
<root/>

$ cat test.rng
<?xml version="1.0"?>
<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0">
  <include href="test-aux1.rng">
    <start combine="choice">
      <notAllowed/>
    </start>
  </include>
  <start>
    <element name="root">
      <text/>
    </element>
  </start>
</grammar>

$ cat test-aux1.rng
<?xml version="1.0"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
  <include href="test-aux2.rng"/>
</grammar>

$ cat test-aux2.rng
<?xml version="1.0"?>
<!-- Comment -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
  <start>
    <element name="foo">
      <text/>
    </element>
  </start>
</grammar>

$ 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

If href="test-aux1.rng" is replaced by href="test-aux2.rng" in test.rng, or if the XML comment in test-aux2.rng is removed, the bug no longer occurs:

$ xmllint --noout --relaxng test.rng test.xml
test.xml validates
Comment 3 Shaun McCance 2013-12-11 15:05:22 UTC
This looks suspiciously similar to bug #655288, but this problem still exists even with my fix for that bug.
Comment 4 Vincent Lefevre 2017-12-25 01:09:25 UTC
This bug is still present in libxml2 2.9.4. Any news?
Comment 5 Vincent Lefevre 2017-12-25 01:31:29 UTC
*** Bug 730705 has been marked as a duplicate of this bug. ***
Comment 6 Vincent Lefevre 2017-12-25 01:41:21 UTC
This bug makes RNG validation impossible to use in some cases, e.g. if DocBook or XHTML official schemas are used, with a double level of inclusion. There doesn't seem to be a workaround.
Comment 7 GNOME Infrastructure Team 2021-07-05 13:26:18 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.