author | Edouard Tisserant |
Thu, 26 Sep 2019 09:33:49 +0200 | |
branch | svghmi |
changeset 2786 | 1b82f21b2b41 |
parent 2783 | 5ee6967f721d |
child 2788 | 2ed9ff826d03 |
permissions | -rw-r--r-- |
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"?> |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
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="http://www.w3.org/1999/xhtml" xmlns:str="http://exslt.org/strings" 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()"/> |
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
|
6 |
<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
|
7 |
<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
|
8 |
<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
|
9 |
</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
|
10 |
</xsl:template> |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
11 |
<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
|
12 |
<xsl:text>=HMI= |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
13 |
</xsl:text> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
14 |
</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
|
15 |
<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
|
16 |
<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
|
17 |
<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
|
18 |
<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
|
19 |
<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
|
20 |
<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
|
21 |
<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
|
22 |
</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
|
23 |
<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
|
24 |
<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
|
25 |
</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
|
26 |
<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
|
27 |
</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
|
28 |
<script> |
2783
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
29 |
<xsl:text>function evaluate_js_from_descriptions() { |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
30 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
31 |
<xsl:text> var Page; |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
32 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
33 |
<xsl:text> var Input; |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
34 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
35 |
<xsl:text> var Display; |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
36 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
37 |
<xsl:text> var res = []; |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
38 |
</xsl:text> |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
39 |
<xsl:variable name="midmark"> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
40 |
<xsl:text> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
41 |
</xsl:text> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
42 |
<xsl:value-of select="$mark"/> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
43 |
</xsl:variable> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
44 |
<xsl:apply-templates mode="code_from_descs" select="//*[contains(child::svg:desc, $midmark) or starts-with(child::svg:desc, $mark)]"/> |
2783
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
45 |
<xsl:text> return res; |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
46 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
47 |
<xsl:text>} |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
48 |
</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
|
49 |
<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
|
50 |
</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
|
51 |
<xsl:text> var relative_URI = window.location.href.replace(/^http(s?:\/\/[^\/]*)\/.*$/, 'ws$1/ws'); |
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
|
52 |
</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
|
53 |
<xsl:text> var ws = new WebSocket(relative_URI); |
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
|
54 |
</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
|
55 |
<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
|
56 |
</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
|
57 |
<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
|
58 |
</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
|
59 |
<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
|
60 |
</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
|
61 |
<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
|
62 |
</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
|
63 |
<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
|
64 |
</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
|
65 |
<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
|
66 |
</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
|
67 |
<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
|
68 |
</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
|
69 |
<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
|
70 |
</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
|
71 |
</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
|
72 |
</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
|
73 |
</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
|
74 |
</xsl:template> |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
75 |
<xsl:template mode="code_from_descs" match="*"> |
2783
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
76 |
<xsl:text>{ |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
77 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
78 |
<xsl:text> var path, role, name, priv; |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
79 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
80 |
<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
|
81 |
<xsl:value-of select="@id"/> |
2783
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
82 |
<xsl:text>"; |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
83 |
</xsl:text> |
2783
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
84 |
<xsl:if test="«@inkscape:label»"> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
85 |
<xsl:text>name = "</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
86 |
<xsl:value-of select="@inkscape:label"/> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
87 |
<xsl:text>"; |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
88 |
</xsl:text> |
2783
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
89 |
</xsl:if> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
90 |
<xsl:text>/* -------------- */ |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
91 |
</xsl:text> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
92 |
<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
|
93 |
<xsl:text> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
94 |
</xsl:text> |
2783
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
95 |
<xsl:text> /* -------------- */ |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
96 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
97 |
<xsl:text> res.push({ |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
98 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
99 |
<xsl:text> path:path, |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
100 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
101 |
<xsl:text> role:role, |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
102 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
103 |
<xsl:text> name:name, |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
104 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
105 |
<xsl:text> priv:priv |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
106 |
</xsl:text> |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
107 |
<xsl:text> }) |
5ee6967f721d
SVGHMI: Starting to define JS side more in details.
Edouard Tisserant
parents:
2782
diff
changeset
|
108 |
</xsl:text> |
2782
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
109 |
<xsl:text>} |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
110 |
</xsl:text> |
723e420dfe72
SVGHMI: added transformation of code given in inkscape's description fields into javascript functions
Edouard Tisserant
parents:
2779
diff
changeset
|
111 |
</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
|
112 |
<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
|
113 |
<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
|
114 |
<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
|
115 |
<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
|
116 |
<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
|
117 |
<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
|
118 |
<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
|
119 |
<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
|
120 |
<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
|
121 |
<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
|
122 |
<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
|
123 |
<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
|
124 |
</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
|
125 |
</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
|
126 |
<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
|
127 |
<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
|
128 |
<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
|
129 |
<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
|
130 |
<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
|
131 |
<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
|
132 |
<xsl:value-of select="@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
|
133 |
<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
|
134 |
<xsl:value-of select="@type"/> |
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
|
135 |
<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
|
136 |
<xsl:value-of select="@path"/> |
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
|
137 |
<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
|
138 |
</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
|
139 |
<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
|
140 |
<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
|
141 |
<xsl:value-of select="concat($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
|
142 |
</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
|
143 |
</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
|
144 |
</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
|
145 |
</xsl:stylesheet> |