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 565547 - schema parsing should fail when the content model is non-deterministic
schema parsing should fail when the content model is non-deterministic
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xmlschema
2.6.28
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
: 565548 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-12-24 08:43 UTC by nagesh
Modified: 2021-07-05 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description nagesh 2008-12-24 08:43:21 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>
Comment 1 André Klapper 2008-12-30 21:57:49 UTC
*** Bug 565548 has been marked as a duplicate of this bug. ***
Comment 2 zhouzhongyuan 2019-08-22 12:29:41 UTC
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.
Comment 3 GNOME Infrastructure Team 2021-07-05 13:23:35 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.