<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Normally you start with a schema, and from that create xml. To me it<br>
sounds pretty hard to keep a schema updated the other way around? As the<br>
api can always add new/changed parts of xml in it?<br></blockquote><div><br></div><div>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?</div><div><br></div><div>Even QgsProject won't know if a project is valid until all the delegated classes have tried to deserialize their own parts.</div><div><br></div><div>I think this is a weak point in QGIS, and it doesn't depend on the serialization format obviously.</div><div><br></div><div>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.</div><div>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.</div><div><br></div><div>Otherwise we sould manually build a test project on each release, the most complete one, and manually check the differences...</div><div><br></div><div>giovanni</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Would it be a strange idea to move to another way of defining a project?<br>
Not to follow follow file format hypes and go to json, yaml or so, but<br>
if we could abstract this 'serialization' of a state of classes etc in a<br>
different way, could make it maybe easier to cut the (becoming bigger<br>
and bigger) project files in parts like:<br>
- datasource info, styling info, layerorder/extent info, other<br>
<br></blockquote><div><br></div><div>I've done some test with GraphQL :)</div><div> </div><div>giovanni</div></div></div></div>