svghmi/gen_index_xhtml.xslt
author Edouard Tisserant
Sat, 05 Oct 2019 09:45:58 +0200
branchsvghmi
changeset 2790 8fab1886ebec
parent 2789 ba0dd2ec6dc4
child 2791 d022523cb621
permissions -rw-r--r--
SVGHI: compute hmitree variables ordered index in xslt
2753
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
     1
<?xml version="1.0"?>
2790
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
     2
<xsl:stylesheet xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns="beremiz" xmlns:cc="http://creativecommons.org/ns#" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:str="http://exslt.org/strings" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:exsl="http://exslt.org/common" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" exclude-result-prefixes="ns" extension-element-prefixes="ns" version="1.0">
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
     3
  <xsl:output method="xml" cdata-section-elements="script"/>
2753
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
     4
  <xsl:variable name="geometry" select="ns:GetSVGGeometry()"/>
2763
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
     5
  <xsl:variable name="hmitree" select="ns:GetHMITree()"/>
2790
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
     6
  <xsl:variable name="_categories">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
     7
    <noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
     8
      <xsl:text>HMI_ROOT</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
     9
    </noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    10
    <noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    11
      <xsl:text>HMI_LABEL</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    12
    </noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    13
    <noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    14
      <xsl:text>HMI_CLASS</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    15
    </noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    16
    <noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    17
      <xsl:text>HMI_PLC_STATUS</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    18
    </noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    19
    <noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    20
      <xsl:text>HMI_CURRENT_PAGE</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    21
    </noindex>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    22
  </xsl:variable>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    23
  <xsl:variable name="categories" select="exsl:node-set($_categories)"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    24
  <xsl:variable name="indexed_hmitree">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    25
    <xsl:apply-templates mode="index" select="$hmitree"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    26
  </xsl:variable>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    27
  <xsl:template mode="index" match="node()">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    28
    <xsl:param name="index" select="0"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    29
    <xsl:variable name="content">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    30
      <xsl:choose>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    31
        <xsl:when test="not(local-name() = $categories/noindex)">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    32
          <xsl:copy>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    33
            <xsl:attribute name="index">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    34
              <xsl:value-of select="$index"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    35
            </xsl:attribute>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    36
            <xsl:for-each select="@*">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    37
              <xsl:copy/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    38
            </xsl:for-each>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    39
          </xsl:copy>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    40
        </xsl:when>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    41
        <xsl:otherwise>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    42
          <xsl:apply-templates mode="index" select="*[1]">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    43
            <xsl:with-param name="index" select="$index"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    44
          </xsl:apply-templates>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    45
        </xsl:otherwise>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    46
      </xsl:choose>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    47
    </xsl:variable>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    48
    <xsl:copy-of select="$content"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    49
    <xsl:apply-templates mode="index" select="following-sibling::*[1]">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    50
      <xsl:with-param name="index" select="$index + count(exsl:node-set($content)/*)"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    51
    </xsl:apply-templates>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    52
  </xsl:template>
2753
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
    53
  <xsl:template match="@* | node()">
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
    54
    <xsl:copy>
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
    55
      <xsl:apply-templates select="@* | node()"/>
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
    56
    </xsl:copy>
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
    57
  </xsl:template>
2782
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
    58
  <xsl:variable name="mark">
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
    59
    <xsl:text>=HMI=
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
    60
</xsl:text>
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
    61
  </xsl:variable>
2753
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
    62
  <xsl:template match="/">
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    63
    <html xmlns="http://www.w3.org/1999/xhtml">
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    64
      <head/>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    65
      <body style="margin:0;">
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    66
        <xsl:copy>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    67
          <xsl:comment>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    68
            <xsl:apply-templates mode="testgeo" select="$geometry"/>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    69
          </xsl:comment>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    70
          <xsl:comment>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    71
            <xsl:apply-templates mode="testtree" select="$hmitree"/>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    72
          </xsl:comment>
2790
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    73
          <xsl:comment>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    74
            <xsl:apply-templates mode="testtree" select="exsl:node-set($indexed_hmitree)"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    75
          </xsl:comment>
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    76
          <xsl:apply-templates select="@* | node()"/>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    77
        </xsl:copy>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    78
        <script>
2790
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    79
          <xsl:text>var subscriptions = {
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
    80
</xsl:text>
2783
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
    81
          <xsl:text>    return res;
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
    82
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
    83
          <xsl:text>}
2782
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
    84
</xsl:text>
2788
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    85
          <xsl:text>// svghmi.js
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    86
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    87
          <xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    88
</xsl:text>
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    89
          <xsl:text>(function(){
2763
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
    90
</xsl:text>
2788
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    91
          <xsl:text>    // Open WebSocket to relative "/ws" address
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    92
</xsl:text>
2788
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    93
          <xsl:text>    var ws = new WebSocket(window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws'));
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    94
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    95
          <xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    96
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
    97
          <xsl:text>    // Register message reception handler 
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    98
</xsl:text>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
    99
          <xsl:text>    ws.onmessage = function (evt) {
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   100
</xsl:text>
2788
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   101
          <xsl:text>        // TODO : dispatch and cache hmi tree updates
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   102
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   103
          <xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   104
</xsl:text>
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   105
          <xsl:text>        var received_msg = evt.data;
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   106
</xsl:text>
2788
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   107
          <xsl:text>        // TODO : check for hmitree hash header
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   108
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   109
          <xsl:text>        //        if not matching, reload page
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   110
</xsl:text>
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   111
          <xsl:text>        alert("Message is received..."+received_msg); 
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   112
</xsl:text>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   113
          <xsl:text>    };
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   114
</xsl:text>
2788
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   115
          <xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   116
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   117
          <xsl:text>    // Once connection established
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   118
</xsl:text>
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   119
          <xsl:text>    ws.onopen = function (evt) {
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   120
</xsl:text>
2788
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   121
          <xsl:text>        // TODO : enable the HMI (was previously offline, or just starts)
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   122
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   123
          <xsl:text>        //        show main page
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   124
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   125
          <xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   126
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   127
          <xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   128
</xsl:text>
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   129
          <xsl:text>        // TODO : prefix with hmitree hash header
2ed9ff826d03 SVGHMI: Work in progress. C side mostly implemented, neither built nor tested.
Edouard Tisserant
parents: 2783
diff changeset
   130
</xsl:text>
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   131
          <xsl:text>        ws.send("test");
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   132
</xsl:text>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   133
          <xsl:text>    };
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   134
</xsl:text>
2790
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   135
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   136
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   137
          <xsl:text>    var pending_updates = {};
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   138
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   139
          <xsl:text>    
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   140
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   141
          <xsl:text>    // subscription state, as it should be in hmi server
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   142
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   143
          <xsl:text>    // expected {index:period}
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   144
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   145
          <xsl:text>    var subscriptions = {};
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   146
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   147
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   148
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   149
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   150
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   151
          <xsl:text>    // subscription state as needed by widget now
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   152
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   153
          <xsl:text>    // expected {index:[widgets]};
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   154
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   155
          <xsl:text>    var subscribers = {};
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   156
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   157
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   158
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   159
          <xsl:text>    // return the diff in between curently subscribed and subscription
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   160
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   161
          <xsl:text>    function update_subscriptions() {
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   162
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   163
          <xsl:text>        let result = [];
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   164
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   165
          <xsl:text>        Object.keys(subscribers).forEach(index =&gt; {
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   166
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   167
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   168
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   169
          <xsl:text>            let previous_period = subscriptions[index];
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   170
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   171
          <xsl:text>            let new_period = Math.min(...widgets.map(widget =&gt; widget.period));
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   172
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   173
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   174
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   175
          <xsl:text>            if(previous_period != new_period) 
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   176
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   177
          <xsl:text>                result.push({index: index, period: new_period});
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   178
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   179
          <xsl:text>        })
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   180
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   181
          <xsl:text>    }
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   182
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   183
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   184
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   185
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   186
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   187
          <xsl:text>    function update_value(index, value) {
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   188
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   189
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   190
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   191
          <xsl:text>    };
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   192
</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   193
          <xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   194
</xsl:text>
2779
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   195
          <xsl:text>})();
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   196
</xsl:text>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   197
        </script>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   198
      </body>
75c6a31caca6 SVGHMI: Work In Progress : fixed pointer types in ctypes interface, cleaned up server startup and cleanup code, changed document type to XHTML, cleaner JS script : encapsulated in a function and in CDATA.
Edouard Tisserant
parents: 2763
diff changeset
   199
    </html>
2753
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
   200
  </xsl:template>
2782
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   201
  <xsl:template mode="code_from_descs" match="*">
2783
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   202
    <xsl:text>{
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   203
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   204
    <xsl:text>    var path, role, name, priv;
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   205
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   206
    <xsl:text>    var id = "</xsl:text>
2782
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   207
    <xsl:value-of select="@id"/>
2783
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   208
    <xsl:text>";
2782
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   209
</xsl:text>
2789
ba0dd2ec6dc4 SVGHMI: now built.
Edouard Tisserant
parents: 2788
diff changeset
   210
    <xsl:if test="@inkscape:label">
2783
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   211
      <xsl:text>name = "</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   212
      <xsl:value-of select="@inkscape:label"/>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   213
      <xsl:text>";
2782
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   214
</xsl:text>
2783
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   215
    </xsl:if>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   216
    <xsl:text>/* -------------- */
2782
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   217
</xsl:text>
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   218
    <xsl:value-of select="substring-after(svg:desc, $mark)"/>
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   219
    <xsl:text>
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   220
</xsl:text>
2783
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   221
    <xsl:text>    /* -------------- */
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   222
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   223
    <xsl:text>    res.push({
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   224
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   225
    <xsl:text>        path:path,
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   226
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   227
    <xsl:text>        role:role,
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   228
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   229
    <xsl:text>        name:name,
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   230
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   231
    <xsl:text>        priv:priv
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   232
</xsl:text>
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   233
    <xsl:text>    })
5ee6967f721d SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents: 2782
diff changeset
   234
</xsl:text>
2782
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   235
    <xsl:text>}
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   236
</xsl:text>
723e420dfe72 SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents: 2779
diff changeset
   237
  </xsl:template>
2753
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
   238
  <xsl:template mode="testgeo" match="bbox">
2763
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   239
    <xsl:text>ID: </xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   240
    <xsl:value-of select="@Id"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   241
    <xsl:text> x: </xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   242
    <xsl:value-of select="@x"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   243
    <xsl:text> y: </xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   244
    <xsl:value-of select="@y"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   245
    <xsl:text> w: </xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   246
    <xsl:value-of select="@w"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   247
    <xsl:text> h: </xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   248
    <xsl:value-of select="@h"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   249
    <xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   250
</xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   251
  </xsl:template>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   252
  <xsl:template mode="testtree" match="*">
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   253
    <xsl:param name="indent" select="''"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   254
    <xsl:value-of select="$indent"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   255
    <xsl:text> </xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   256
    <xsl:value-of select="local-name()"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   257
    <xsl:text> </xsl:text>
2790
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   258
    <xsl:for-each select="@*">
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   259
      <xsl:value-of select="local-name()"/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   260
      <xsl:text>=</xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   261
      <xsl:value-of select="."/>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   262
      <xsl:text> </xsl:text>
8fab1886ebec SVGHI: compute hmitree variables ordered index in xslt
Edouard Tisserant
parents: 2789
diff changeset
   263
    </xsl:for-each>
2763
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   264
    <xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   265
</xsl:text>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   266
    <xsl:apply-templates mode="testtree" select="*">
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   267
      <xsl:with-param name="indent">
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   268
        <xsl:value-of select="concat($indent,'&gt;')"/>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   269
      </xsl:with-param>
ce04d79b8e57 Pass HMITree to SVG transform. It seems it could really help to reduce JS tree binding logic in the end.
Edouard Tisserant
parents: 2756
diff changeset
   270
    </xsl:apply-templates>
2753
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
   271
  </xsl:template>
9a7e12e96399 SVGHMI: Added XSLT transformation, Makefile to get XSLT from ysl2 (copy of plcopen/Makefile) and a minimal stylesheet to start with.
Edouard Tisserant
parents:
diff changeset
   272
</xsl:stylesheet>