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 562992 - xmllint does not accept a missing element if the schema has a "default" attribute
xmllint does not accept a missing element if the schema has a "default" attri...
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xmlschema
2.6.31
Other All
: Normal minor
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-02 16:06 UTC by Stephane Bortzmeyer
Modified: 2021-07-05 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stephane Bortzmeyer 2008-12-02 16:06:32 UTC
Please describe the problem:
A W3C XML schema I use contain things like:

         <xs:element default="false" name="CtlBypassRouteTable"
                     type="xs:boolean"/>

xmllint refuses the documents without a <CtlBypassRouteTable>, despite the "default" attribute.


Steps to reproduce:
1. xmllint --schema traceroute.xsd mydoc.xml

Actual results:

:13: element CtlInitialTtl: Schemas validity error : Element
'{urn:ietf:params:xml:ns:traceroute-1.0}CtlInitialTtl': This element is not expected. Expected
is ( {urn:ietf:params:xml:ns:traceroute-1.0}CtlBypassRouteTable ).


Expected results:
The document should be accepted

Does this happen every time?
Yes

Other information:

If I add a minOccurs="0" to the schema, xmllint stops complaining. But I believe it is wrong, the "default" attribute should be sufficient.

Xerces seems to agree with me since my documents are accepted by http://validate.openlaboratory.net/
Comment 1 GNOME Infrastructure Team 2021-07-05 13:21:10 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.