[QGIS-Developer] QGIS project XSD

G. Allegri giohappy at gmail.com
Fri Jun 30 02:32:43 PDT 2017


>
> Normally you start with a schema, and from that create xml. To me it
> sounds pretty hard to keep a schema updated the other way around? As the
> api can always add new/changed parts of xml in it?
>

Yes, that's hard, but it's quite odd to have a project serialization format
(in this case XML) without ever knowing how it will be until you don't
create it through some APIs. Isn't it?

Even QgsProject won't know if a project is valid until all the delegated
classes have tried to deserialize their own parts.

I think this is a weak point in QGIS, and it doesn't depend on the
serialization format obviously.

The only automatic way to obatin and XSD would be to make each contributing
class declare (somehow) what and how it will write it, and a metadata
system to let an utility grab all the declarations to build the XSD.
It's not an easy task, and it would require a lot of additions to each
class, but this would be the only strong way to obtain a (potentially)
error free and up to date schema.

Otherwise we sould manually build a test project on each release, the most
complete one, and manually check the differences...

giovanni



>
> Would it be a strange idea to move to another way of defining a project?
> Not to follow follow file format hypes and go to json, yaml or so, but
> if we could abstract this 'serialization' of a state of classes etc in a
> different way, could make it maybe easier to cut the (becoming bigger
> and bigger) project files in parts like:
> - datasource info, styling info, layerorder/extent info, other
>
>
I've done some test with GraphQL :)

giovanni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170630/b05bc81b/attachment-0001.html>


More information about the QGIS-Developer mailing list