# HG changeset patch # User Edouard Tisserant # Date 1580391186 -3600 # Node ID e74123b966ac1fd54f56e40c9fb99a385fbd89e3 # Parent e9ba4dee6ffb05ac0405157ab91a47d030db5c2d SVGHMI : fixed bug happening when some SVG ids are containing dashes diff -r e9ba4dee6ffb -r e74123b966ac svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Thu Jan 23 13:46:05 2020 +0100 +++ b/svghmi/gen_index_xhtml.xslt Thu Jan 30 14:33:06 2020 +0100 @@ -203,8 +203,9 @@ + " - : { + ": { type: " @@ -319,8 +320,9 @@ widgets: [ - hmi_widgets. + hmi_widgets[" + "] , diff -r e9ba4dee6ffb -r e74123b966ac svghmi/gen_index_xhtml.ysl2 --- a/svghmi/gen_index_xhtml.ysl2 Thu Jan 23 13:46:05 2020 +0100 +++ b/svghmi/gen_index_xhtml.ysl2 Thu Jan 30 14:33:06 2020 +0100 @@ -217,7 +217,7 @@ | var hmi_widgets = { foreach "$hmi_elements" { const "widget", "func:parselabel(@inkscape:label)/widget"; - | «@id»: { + | "«@id»": { | type: "«$widget/@type»", | args: [ foreach "$widget/arg" @@ -263,7 +263,7 @@ | bbox: [«$p/@x», «$p/@y», «$p/@w», «$p/@h»], | widgets: [ foreach "$page_ids" { - | hmi_widgets.«.»`if "position()!=last()" > ,` + | hmi_widgets["«.»"]`if "position()!=last()" > ,` } | ] | }`if "position()!=last()" > ,` diff -r e9ba4dee6ffb -r e74123b966ac tests/svghmi/svghmi_0@svghmi/svghmi.svg --- a/tests/svghmi/svghmi_0@svghmi/svghmi.svg Thu Jan 23 13:46:05 2020 +0100 +++ b/tests/svghmi/svghmi_0@svghmi/svghmi.svg Thu Jan 30 14:33:06 2020 +0100 @@ -124,12 +124,12 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:document-units="px" - inkscape:current-layer="g208" + inkscape:current-layer="hmi0" showgrid="false" units="px" - inkscape:zoom="2" - inkscape:cx="275.28708" - inkscape:cy="344.53292" + inkscape:zoom="0.35355339" + inkscape:cx="-314.31196" + inkscape:cy="282.25622" inkscape:window-width="1600" inkscape:window-height="886" inkscape:window-x="0" @@ -935,7 +935,7 @@ sodipodi:role="line">8888 mhe + + 8888 + + + + dhu + + + + plop + + + + mhoo + + + + yodl + + + + mhe + +