<div dir="ltr"><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small">Hi Denis</div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small">You may also want to take a peek at the GeoStyler (<a href="https://geostyler.org/">https://geostyler.org/</a>) project which attempts to be a babel fish for different style formats, including QGIS QML. I am guessing they have some kind of conceptual mapping, at least between the shared concepts within the various formats they support.</div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:small">Tim</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Aug 28, 2026 at 1:17 AM Nyall Dawson via QGIS-Developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 28 Aug 2026 at 10:06, Denis Rykov via QGIS-Developer<br>
<<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I’m currently exploring how to use an LLM/AI to generate valid QGIS .qml styles from natural-language prompts. One difficulty I’ve encountered is that, as far as I know, there is no formal or exhaustive schema for the QML format describing both the XML hierarchy and the semantics of all elements, attributes, renderers, symbol layers, labeling settings, etc. I’m currently investigating whether PyQGIS can be used to discover this information programmatically. I can create QGIS objects, serialize them using QGIS itself, and recursively inspect the resulting DOM. This provides information about the actual XML hierarchy, attributes, default values, and property definitions. Before going further, however, I wanted to ask the QGIS developers whether there is a more canonical approach.<br>
><br>
> In particular:<br>
><br>
> Is there an existing source of truth for the QML structure/schema that I may have missed?<br>
<br>
No -- it's considered an internal private detail only, and changes<br>
many times throughout the release cycle (while maintaining<br>
compatibility with existing QML files!).<br>
<br>
> Is the QML format intentionally undocumented/non-schema-based,<br>
<br>
Yes<br>
<br>
> with the QGIS C++ serialization code effectively serving as the authoritative specification?<br>
<br>
Kind of -- but again, it's intentionally NOT a fixed specification at<br>
all, but just a reflection of what QGIS internal classes need to store<br>
for any particular release.<br>
<br>
> Would using PyQGIS to instantiate the different renderers, symbol layers, labeling configurations, etc., and then inspecting their QDomDocument serialization be a reasonable way to generate a machine-readable schema?<br>
<br>
Possibly, yes, if you're just interested in generating XML that QGIS<br>
will consume. If you're attempting to READ xml that qgis produces then<br>
the recommended approach is always to just use QGIS api directly to<br>
read this, and then extract properties from the resulting symbols<br>
using the stable API.<br>
<br>
Nyall<br>
<br>
> Are there particular QGIS APIs or parts of the source tree that you would recommend for this purpose?<br>
><br>
> I’d appreciate any advice on whether this is the right direction, or whether there is a more appropriate way to obtain or generate such a schema from QGIS itself.<br>
> _______________________________________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><br><div><div style="color:rgb(34,34,34)">Tim Sutton</div><div style="color:rgb(34,34,34)"><b>Kartoza Cofounder<br></b><span style="color:rgb(32,33,36);text-align:center">Tim is a member of the QGIS Project Steering Committee</span><b><br></b></div><div style="color:rgb(34,34,34)"><b><br></b></div><div style="color:rgb(34,34,34)"><b>E </b>:<b> </b><a href="mailto:tim@kartoza.com" style="color:rgb(17,85,204)" target="_blank">tim@kartoza.com</a> <b>W</b> : <a href="http://kartoza.com/" style="color:rgb(17,85,204)" target="_blank">kartoza.com</a><br></div><div style="color:rgb(34,34,34)"><br></div><div style="color:rgb(34,34,34)"><div><i><img src="https://kartoza.com/files/KartozaEmailSignature.gif" width="420" height="77"><br></i></div><div><i><br></i></div><div><i>This email and any attachments are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you </i><div><i>have received this email in error, please notify the sender immediately and delete it from your system. Unauthorised use, disclosure, or copying</i></div><div><i>of the contents is prohibited.</i></div></div></div></div></div></div>