GNOME Bugzilla – Bug 565547
schema parsing should fail when the content model is non-deterministic
Last modified: 2021-07-05 13:23:35 UTC
Please describe the problem: In the schema which is as follows, 2 particles with idendical element declarations (same type), one under 'choice', one is from sequence, model is non-deterministic. So the schema parsing should give this non-deterministic error. But libxml2 is not giving any error. Steps to reproduce: 1. please parse the schema file given below using the api xmlSchemaParse Actual results: libxml2 parses the schema file without giving any error. Expected results: the following error is expected.element e1 makes the content model non-deterministic against element e1. Does this happen every time? yes Other information: Schema script: <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="doc" type="foo"/> <xsd:complexType name="foo"> <xsd:choice> <xsd:element name="e1" type="xsd:string"/> <xsd:group ref="group"/> </xsd:choice> </xsd:complexType> <xsd:group name="group"> <xsd:sequence> <xsd:element name="e1" type="xsd:string"/> </xsd:sequence> </xsd:group> </xsd:schema>
*** Bug 565548 has been marked as a duplicate of this bug. ***
This does not look like an error in libxml2, and it seems be allowed in W3C XML Schema. When the element definition is repeated in the XSD, libxml2 selects the last one as the definition of the element.
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.