diff -r fbdd0fd8ee4f -r 723e420dfe72 svghmi/gen_index_xhtml.ysl2 --- a/svghmi/gen_index_xhtml.ysl2 Thu Sep 19 10:41:39 2019 +0200 +++ b/svghmi/gen_index_xhtml.ysl2 Thu Sep 19 15:32:36 2019 +0200 @@ -33,6 +33,8 @@ xsl:copy apply "@* | node()"; } + variable "mark" > =HMI=\n + /* copy root node and add geometry as comment for a test */ template "/" html xmlns="http://www.w3.org/1999/xhtml" { @@ -48,16 +50,34 @@ apply "@* | node()"; } script{ + variable "midmark" > \n«$mark» + apply """//*[contains(child::svg:desc, $midmark) or \ + starts-with(child::svg:desc, $mark)]""", + mode="code_from_descs"; + | + /*TODO add : - pages content + with ref to elt ? - widgets parameters */ + include text svghmi.js } } } + template "*", mode="code_from_descs" { + | function js_«@id»() { + | var path, role, path, priv; + | + value "substring-after(svg:desc, $mark)"; + | + | } + | + } + + template "bbox", mode="testgeo"{ | ID: «@Id» x: «@x» y: «@y» w: «@w» h: «@h» }