Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

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

Where I can find qml specification which is used for store symbology information in QGIS? Try to googe it - no result.

share|improve this question

There's nothing complicated about qml files, there just simple plain text XML files.

If you load one into notepad you'll see the layout is fairly straight forward.

You have a


tag that lists the version that created it among other things

Within this tag you have a


tag that holds transparency level info, a


tag which appears to be instructions to the QGis rendering engine on how to draw the styles, and then within that renderer you have layer specific style information.

In my case because I saved some styles used for a categorised data set, I have a


tag listing individual


tags that describe each category, and a


tag that includes a collection of


tags describing each symbol in the style set.

Further down it looks like there are entries for the layers name, label visibility, editing types and column names for the attributes in a layer.

It's all very straight forward to read, you just need to know how to pull apart the XML in the language you've chosen to use to manipulate them.

There's even a DTD address listed in the file, so loading the file into a DTD aware editor such as oxygeneXML should only allow you to enter legal tags in a legal order, however when I tried to access the DTD the web address was not found so you may want to check that one out further.

share|improve this answer
What you provide is not specification. I'm looking for document which describes all qml tags and their purposes, like OGC SLD standard. – drnextgis Sep 27 '12 at 13:51
Please read the last paragraph in my reply, starting : 'There's even a DTD.....' the DTD in question is embeded in the first line of the XML file, in XML file terms the DTD IS the specification. – shawty Sep 27 '12 at 13:58
Theres nothing complicated about a simple project file. But as you go deeper, you'll find the world of composers, labels and symbols, and it aint so easy anymore. There's no description or explanation you can use, just have to find out as you go. The DTD? Did you check the DTD? I get the answer- "The requested URL /qgis.dtd was not found on this server." You can check but thats not very useful either. – Marty Sep 27 '12 at 14:05
Again, please read the last paragraph in my reply for your answer :-) – shawty Sep 27 '12 at 14:41
As for the DTD on the contrary, it's very useful : a correctly formed DTD will tell you what you can and cannot put in an XML file created using it, in most cases when using a good editor it will also tell you the data type and (In the case of visual studio) will even give intellisense to show the compound types under a tag. All that leaves you to do is a little bit of research as to what the tags and attributes hold, which in most cases is fairly self explanatory. Iv'e done it loads of times with different XML files. – shawty Sep 27 '12 at 14:45

I was interested also in this specification, especially to understand what was the purpose of the last parameter for color and color_border. RGB and ??

Edit I found it, the last parameter stands for "Alpha".

share|improve this answer

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.