GNOME Bugzilla – Bug 582887
xmlschema.c problems validating complex schemas
Last modified: 2009-08-07 17:07:06 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++).
Created attachment 134780 [details] [review] Patch to fix include/import/redefine validation Patch generated against git commit 4d3e2da7f862d37e0f9adbd476531f43e02f495d
Created attachment 134788 [details] Test case
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