Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a detailed description on the .qgs file structure somewhere? I checked here: ("The requested URL /qgis.dtd was not found on this server.") and here- (wasnt very detailed).

share|improve this question
Very good question, and surprised we can't find a writeup on the XML that makes up the .qgs file. It's fairly straightforward to figure out some sections and parse the file but full documentation should be somewhere! – Simbamangu Sep 11 '12 at 7:37
This good question got me a "tumbleweed" badge :D – Marty Sep 12 '12 at 8:29
Didn't even know such a thing existed! Not as bad as the 'unsung hero' badge but ouch ... can't believe no one has piped up with an answer yet. – Simbamangu Sep 12 '12 at 12:40
Here is the current file version: – markusN Sep 13 '12 at 7:05
@markusN That is pretty much the same file as the one in – R.K. Sep 16 '12 at 14:16

It would seem there isn't. According to bug report #4408:

It's not possible to validate a QGIS project or style file against the called *.dtd ( Two reasons: the URL doesn't exist and using a *.dtd from SVN always returns a "non valid". Having the possibility to validate could decrease erroneous project files. As such it's a feature wish, but as long as QGIS mentions a *.dtd not working, it's a bug.

It was filed eleven months ago and last updated eight days ago. The target version for fixing the bug's version 2.0.0, too. If there is any detailed documentation then they'd have fixed it earlier, I think.

share|improve this answer

The DTD in git is hoplessly broken, <!ELEMENT maplayer ... > has unbalanced parentheses, there are multiple --- in comments, multiple missing types; and the bug report mentioned above has been sitting idle for 4 years. Abandon hope all who wish to validate their qml/qgs files :-(

share|improve this answer
A better approach would be to find a way to get the tickets closed. – underdark Oct 25 '15 at 22:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.