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 763866 - schema using redefine and indirect include fails to parse
schema using redefine and indirect include fails to parse
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xmlschema
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-18 12:01 UTC by Mike
Modified: 2021-07-05 13:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
files to reproduce refefime+indirect include problem (1.83 KB, application/octet-stream)
2016-03-18 12:01 UTC, Mike
Details

Description Mike 2016-03-18 12:01:38 UTC
Created attachment 324256 [details]
files to reproduce refefime+indirect include problem

Fails in versions 2.9.1, 2.9.2 (did not try git master).

Attached is a ZIP with a minimal repro (distilled from a huge production schema). It still involves 4 separate files - could not make it smaller, sorry.

fruits-xt.xsd <- loading this as a schema fails. It uses "redefine" to extend two types: Apple and Orange.
fruits.xsd <- base schema - does not do much, uses "include" to load "types.xsd"
types.xds <- does nothing but includes types-extra.xsd, where Apple and Orange are defined
types-extra.xsd <- this is where datatypes Apple and Orange are actually defined

Error:

$ xmllint --schema fruits-xt.xsd blah
fruits-xt.xsd:19: element complexType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The complex type definition '{http://garden.org/fruits}Orange' to be redefined could not be found in the redefined schema.
types-extra.xsd:9: element complexType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': A global complex type definition '{http://garden.org/fruits}Orange' does already exist.
WXS schema fruits-xt.xsd failed to compile
warning: failed to load external entity "blah"


Experiments:

1. if I make fruits.xsd include "types-extra.xsd" directly, no error
2. if I swap redefinitions in fruits-xt.xsd, will get similar message about Apple.

Looks like parser sees only the first data type declared in a file that is indirectly included.

FYI: Coming from LXML bug tracker: https://bugs.launchpad.net/lxml/+bug/1557710
Comment 1 GNOME Infrastructure Team 2021-07-05 13:25:14 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.