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 582887 - xmlschema.c problems validating complex schemas
xmlschema.c problems validating complex schemas
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
2.7.3
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-16 18:27 UTC by Jason Childs
Modified: 2009-08-07 17:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Patch to fix include/import/redefine validation (2.04 KB, patch)
2009-05-16 20:34 UTC, Jason Childs
none Details | Review
Test case (759 bytes, application/x-bzip)
2009-05-16 22:41 UTC, Jason Childs
  Details

Description Jason Childs 2009-05-16 18:27:44 UTC
Please describe the problem:
When including the same schema that has already been imported in an xml file, libxml2 throws an error.

Steps to reproduce:
1. Get the test case files from the mailing list (link in other information)
2. Extract all files to the same directory
3. Run 'xmllint --schema test-case.xsd test-case.xml


Actual results:

xmllint returns:

test-element.xsd:5: element include: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}include': The schema document 'test-common.xsd' cannot be included or redefined, since it was already imported.
WXS schema ./test-case.xsd failed to compile

Expected results:
successful validation with no errors

Does this happen every time?
Yes it happens every time

Other information:
Test cases and patch here
http://mail.gnome.org/archives/xml/2009-March/msg00009.html

I just realized that my final response to Daniel was cut off for some reason.  This should be allowed according to the xml specification, and all other libraries I've used allow it (e.g. java/c++).
Comment 1 Jason Childs 2009-05-16 20:34:46 UTC
Created attachment 134780 [details] [review]
Patch to fix include/import/redefine validation

Patch generated against git commit 4d3e2da7f862d37e0f9adbd476531f43e02f495d
Comment 2 Jason Childs 2009-05-16 22:41:31 UTC
Created attachment 134788 [details]
Test case
Comment 3 Daniel Veillard 2009-08-07 17:07:06 UTC
Okay I finally had the time to look at the issue, everyhing looks
fine the patch looks actually slightly more complex than what I remember
when we discussed the issue in March, but it looks just fine. So
patch applied and I also added the test in the regression suite,

  thanks a lot !

Daniel