# HG changeset patch # User Edouard Tisserant # Date 1617710648 -7200 # Node ID 507dd7bc8cb57f6809ec0924d881d2731b32cd31 # Parent 061796d9855e35ccbdb04a7bcc9f455fb62dc0f4 SVGHMI: Widget transform before DnD now have HMI path as a parameter diff -r 061796d9855e -r 507dd7bc8cb5 svghmi/gen_dnd_widget_svg.xslt --- a/svghmi/gen_dnd_widget_svg.xslt Tue Apr 06 11:47:07 2021 +0200 +++ b/svghmi/gen_dnd_widget_svg.xslt Tue Apr 06 14:04:08 2021 +0200 @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:str="http://exslt.org/strings" xmlns:func="http://exslt.org/functions" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ns="beremiz" version="1.0" extension-element-prefixes="ns func exsl regexp str dyn" exclude-result-prefixes="ns func exsl regexp str dyn"> +<xsl:stylesheet xmlns:func="http://exslt.org/functions" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:str="http://exslt.org/strings" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exsl="http://exslt.org/common" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ns="beremiz" xmlns:cc="http://creativecommons.org/ns#" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" extension-element-prefixes="ns func exsl regexp str dyn" version="1.0" exclude-result-prefixes="ns func exsl regexp str dyn"> <xsl:output method="xml"/> <xsl:param name="hmi_path"/> <xsl:variable name="svg" select="/svg:svg"/> diff -r 061796d9855e -r 507dd7bc8cb5 svghmi/hmi_tree.py --- a/svghmi/hmi_tree.py Tue Apr 06 11:47:07 2021 +0200 +++ b/svghmi/hmi_tree.py Tue Apr 06 14:04:08 2021 +0200 @@ -125,7 +125,9 @@ # hash is computed on demand node = cls(path, name, nodetype, hmiclass=hmiclass) for child in enode.iterchildren(): - node.children.append(cls.from_etree(child)) + newnode = cls.from_etree(child) + newnode.parent = weakref.ref(node) + node.children.append(newnode) return node def traverse(self):