GNOME Bugzilla – Bug 744146
relaxng: datatypeLibrary attributes on div elements are ignored
Last modified: 2021-07-05 13:22:32 UTC
datatypeLibrary attributes on ancestor div elements are not picked up by data elements when resolving their datatype library. Attached below is a schema and (valid) xml file which reproduce the problem. As of 2.9.2 the schema fails to compile, though it is valid and should match the xml file: $ xmllint --relaxng /tmp/datatypeLibrary-div-bug.rng /tmp/datatypeLibrary-div-bug.xml /tmp/datatypeLibrary-div-bug.rng:10: element data: Relax-NG parser error : Error type 'anyURI' is not exported by type library 'http://relaxng.org/ns/structure/1.0' Relax-NG schema /tmp/datatypeLibrary-div-bug.rng failed to compile <?xml version="1.0"?> <abc bar="/a/url"/> I wonder if div elements are being stripped (per section 4.11 of the spec) before the datatypeLibrary attributes get inherited and stripped (per section 4.3). datatypeLibrary-div-bug.rng: <?xml version="1.0"?> <grammar xmlns="http://relaxng.org/ns/structure/1.0"> <!-- The datatypeLibrary attribute here doesn't get picked up by the inner data element. --> <div datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <define name="foo"> <element name="abc"> <attribute name="bar"> <data type="anyURI"/> </attribute> </element> </define> </div> <start> <ref name="foo"/> </start> </grammar> datatypeLibrary-div-bug.xml: <abc bar="/a/url"/>
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.