svghmi/analyse_widget.xslt
author Edouard Tisserant <edouard.tisserant@gmail.com>
Mon, 03 May 2021 00:04:08 +0200
branchsvghmi
changeset 3235 b2b6bf45aa2d
child 3241 fe945f1f48b7
permissions -rw-r--r--
SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
3235
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
<?xml version="1.0"?>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
<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:svg="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.0" extension-element-prefixes="ns func exsl regexp str dyn" exclude-result-prefixes="ns func exsl regexp str dyn svg inkscape">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
  <xsl:output method="xml"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     4
  <xsl:variable name="indexed_hmitree" select="/.."/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     5
  <xsl:variable name="pathregex" select="'^([^\[,]+)(\[[^\]]+\])?([\d,]*)$'"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     6
  <xsl:template mode="parselabel" match="*">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     7
    <xsl:variable name="label" select="@inkscape:label"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     8
    <xsl:variable name="id" select="@id"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     9
    <xsl:variable name="description" select="substring-after($label,'HMI:')"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    10
    <xsl:variable name="_args" select="substring-before($description,'@')"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    11
    <xsl:variable name="args">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    12
      <xsl:choose>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    13
        <xsl:when test="$_args">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    14
          <xsl:value-of select="$_args"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    15
        </xsl:when>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    16
        <xsl:otherwise>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    17
          <xsl:value-of select="$description"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    18
        </xsl:otherwise>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    19
      </xsl:choose>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    20
    </xsl:variable>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    21
    <xsl:variable name="_type" select="substring-before($args,':')"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    22
    <xsl:variable name="type">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    23
      <xsl:choose>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    24
        <xsl:when test="$_type">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    25
          <xsl:value-of select="$_type"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    26
        </xsl:when>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    27
        <xsl:otherwise>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    28
          <xsl:value-of select="$args"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    29
        </xsl:otherwise>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    30
      </xsl:choose>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    31
    </xsl:variable>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    32
    <xsl:if test="$type">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    33
      <widget>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    34
        <xsl:attribute name="id">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    35
          <xsl:value-of select="$id"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    36
        </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    37
        <xsl:attribute name="type">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    38
          <xsl:value-of select="$type"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    39
        </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    40
        <xsl:for-each select="str:split(substring-after($args, ':'), ':')">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    41
          <arg>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    42
            <xsl:attribute name="value">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    43
              <xsl:value-of select="."/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    44
            </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    45
          </arg>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    46
        </xsl:for-each>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    47
        <xsl:variable name="paths" select="substring-after($description,'@')"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    48
        <xsl:for-each select="str:split($paths, '@')">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    49
          <xsl:if test="string-length(.) &gt; 0">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    50
            <path>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    51
              <xsl:variable name="path_match" select="regexp:match(.,$pathregex)"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    52
              <xsl:variable name="pathminmax" select="str:split($path_match[4],',')"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    53
              <xsl:variable name="path" select="$path_match[2]"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    54
              <xsl:variable name="path_accepts" select="$path_match[3]"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    55
              <xsl:variable name="pathminmaxcount" select="count($pathminmax)"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    56
              <xsl:attribute name="value">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    57
                <xsl:value-of select="$path"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    58
              </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    59
              <xsl:if test="string-length($path_accepts)">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    60
                <xsl:attribute name="accepts">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    61
                  <xsl:value-of select="$path_accepts"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    62
                </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    63
              </xsl:if>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    64
              <xsl:choose>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    65
                <xsl:when test="$pathminmaxcount = 2">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    66
                  <xsl:attribute name="min">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    67
                    <xsl:value-of select="$pathminmax[1]"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    68
                  </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    69
                  <xsl:attribute name="max">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    70
                    <xsl:value-of select="$pathminmax[2]"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    71
                  </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    72
                </xsl:when>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    73
                <xsl:when test="$pathminmaxcount = 1 or $pathminmaxcount &gt; 2">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    74
                  <xsl:message terminate="yes">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    75
                    <xsl:text>Widget id:</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    76
                    <xsl:value-of select="$id"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    77
                    <xsl:text> label:</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    78
                    <xsl:value-of select="$label"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    79
                    <xsl:text> has wrong syntax of path section </xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    80
                    <xsl:value-of select="$pathminmax"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    81
                  </xsl:message>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    82
                </xsl:when>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    83
              </xsl:choose>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    84
              <xsl:if test="$indexed_hmitree">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    85
                <xsl:choose>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    86
                  <xsl:when test="regexp:test($path,'^\.[a-zA-Z0-9_]+$')">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    87
                    <xsl:attribute name="type">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    88
                      <xsl:text>PAGE_LOCAL</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    89
                    </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    90
                  </xsl:when>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    91
                  <xsl:when test="regexp:test($path,'^[a-zA-Z0-9_]+$')">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    92
                    <xsl:attribute name="type">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    93
                      <xsl:text>HMI_LOCAL</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    94
                    </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    95
                  </xsl:when>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    96
                  <xsl:otherwise>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    97
                    <xsl:variable name="item" select="$indexed_hmitree/*[@hmipath = $path]"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    98
                    <xsl:variable name="pathtype" select="local-name($item)"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    99
                    <xsl:if test="$pathminmaxcount = 3 and not($pathtype = 'HMI_INT' or $pathtype = 'HMI_REAL')">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   100
                      <xsl:message terminate="yes">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   101
                        <xsl:text>Widget id:</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   102
                        <xsl:value-of select="$id"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   103
                        <xsl:text> label:</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   104
                        <xsl:value-of select="$label"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   105
                        <xsl:text> path section </xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   106
                        <xsl:value-of select="$pathminmax"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   107
                        <xsl:text> use min and max on non mumeric value</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   108
                      </xsl:message>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   109
                    </xsl:if>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   110
                    <xsl:if test="count($item) = 1">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   111
                      <xsl:attribute name="index">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   112
                        <xsl:value-of select="$item/@index"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   113
                      </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   114
                      <xsl:attribute name="type">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   115
                        <xsl:value-of select="$pathtype"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   116
                      </xsl:attribute>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   117
                    </xsl:if>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   118
                  </xsl:otherwise>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   119
                </xsl:choose>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   120
              </xsl:if>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   121
            </path>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   122
          </xsl:if>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   123
        </xsl:for-each>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   124
      </widget>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   125
    </xsl:if>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   126
  </xsl:template>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   127
  <xsl:template mode="genlabel" match="arg">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   128
    <xsl:text>:</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   129
    <xsl:value-of select="@value"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   130
  </xsl:template>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   131
  <xsl:template mode="genlabel" match="path">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   132
    <xsl:text>@</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   133
    <xsl:value-of select="@value"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   134
    <xsl:if test="string-length(@min)&gt;0 or string-length(@max)&gt;0">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   135
      <xsl:text>,</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   136
      <xsl:value-of select="@min"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   137
      <xsl:text>,</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   138
      <xsl:value-of select="@max"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   139
    </xsl:if>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   140
  </xsl:template>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   141
  <xsl:template mode="genlabel" match="widget">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   142
    <xsl:text>HMI:</xsl:text>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   143
    <xsl:value-of select="@type"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   144
    <xsl:apply-templates mode="genlabel" select="arg"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   145
    <xsl:apply-templates mode="genlabel" select="path"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   146
  </xsl:template>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   147
  <xsl:variable name="hmi_elements" select="//svg:*[starts-with(@inkscape:label, 'HMI:')]"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   148
  <xsl:template match="/">
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   149
    <widgets>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   150
      <xsl:apply-templates mode="parselabel" select="$hmi_elements"/>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   151
    </widgets>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   152
  </xsl:template>
b2b6bf45aa2d SVGHMI: Add analyse_widget stylesheet and python code to execute it, in order to obtain widget signature independently of DnD SVG file generation.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
   153
</xsl:stylesheet>