svghmi/analyse_widget.xslt
branchsvghmi
changeset 3241 fe945f1f48b7
parent 3235 b2b6bf45aa2d
child 3264 51645afeded9
equal deleted inserted replaced
3238:8a9d4c794cba 3241:fe945f1f48b7
   143     <xsl:value-of select="@type"/>
   143     <xsl:value-of select="@type"/>
   144     <xsl:apply-templates mode="genlabel" select="arg"/>
   144     <xsl:apply-templates mode="genlabel" select="arg"/>
   145     <xsl:apply-templates mode="genlabel" select="path"/>
   145     <xsl:apply-templates mode="genlabel" select="path"/>
   146   </xsl:template>
   146   </xsl:template>
   147   <xsl:variable name="hmi_elements" select="//svg:*[starts-with(@inkscape:label, 'HMI:')]"/>
   147   <xsl:variable name="hmi_elements" select="//svg:*[starts-with(@inkscape:label, 'HMI:')]"/>
       
   148   <xsl:template match="widget[@type='AnimateRotation']" mode="widget_desc">
       
   149     <type>
       
   150       <xsl:value-of select="@type"/>
       
   151     </type>
       
   152     <longdesc>
       
   153       <xsl:text>AnimateRotation - DEPRECATED, do not use.
       
   154 </xsl:text>
       
   155       <xsl:text>Doesn't follow WYSIWYG principle, and forces user to add animateTransform tag in SVG (using inkscape XML editor for exemple)
       
   156 </xsl:text>
       
   157     </longdesc>
       
   158     <shortdesc>
       
   159       <xsl:text>AnimateRotation - DEPRECATED</xsl:text>
       
   160     </shortdesc>
       
   161     <path name="speed" accepts="HMI_INT,HMI_REAL">
       
   162       <xsl:text>speed</xsl:text>
       
   163     </path>
       
   164   </xsl:template>
       
   165   <xsl:template match="widget[@type='Back']" mode="widget_desc">
       
   166     <type>
       
   167       <xsl:value-of select="@type"/>
       
   168     </type>
       
   169     <longdesc>
       
   170       <xsl:text>Back widget brings focus back to previous page in history when clicked.
       
   171 </xsl:text>
       
   172     </longdesc>
       
   173     <shortdesc>
       
   174       <xsl:text>Jump to previous page</xsl:text>
       
   175     </shortdesc>
       
   176   </xsl:template>
       
   177   <xsl:template match="widget[@type='Button']" mode="widget_desc">
       
   178     <type>
       
   179       <xsl:value-of select="@type"/>
       
   180     </type>
       
   181     <longdesc>
       
   182       <xsl:text>Button widget takes one boolean variable path, and reflect current true
       
   183 </xsl:text>
       
   184       <xsl:text>or false value by showing "active" or "inactive" labeled element
       
   185 </xsl:text>
       
   186       <xsl:text>respectively. Pressing and releasing button changes variable to true and
       
   187 </xsl:text>
       
   188       <xsl:text>false respectively. Potential inconsistency caused by quick consecutive
       
   189 </xsl:text>
       
   190       <xsl:text>presses on the button is mitigated by using a state machine that wait for
       
   191 </xsl:text>
       
   192       <xsl:text>previous state change to be reflected on variable before applying next one.
       
   193 </xsl:text>
       
   194     </longdesc>
       
   195     <shortdesc>
       
   196       <xsl:text>Push button reflecting consistently given boolean variable</xsl:text>
       
   197     </shortdesc>
       
   198     <path name="value" accepts="HMI_BOOL">
       
   199       <xsl:text>Boolean variable</xsl:text>
       
   200     </path>
       
   201   </xsl:template>
       
   202   <xsl:template match="widget[@type='CircularBar']" mode="widget_desc">
       
   203     <type>
       
   204       <xsl:value-of select="@type"/>
       
   205     </type>
       
   206     <longdesc>
       
   207       <xsl:text>CircularBar widget changes the end angle of a "path" labeled arc according
       
   208 </xsl:text>
       
   209       <xsl:text>to value of the single accepted variable.
       
   210 </xsl:text>
       
   211       <xsl:text>
       
   212 </xsl:text>
       
   213       <xsl:text>If "min" a "max" labeled texts are provided, then they are used as
       
   214 </xsl:text>
       
   215       <xsl:text>respective minimum and maximum value. Otherwise, value is expected to be
       
   216 </xsl:text>
       
   217       <xsl:text>in between 0 and 100.
       
   218 </xsl:text>
       
   219       <xsl:text>
       
   220 </xsl:text>
       
   221       <xsl:text>If "value" labeled text is found, then its content is replaced by value.
       
   222 </xsl:text>
       
   223     </longdesc>
       
   224     <shortdesc>
       
   225       <xsl:text>Change end angle of Inkscape's arc</xsl:text>
       
   226     </shortdesc>
       
   227     <path name="value" accepts="HMI_INT,HMI_REAL">
       
   228       <xsl:text>Value to display</xsl:text>
       
   229     </path>
       
   230   </xsl:template>
       
   231   <xsl:template match="widget[@type='CircularSlider']" mode="widget_desc">
       
   232     <type>
       
   233       <xsl:value-of select="@type"/>
       
   234     </type>
       
   235     <longdesc>
       
   236       <xsl:text>CircularSlider - DEPRECATED, to be replaced by PathSlider
       
   237 </xsl:text>
       
   238       <xsl:text>This widget moves "handle" labeled group along "range" labeled
       
   239 </xsl:text>
       
   240       <xsl:text>arc, according to value of the single accepted variable.
       
   241 </xsl:text>
       
   242       <xsl:text>
       
   243 </xsl:text>
       
   244       <xsl:text>If "min" a "max" labeled texts are provided, or if first and second
       
   245 </xsl:text>
       
   246       <xsl:text>argument are given, then they are used as respective minimum and maximum
       
   247 </xsl:text>
       
   248       <xsl:text>value. Otherwise, value is expected to be in between 0 and 100.
       
   249 </xsl:text>
       
   250       <xsl:text>
       
   251 </xsl:text>
       
   252       <xsl:text>If "value" labeled text is found, then its content is replaced by value.
       
   253 </xsl:text>
       
   254       <xsl:text>During drag, "setpoint" labeled group is moved to position defined by user
       
   255 </xsl:text>
       
   256       <xsl:text>while "handle" reflects current value from variable.
       
   257 </xsl:text>
       
   258     </longdesc>
       
   259     <shortdesc>
       
   260       <xsl:text>CircularSlider - DEPRECATED</xsl:text>
       
   261     </shortdesc>
       
   262     <arg name="min" count="optional" accepts="int,real">
       
   263       <xsl:text>minimum value</xsl:text>
       
   264     </arg>
       
   265     <arg name="min" count="optional" accepts="int,real">
       
   266       <xsl:text>maximum value</xsl:text>
       
   267     </arg>
       
   268     <path name="value" accepts="HMI_INT,HMI_REAL">
       
   269       <xsl:text>Value to display</xsl:text>
       
   270     </path>
       
   271   </xsl:template>
       
   272   <xsl:template match="widget[@type='CustomHtml']" mode="widget_desc">
       
   273     <type>
       
   274       <xsl:value-of select="@type"/>
       
   275     </type>
       
   276     <longdesc>
       
   277       <xsl:text>CustomHtml widget allows insertion of HTML code in a svg:foreignObject.
       
   278 </xsl:text>
       
   279       <xsl:text>Widget content is replaced by foreignObject. HTML code is obtained from
       
   280 </xsl:text>
       
   281       <xsl:text>"code" labeled text content. HTML insert position and size is given with
       
   282 </xsl:text>
       
   283       <xsl:text>"container" labeled element.
       
   284 </xsl:text>
       
   285     </longdesc>
       
   286     <shortdesc>
       
   287       <xsl:text>Custom HTML insert</xsl:text>
       
   288     </shortdesc>
       
   289   </xsl:template>
       
   290   <xsl:template match="widget[@type='Display']" mode="widget_desc">
       
   291     <type>
       
   292       <xsl:value-of select="@type"/>
       
   293     </type>
       
   294     <longdesc>
       
   295       <xsl:text>If Display widget is a svg:text element, then text content is replaced by
       
   296 </xsl:text>
       
   297       <xsl:text>value of given variables, space separated.
       
   298 </xsl:text>
       
   299       <xsl:text>
       
   300 </xsl:text>
       
   301       <xsl:text>Otherwise, if Display widget is a group containing a svg:text element
       
   302 </xsl:text>
       
   303       <xsl:text>labelled "format", then text content is replaced by printf-like formated
       
   304 </xsl:text>
       
   305       <xsl:text>string. In other words, if "format" labeled text is "%d %s %f", then 3
       
   306 </xsl:text>
       
   307       <xsl:text>variables paths are expected : HMI_IN, HMI_STRING and HMI_REAL.
       
   308 </xsl:text>
       
   309       <xsl:text>
       
   310 </xsl:text>
       
   311       <xsl:text>In case Display widget is a svg::text element, it is also possible to give
       
   312 </xsl:text>
       
   313       <xsl:text>format string as first argument.
       
   314 </xsl:text>
       
   315     </longdesc>
       
   316     <shortdesc>
       
   317       <xsl:text>Printf-like formated text display </xsl:text>
       
   318     </shortdesc>
       
   319     <arg name="format" count="optional" accepts="string">
       
   320       <xsl:text>printf-like format string when not given as svg:text</xsl:text>
       
   321     </arg>
       
   322     <path name="fields" count="many" accepts="HMI_INT,HMI_REAL,HMI_STRING,HMI_BOOL">
       
   323       <xsl:text>variables to be displayed</xsl:text>
       
   324     </path>
       
   325   </xsl:template>
       
   326   <xsl:template match="widget[@type='DropDown']" mode="widget_desc">
       
   327     <type>
       
   328       <xsl:value-of select="@type"/>
       
   329     </type>
       
   330     <longdesc>
       
   331       <xsl:text>DropDown widget let user select an entry in a list of texts, given as
       
   332 </xsl:text>
       
   333       <xsl:text>arguments. Single variable path is index of selection.
       
   334 </xsl:text>
       
   335       <xsl:text>
       
   336 </xsl:text>
       
   337       <xsl:text>It needs "text" (svg:text), "box" (svg:rect), "button" (svg:*),
       
   338 </xsl:text>
       
   339       <xsl:text>and "highlight" (svg:rect) labeled elements.
       
   340 </xsl:text>
       
   341       <xsl:text>
       
   342 </xsl:text>
       
   343       <xsl:text>When user clicks on "button", "text" is duplicated to display enties in the
       
   344 </xsl:text>
       
   345       <xsl:text>limit of available space in page, and "box" is extended to contain all
       
   346 </xsl:text>
       
   347       <xsl:text>texts. "highlight" is moved over pre-selected entry.
       
   348 </xsl:text>
       
   349       <xsl:text>
       
   350 </xsl:text>
       
   351       <xsl:text>When only one argument is given, and argment contains "#langs" then list of
       
   352 </xsl:text>
       
   353       <xsl:text>texts is automatically set to the list of human-readable languages supported
       
   354 </xsl:text>
       
   355       <xsl:text>by this HMI. 
       
   356 </xsl:text>
       
   357     </longdesc>
       
   358     <shortdesc>
       
   359       <xsl:text>Let user select text entry in a drop-down menu</xsl:text>
       
   360     </shortdesc>
       
   361     <arg name="entries" count="many" accepts="string">
       
   362       <xsl:text>drop-down menu entries</xsl:text>
       
   363     </arg>
       
   364     <path name="selection" accepts="HMI_INT">
       
   365       <xsl:text>selection index</xsl:text>
       
   366     </path>
       
   367   </xsl:template>
       
   368   <xsl:template match="widget[@type='ForEach']" mode="widget_desc">
       
   369     <type>
       
   370       <xsl:value-of select="@type"/>
       
   371     </type>
       
   372     <longdesc>
       
   373       <xsl:text>ForEach widget is used to span a small set of widget over a larger set of
       
   374 </xsl:text>
       
   375       <xsl:text>repeated HMI_NODEs. 
       
   376 </xsl:text>
       
   377       <xsl:text>
       
   378 </xsl:text>
       
   379       <xsl:text>Idea is somewhat similar to relative page, but it all happens inside the
       
   380 </xsl:text>
       
   381       <xsl:text>ForEach widget, no page involved.
       
   382 </xsl:text>
       
   383       <xsl:text>
       
   384 </xsl:text>
       
   385       <xsl:text>Together with relative Jump widgets it can be used to build a menu to reach
       
   386 </xsl:text>
       
   387       <xsl:text>relative pages covering many identical HMI_NODES siblings.
       
   388 </xsl:text>
       
   389       <xsl:text>
       
   390 </xsl:text>
       
   391       <xsl:text>ForEach widget takes a HMI_CLASS name as argument and a HMI_NODE path as
       
   392 </xsl:text>
       
   393       <xsl:text>variable.
       
   394 </xsl:text>
       
   395       <xsl:text>
       
   396 </xsl:text>
       
   397       <xsl:text>Direct sub-elements can be either groups of widget to be spanned, labeled
       
   398 </xsl:text>
       
   399       <xsl:text>"ClassName:offset", or buttons to control the spanning, labeled
       
   400 </xsl:text>
       
   401       <xsl:text>"ClassName:+/-number".
       
   402 </xsl:text>
       
   403     </longdesc>
       
   404     <shortdesc>
       
   405       <xsl:text>span widgets over a set of repeated HMI_NODEs</xsl:text>
       
   406     </shortdesc>
       
   407     <arg name="class_name" accepts="string">
       
   408       <xsl:text>HMI_CLASS name</xsl:text>
       
   409     </arg>
       
   410     <path name="root" accepts="HMI_NODE">
       
   411       <xsl:text> where to find HMI_NODEs whose HMI_CLASS is class_name</xsl:text>
       
   412     </path>
       
   413   </xsl:template>
       
   414   <xsl:template match="widget[@type='Input']" mode="widget_desc">
       
   415     <type>
       
   416       <xsl:value-of select="@type"/>
       
   417     </type>
       
   418     <longdesc>
       
   419       <xsl:text>Input widget takes one variable path, and displays current value in
       
   420 </xsl:text>
       
   421       <xsl:text>optional "value" labeled sub-element. 
       
   422 </xsl:text>
       
   423       <xsl:text>
       
   424 </xsl:text>
       
   425       <xsl:text>Click on optional "edit" labeled element opens keypad to edit value.
       
   426 </xsl:text>
       
   427       <xsl:text>
       
   428 </xsl:text>
       
   429       <xsl:text>Operation on current value is performed when click on sub-elements with
       
   430 </xsl:text>
       
   431       <xsl:text>label starting with '=', '+' or '-' sign. Value after sign is used as
       
   432 </xsl:text>
       
   433       <xsl:text>operand.
       
   434 </xsl:text>
       
   435     </longdesc>
       
   436     <shortdesc>
       
   437       <xsl:text>Input field with predefined operation buttons</xsl:text>
       
   438     </shortdesc>
       
   439     <arg name="format" accepts="string">
       
   440       <xsl:text>optional printf-like format </xsl:text>
       
   441     </arg>
       
   442     <path name="edit" accepts="HMI_INT, HMI_REAL, HMI_STRING">
       
   443       <xsl:text>single variable to edit</xsl:text>
       
   444     </path>
       
   445   </xsl:template>
       
   446   <xsl:template match="widget[@type='JsonTable']" mode="widget_desc">
       
   447     <type>
       
   448       <xsl:value-of select="@type"/>
       
   449     </type>
       
   450     <longdesc>
       
   451       <xsl:text>Send given variables as POST to http URL argument, spread returned JSON in
       
   452 </xsl:text>
       
   453       <xsl:text>SVG sub-elements of "data" labeled element.
       
   454 </xsl:text>
       
   455       <xsl:text>
       
   456 </xsl:text>
       
   457       <xsl:text>Documentation to be written. see svbghmi exemple.
       
   458 </xsl:text>
       
   459     </longdesc>
       
   460     <shortdesc>
       
   461       <xsl:text>Http POST variables, spread JSON back</xsl:text>
       
   462     </shortdesc>
       
   463     <arg name="url" accepts="string">
       
   464       <xsl:text> </xsl:text>
       
   465     </arg>
       
   466     <path name="edit" accepts="HMI_INT, HMI_REAL, HMI_STRING">
       
   467       <xsl:text>single variable to edit</xsl:text>
       
   468     </path>
       
   469   </xsl:template>
       
   470   <xsl:template match="widget[@type='Jump']" mode="widget_desc">
       
   471     <type>
       
   472       <xsl:value-of select="@type"/>
       
   473     </type>
       
   474     <longdesc>
       
   475       <xsl:text>Jump widget brings focus to a different page. Mandatory single argument
       
   476 </xsl:text>
       
   477       <xsl:text>gives name of the page.
       
   478 </xsl:text>
       
   479       <xsl:text>
       
   480 </xsl:text>
       
   481       <xsl:text>Optional single path is used as new reference when jumping to a relative
       
   482 </xsl:text>
       
   483       <xsl:text>page, it must point to a HMI_NODE.
       
   484 </xsl:text>
       
   485       <xsl:text>
       
   486 </xsl:text>
       
   487       <xsl:text>"active"+"inactive" labeled elements can be provided and reflect current
       
   488 </xsl:text>
       
   489       <xsl:text>page being shown.
       
   490 </xsl:text>
       
   491       <xsl:text>
       
   492 </xsl:text>
       
   493       <xsl:text>"disabled" labeled element, if provided, is shown instead of "active" or
       
   494 </xsl:text>
       
   495       <xsl:text>"inactive" widget when pointed HMI_NODE is null.
       
   496 </xsl:text>
       
   497     </longdesc>
       
   498     <shortdesc>
       
   499       <xsl:text>Jump to given page</xsl:text>
       
   500     </shortdesc>
       
   501     <arg name="page" accepts="string">
       
   502       <xsl:text>name of page to jump to</xsl:text>
       
   503     </arg>
       
   504     <path name="reference" count="optional" accepts="HMI_NODE">
       
   505       <xsl:text>reference for relative jump</xsl:text>
       
   506     </path>
       
   507   </xsl:template>
       
   508   <xsl:template match="widget[@type='Keypad']" mode="widget_desc">
       
   509     <type>
       
   510       <xsl:value-of select="@type"/>
       
   511     </type>
       
   512     <longdesc>
       
   513       <xsl:text>Keypad - to be written
       
   514 </xsl:text>
       
   515     </longdesc>
       
   516     <shortdesc>
       
   517       <xsl:text>Keypad </xsl:text>
       
   518     </shortdesc>
       
   519     <arg name="supported_types" accepts="string">
       
   520       <xsl:text>keypad can input those types </xsl:text>
       
   521     </arg>
       
   522   </xsl:template>
       
   523   <xsl:template match="widget[@type='List']" mode="widget_desc">
       
   524     <type>
       
   525       <xsl:value-of select="@type"/>
       
   526     </type>
       
   527   </xsl:template>
       
   528   <xsl:template match="widget[@type='Meter']" mode="widget_desc">
       
   529     <type>
       
   530       <xsl:value-of select="@type"/>
       
   531     </type>
       
   532     <longdesc>
       
   533       <xsl:text>Meter widget moves the end of "needle" labeled path along "range" labeled
       
   534 </xsl:text>
       
   535       <xsl:text>path, according to value of the single accepted variable.
       
   536 </xsl:text>
       
   537       <xsl:text>
       
   538 </xsl:text>
       
   539       <xsl:text>Needle is reduced to a single segment. If "min" a "max" labeled texts
       
   540 </xsl:text>
       
   541       <xsl:text>are provided, or if first and second argument are given, then they are used
       
   542 </xsl:text>
       
   543       <xsl:text>as respective minimum and maximum value. Otherwise, value is expected to be
       
   544 </xsl:text>
       
   545       <xsl:text>in between 0 and 100.
       
   546 </xsl:text>
       
   547       <xsl:text>
       
   548 </xsl:text>
       
   549       <xsl:text>If "value" labeled text is found, then its content is replaced by value.
       
   550 </xsl:text>
       
   551     </longdesc>
       
   552     <shortdesc>
       
   553       <xsl:text>Moves "needle" along "range"</xsl:text>
       
   554     </shortdesc>
       
   555     <arg name="min" count="optional" accepts="int,real">
       
   556       <xsl:text>minimum value</xsl:text>
       
   557     </arg>
       
   558     <arg name="max" count="optional" accepts="int,real">
       
   559       <xsl:text>maximum value</xsl:text>
       
   560     </arg>
       
   561     <path name="value" accepts="HMI_INT,HMI_REAL">
       
   562       <xsl:text>Value to display</xsl:text>
       
   563     </path>
       
   564   </xsl:template>
       
   565   <xsl:template match="widget[@type='ScrollBar']" mode="widget_desc">
       
   566     <type>
       
   567       <xsl:value-of select="@type"/>
       
   568     </type>
       
   569     <longdesc>
       
   570       <xsl:text>ScrollBar - documentation to be written
       
   571 </xsl:text>
       
   572     </longdesc>
       
   573     <shortdesc>
       
   574       <xsl:text>ScrollBar</xsl:text>
       
   575     </shortdesc>
       
   576     <path name="value" accepts="HMI_INT">
       
   577       <xsl:text>value</xsl:text>
       
   578     </path>
       
   579     <path name="range" accepts="HMI_INT">
       
   580       <xsl:text>range</xsl:text>
       
   581     </path>
       
   582     <path name="visible" accepts="HMI_INT">
       
   583       <xsl:text>visible</xsl:text>
       
   584     </path>
       
   585   </xsl:template>
       
   586   <xsl:template match="widget[@type='Slider']" mode="widget_desc">
       
   587     <type>
       
   588       <xsl:value-of select="@type"/>
       
   589     </type>
       
   590     <longdesc>
       
   591       <xsl:text>Slider - DEPRECATED - use ScrollBar or PathSlider instead
       
   592 </xsl:text>
       
   593     </longdesc>
       
   594     <shortdesc>
       
   595       <xsl:text>Slider - DEPRECATED - use ScrollBar instead</xsl:text>
       
   596     </shortdesc>
       
   597     <path name="value" accepts="HMI_INT">
       
   598       <xsl:text>value</xsl:text>
       
   599     </path>
       
   600     <path name="range" accepts="HMI_INT">
       
   601       <xsl:text>range</xsl:text>
       
   602     </path>
       
   603     <path name="visible" accepts="HMI_INT">
       
   604       <xsl:text>visible</xsl:text>
       
   605     </path>
       
   606   </xsl:template>
       
   607   <xsl:template match="widget[@type='Switch']" mode="widget_desc">
       
   608     <type>
       
   609       <xsl:value-of select="@type"/>
       
   610     </type>
       
   611     <longdesc>
       
   612       <xsl:text>Switch widget hides all subelements whose label do not match given
       
   613 </xsl:text>
       
   614       <xsl:text>variable current value representation. For exemple if given variable type
       
   615 </xsl:text>
       
   616       <xsl:text>is HMI_INT and value is 1, then elements with label '1' will be displayed.
       
   617 </xsl:text>
       
   618       <xsl:text>Label can have comments, so '1#some comment' would also match. If matching
       
   619 </xsl:text>
       
   620       <xsl:text>variable of type HMI_STRING, then double quotes must be used. For exemple,
       
   621 </xsl:text>
       
   622       <xsl:text>'"hello"' or '"hello"#another comment' match HMI_STRING 'hello'.
       
   623 </xsl:text>
       
   624     </longdesc>
       
   625     <shortdesc>
       
   626       <xsl:text>Show elements whose label match value.</xsl:text>
       
   627     </shortdesc>
       
   628     <path name="value" accepts="HMI_INT,HMI_STRING">
       
   629       <xsl:text>value to compare to labels</xsl:text>
       
   630     </path>
       
   631   </xsl:template>
       
   632   <xsl:template match="widget[@type='ToggleButton']" mode="widget_desc">
       
   633     <type>
       
   634       <xsl:value-of select="@type"/>
       
   635     </type>
       
   636     <longdesc>
       
   637       <xsl:text>Button widget takes one boolean variable path, and reflect current true
       
   638 </xsl:text>
       
   639       <xsl:text>or false value by showing "active" or "inactive" labeled element
       
   640 </xsl:text>
       
   641       <xsl:text>respectively. Clicking or touching button toggles variable.
       
   642 </xsl:text>
       
   643     </longdesc>
       
   644     <shortdesc>
       
   645       <xsl:text>Toggle button reflecting given boolean variable</xsl:text>
       
   646     </shortdesc>
       
   647     <path name="value" accepts="HMI_BOOL">
       
   648       <xsl:text>Boolean variable</xsl:text>
       
   649     </path>
       
   650   </xsl:template>
       
   651   <xsl:template mode="document" match="@* | node()">
       
   652     <xsl:copy>
       
   653       <xsl:apply-templates mode="document" select="@* | node()"/>
       
   654     </xsl:copy>
       
   655   </xsl:template>
       
   656   <xsl:template mode="document" match="widget">
       
   657     <xsl:copy>
       
   658       <xsl:apply-templates mode="document" select="@* | node()"/>
       
   659       <defs>
       
   660         <xsl:apply-templates mode="widget_desc" select="."/>
       
   661       </defs>
       
   662     </xsl:copy>
       
   663   </xsl:template>
   148   <xsl:template match="/">
   664   <xsl:template match="/">
       
   665     <xsl:variable name="widgets">
       
   666       <xsl:apply-templates mode="parselabel" select="$hmi_elements"/>
       
   667     </xsl:variable>
       
   668     <xsl:variable name="widget_ns" select="exsl:node-set($widgets)"/>
   149     <widgets>
   669     <widgets>
   150       <xsl:apply-templates mode="parselabel" select="$hmi_elements"/>
   670       <xsl:apply-templates mode="document" select="$widget_ns"/>
   151     </widgets>
   671     </widgets>
   152   </xsl:template>
   672   </xsl:template>
   153 </xsl:stylesheet>
   673 </xsl:stylesheet>