Bug 132722

Summary: libxml2 rng validation incorrectly handles 'start' overrides in 'include'
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Martin Vidner <mvidner>
Component: OtherAssignee: Pavol Rusnak <prusnak>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: ke
Version: Final   
Target Milestone: Future/Later   
Hardware: i686   
OS: Other   
URL: http://bugzilla.gnome.org/show_bug.cgi?id=321068
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: 132722-bad2.tgz

Description Martin Vidner 2005-11-08 15:39:59 UTC
The attached set of Relax NG schemas fails to compile in xmllint. Another validator, jing, has no such problem. (I test on a null document for simplicity).

mvidner@valkyrie:bad2$ xmllint --noout --relaxng suse-primary.rng /dev/null
suse-primary.rng:3: element include: Relax-NG parser error : xmlRelaxNG: include primary.rng has a start but not the included grammar
suse-primary.rng:5: element ref: Relax-NG parser error : Some <start> element miss the combine attribute
primary.rng:6: element ref: Relax-NG parser error : Found forbidden pattern start//interleave
Relax-NG schema suse-primary.rng failed to compile
/dev/null:1: parser error : Document is empty

^
/dev/null:1: parser error : Start tag expected, '<' not found

^
mvidner@valkyrie:bad2$ jing suse-primary.rng /dev/null
/dev/null:1: fatal: Document root element is missing.
Comment 1 Martin Vidner 2005-11-08 15:53:23 UTC
Created attachment 56693 [details]
132722-bad2.tgz

Here are 3 rnc files and 3 rng equivalents generated by "trang suse-primary.rnc suse-primary.rng".
Note that in the inclusion chain (suse-primary .. primary .. rpm-ns) the start element is overriden each time. If the override is commented out in suse-primary, libxml2 accepts the schema.
(The override is actually useless here but not in the original files that were simplified for this testcase)

From the error messages I infer that libxml2 wrongly applies the "combine" method, instead of replacing the definitions entirely as required when doing an include. (See 9.4 Replacing definitions in the RNC Tutorial, http://relaxng.org/compact-tutorial-20030326.html#id2815849)
Comment 2 Karl Eichwalder 2005-11-09 14:35:32 UTC
Thanks for the report and the test case.
Comment 3 Karl Eichwalder 2005-11-09 15:16:41 UTC
Reported upstream as http://bugzilla.gnome.org/show_bug.cgi?id=321068
Comment 4 Karl Eichwalder 2006-01-12 09:04:04 UTC
Still the same with 2.6.23.
Comment 6 Karl Eichwalder 2007-08-23 14:29:36 UTC
Pavol verified reported to upstream, that 2.6.27 was still affected.
Comment 7 Pavol Rusnak 2008-07-23 14:00:19 UTC
Closing here. Tracked in upstream bugzilla.
Comment 8 Karl Eichwalder 2008-07-23 14:52:33 UTC
I think tracking upstream does not count as "RESOLVED FIXED" ;)
Comment 11 Pavol Rusnak 2008-08-19 08:19:59 UTC
Changed resolution to upstream and added URL