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 791267 - [PATCH] Make gschema.dtd usable.
[PATCH] Make gschema.dtd usable.
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-12-05 13:43 UTC by Arnaud B.
Modified: 2017-12-06 10:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make gschema.dtd usable. (893 bytes, patch)
2017-12-05 13:43 UTC, Arnaud B.
none Details | Review
Make gschema.dtd usable. (940 bytes, patch)
2017-12-05 14:41 UTC, Arnaud B.
committed Details | Review

Description Arnaud B. 2017-12-05 13:43:18 UTC
Created attachment 365026 [details] [review]
Make gschema.dtd usable.

I’m quite sure gschema.dtd is only use for documentation, but it would be great to be able to copy it inside an actual gschema and have it work. The “<” mathematical operator in a comment makes that impossible for now.

Also, range “min” and “max” value can be equal (see “/ca/desrt/dconf-editor/Demo/weird-range”). And you can have only one of the two, but I don’t know how to put that in the DTD.
Comment 1 Philip Withnall 2017-12-05 14:05:45 UTC
Review of attachment 365026 [details] [review]:

If you’ve got any other changes to gschema.dtd, please attach them all as patches to the same bug report rather than opening more bug reports. It reduces the amount of e-mails everyone gets. :-)

(In reply to Arnaud B. from comment #0)
> Also, range “min” and “max” value can be equal (see
> “/ca/desrt/dconf-editor/Demo/weird-range”). And you can have only one of the
> two, but I don’t know how to put that in the DTD.

I don’t think that’s expressible in DTD. It might be possible if the schema were rewritten in RelaxNG. Since RelaxNG’s compact syntax is generally a lot more readable than DTD, I would happily accept a patch which rewrote the schema in RelaxNG. If you do that, please submit one patch which rewrites the schema to RelaxNG *without changing its semantics at all*, and subsequent patches which tighten or correct the semantics in RelaxNG.

::: gio/gschema.dtd
@@ +49,3 @@
 <!ELEMENT range EMPTY >
+<!-- min and max must be parseable as values of the key type and -->
+<!-- min less-than or equal to max -->

Make this a multi-line comment rather than two single-line comments. For example:

<!-- min and max must be parseable as values of the key type, and
     min must be less than or equal to max -->
Comment 2 Arnaud B. 2017-12-05 14:41:12 UTC
Created attachment 365029 [details] [review]
Make gschema.dtd usable.

(In reply to Philip Withnall from comment #1)
> If you’ve got any other changes to gschema.dtd, please attach them all as
> patches to the same bug report rather than opening more bug reports. It
> reduces the amount of e-mails everyone gets. :-)

Yeps, sorry with the double bug, I had the time to lose hope in making this work.

> (In reply to Arnaud B. from comment #0)
> I would happily accept a patch which rewrote the schema in RelaxNG.

Not interested enough for now in the rewrite. But I keep that idea in memory.
Comment 3 Philip Withnall 2017-12-06 10:32:30 UTC
Review of attachment 365029 [details] [review]:

++
Comment 4 Philip Withnall 2017-12-06 10:36:33 UTC
Comment on attachment 365029 [details] [review]
Make gschema.dtd usable.

Pushed to master and glib-2-54 with some rewording of the commit message to drop the trailing full-stop and make the title less generic.

2ebc78ae7 (HEAD -> master, origin/master, origin/HEAD) gio: Remove stray ‘<’ from gschema.dtd
5f3f830fc (HEAD -> glib-2-54) gio: Remove stray ‘<’ from gschema.dtd