[QGIS-Developer] QGIS project XSD

Richard Duivenvoorde rdmailings at duif.net
Fri Jun 30 02:05:50 PDT 2017


On 30-06-17 10:45, Matthias Kuhn 🌍 wrote:
> Hi Giovanni,
> 
> On 06/30/2017 10:35 AM, G. Allegri wrote:
>> Hi everybody,
>> I know this has been discussed in the past, and maybe I missed more
>> recent discussions, but I think this is a point that should be considered.
>>
>> Working a lot with QGIS projects parsing and processing, we have to rely
>> on trials and errors to validate a QGIS project and create test projects
>> on every QGIS release to verify our paresers to be aligned with each
>> version.
> 
> I mostly use the API (which is much more stable than the project file
> format) when I need to work with a project file.
> 
>> I see that a very old (15 years) Qgis.xsd is still in the QGIS sources [1]. 
> 
> I noticed that one as well and wouldn't mind to dump it.
> 
>>
>> First of all I would get rid of it, being outdated and (I guess) unused.
>> Then I would remove the DOCTYPE declaration from the project XML and use
>> a Schema declaration instead, pointing to a versioned XSD.
>>
>> XSDs could have their own versioning scheme, or keep it simple and let
>> XSD versions be strictly the same as QGIS's version (reported inside the
>> project file).
> 
> 
> Having an .xsd sounds like a good thing to have. What would you need to
> maintain such a file?

Some related historical notes:

[0]
http://osgeo-org.1560.x6.nabble.com/QGIS-Server-Enhance-http-qgis-org-wms-1-3-0-xsd-and-WMS-1-3-0-compliance-td5175785.html

[1] https://issues.qgis.org/issues/4408

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?

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

Which would then make it easier to port a project file to one datasource
to another (and keeping the id's)...

Regards,

Richard Duivenvoorde


More information about the QGIS-Developer mailing list