<div dir="ltr"><div>Hi, </div><div><br></div><div>Sorry y hadn't been enought specific. The problem was on the images URLs.</div><div><br></div><div>I fixed it with this function:</div><div><br></div><div><div>    def fix_qml_rel_urls(self, url):</div><div>        """</div><div>        Replaces the QML URLs with plugin relative URLs</div><div><br></div><div>        :return:</div><div>        """</div><div><br></div><div>        plugin_dir = os.path.dirname(os.path.<wbr>realpath(__file__))</div><div>        with open(url, 'r') as fd:</div><div>            data = fd.read()</div><div>        f = etree.fromstring(data)</div><div>        for r in f.xpath('//qgis/renderer-v2/<wbr>symbols/symbol/layer/prop[@k="<wbr>name"]'):</div><div>            val = r.get('v')</div><div>            parent = r.getparent()</div><div>            parent.remove(r)</div><div>            rel_url = os.path.join(plugin_dir, val)</div><div>            r.set('v', rel_url)</div><div>            parent.append(r)</div><div><br></div><div>        t = etree.tostring(f, pretty_print=True)</div><div><br></div><div>        tmp_url = tempfile.NamedTemporaryFile(<wbr>suffix='.qml', delete=False)</div><div><br></div><div>        tmp_url.write(t)</div><div>        tmp_url.close()</div><div>        return <a href="http://tmp_url.name" target="_blank">tmp_url.name</a></div></div><div><br></div><div>I'm sure that this don't work on all the types of symbols but perhaps is useful for someone</div><div>After patch the style I loaded it.</div><div><br></div><div>Best reggards.</div><div>Xavier Barnada</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-10-13 14:27 GMT+02:00 Tom Chadwin <span dir="ltr"><<a href="mailto:tom.chadwin@nnpa.org.uk" target="_blank">tom.chadwin@nnpa.org.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Xavier<br>
<br>
This should give you the path to your plugin's installation folder:<br>
<br>
os.path.dirname(os.path.<wbr>realpath(__file__))<br>
<br>
Hope this is what you need.<br>
<br>
Tom<br>
<br>
<br>
<br>
-----<br>
Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Including-style-on-a-Qgis-plugin-tp5290553p5290560.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.<wbr>nabble.com/Including-style-on-<wbr>a-Qgis-plugin-<wbr>tp5290553p5290560.html</a><br>
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a></div></div></blockquote></div><br></div>