GNOME Bugzilla – Bug 562992
xmllint does not accept a missing element if the schema has a "default" attribute
Last modified: 2021-07-05 13:21:10 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/
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.