GNOME Bugzilla – Bug 170795
xml Schemas doesn't validate IDREF/IDREFS attributes
Last modified: 2021-07-05 13:27:29 UTC
xmllint --schema IDREF.xsd --noout IDREF.xml (see attached files) validates although the value of the IDREF attribute isn't referenced by an ID attribute.
Created attachment 38898 [details] Schema containing ID an d IDREF attributes
Created attachment 38899 [details] IDREF.xml containing an unreferenced value for an IDREF attribute
Do you need this dearly? I'm not really sure how to implement this, since ID/IDREF is handled per "validation root" in XML Schemas and per document in DTDs. So I would possibly have to create a different implementation for this; and expose the ID/IDREFness via PSVI (someday). This way the current DTD-based ID-functions won't work with this - or would have to be extended. Until we progress here, identity-constraints should be favoured over ID/IDREF.
Since identity-constraints are now implemented, the need of ID/IDREF validation is not so important (for me). Actually, I thought that this implementation was not difficult by using the xmlValidateDocumentFinal function, as it is done with DTD and RelaxNG validation. But my understanding of the code is poor, so...
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.