@epa-wg/custom-element 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/inspectionProfiles/Project_Default.xml +22 -7
- package/.idea/misc.xml +4 -5
- package/.vs/VSWorkspaceState.json +8 -0
- package/.vs/custom-element/FileContentIndex/1487e471-3751-47bc-a499-d78eda924eda.vsidx +0 -0
- package/.vs/custom-element/v17/.wsuo +0 -0
- package/.vs/slnx.sqlite +0 -0
- package/README.md +26 -19
- package/custom-element.js +206 -60
- package/demo/a.html +25 -11
- package/demo/confused.svg +36 -36
- package/demo/dom-merge.html +121 -0
- package/demo/embed-1.html +2 -2
- package/demo/external-template.html +9 -7
- package/demo/html-template.html +125 -12
- package/demo/html-template.xhtml +44 -44
- package/demo/html-template.xml +44 -44
- package/demo/http-request.html +44 -57
- package/demo/local-storage.html +23 -18
- package/demo/location-element.html +59 -58
- package/demo/s.xml +1 -0
- package/demo/s.xslt +159 -0
- package/demo/table.xml +24 -24
- package/demo/table.xsl +292 -292
- package/demo/template.xsl +45 -45
- package/demo/tree.xml +24 -24
- package/demo/tree.xsl +32 -32
- package/demo/xhtml-template.xhtml +44 -44
- package/demo/z.html +42 -0
- package/demo/z.xml +60 -0
- package/http-request.js +28 -37
- package/index.html +21 -19
- package/input-text.js +17 -0
- package/local-storage.js +28 -35
- package/location-element.js +15 -16
- package/package.json +1 -1
- package/0/a.html +0 -19
- package/0/a.xml +0 -10
- package/0/a.xsl +0 -66
- package/0/a1.xsl +0 -38
- package/0/ab.xsl +0 -23
- package/0/az.xml +0 -30
- package/0/b.html +0 -90
package/demo/http-request.html
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
description="load the list of pokemons">
|
|
36
36
|
<p>Should display 6 image buttons with pokemon name </p>
|
|
37
37
|
<template>
|
|
38
|
-
<custom-element
|
|
38
|
+
<custom-element>
|
|
39
39
|
<template><!-- wrapping into template to prevent images loading within DCE declaration -->
|
|
40
40
|
<http-request
|
|
41
41
|
url="https://pokeapi.co/api/v2/pokemon?limit=6&offset=0"
|
|
@@ -43,80 +43,67 @@
|
|
|
43
43
|
method="GET"
|
|
44
44
|
header-accept="application/json"
|
|
45
45
|
></http-request>
|
|
46
|
+
<xsl:variable name="slides-url"
|
|
47
|
+
>https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world</xsl:variable>
|
|
46
48
|
<xsl:for-each select="//slice/page/data/results/*">
|
|
47
|
-
<xsl:variable name="slides-url"
|
|
48
|
-
>https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world</xsl:variable>
|
|
49
49
|
<xsl:variable name="pokeid"
|
|
50
50
|
select="substring-before( substring-after( @url, 'https://pokeapi.co/api/v2/pokemon/'),'/')"
|
|
51
51
|
></xsl:variable>
|
|
52
52
|
<button>
|
|
53
53
|
<img src="{$slides-url}/{$pokeid}.svg"
|
|
54
54
|
alt="{@name}"/>
|
|
55
|
-
|
|
55
|
+
{@name}
|
|
56
56
|
</button>
|
|
57
57
|
</xsl:for-each>
|
|
58
58
|
</template>
|
|
59
59
|
</custom-element>
|
|
60
|
-
<dce-1></dce-1>
|
|
61
60
|
</template>
|
|
62
61
|
</html-demo-element>
|
|
63
62
|
|
|
64
|
-
<html-demo-element legend="
|
|
63
|
+
<html-demo-element legend="2. http-request response and headers"
|
|
65
64
|
description="request and response headers access demo">
|
|
66
65
|
|
|
67
66
|
<template>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
from <code>${url}</code>
|
|
67
|
+
<custom-element url="https://pokeapi.co/api/v2/pokemon?offset=6&limit=6">
|
|
68
|
+
<template> <!-- IMPORTANT! to wrap DCE payload into template to avoid
|
|
69
|
+
http-request initializing out of instance -->
|
|
70
|
+
<http-request
|
|
71
|
+
url="{url}"
|
|
72
|
+
slice="request_slice"
|
|
73
|
+
type="text"
|
|
74
|
+
mode="cors"
|
|
75
|
+
header-x-test="testing"
|
|
76
|
+
></http-request>
|
|
77
|
+
Content of <code>//slice/request_slice</code> is filled by <b>request</b> and <b>response</b>
|
|
78
|
+
from <code>${url}</code>
|
|
81
79
|
|
|
82
|
-
<h3>Samples</h3>
|
|
83
|
-
<table>
|
|
84
|
-
<tr><th
|
|
85
|
-
|
|
86
|
-
<tr><th
|
|
87
|
-
|
|
88
|
-
<tr><th
|
|
89
|
-
|
|
90
|
-
</table>
|
|
91
|
-
<xsl:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<code><xsl:value-of select='.'/></code>
|
|
110
|
-
</li>
|
|
111
|
-
</xsl:for-each>
|
|
112
|
-
<code><xsl:value-of select='.'/></code>
|
|
113
|
-
</ul>
|
|
114
|
-
</div>
|
|
115
|
-
</xsl:for-each>
|
|
116
|
-
</ul>
|
|
117
|
-
</xsl:for-each>
|
|
118
|
-
</custom-element>
|
|
119
|
-
<headers-demo></headers-demo>
|
|
80
|
+
<h3>Samples</h3>
|
|
81
|
+
<table>
|
|
82
|
+
<tr><th> //slice/request_slice/request/@mode </th>
|
|
83
|
+
<td>{ //slice/request_slice/request/@mode }</td></tr>
|
|
84
|
+
<tr><th> //slice/request_slice/response/headers/@content-type </th>
|
|
85
|
+
<td>{ //slice/request_slice/response/headers/@content-type }</td></tr>
|
|
86
|
+
<tr><th> //slice/request_slice/response/@status </th>
|
|
87
|
+
<td>{ //slice/request_slice/response/@status }</td></tr>
|
|
88
|
+
</table>
|
|
89
|
+
<xsl:apply-templates mode="display" select="//slice/request_slice/*"></xsl:apply-templates>
|
|
90
|
+
<xsl:template mode="display" match="*">
|
|
91
|
+
<fieldset>
|
|
92
|
+
<legend> {local-name(.)} </legend>
|
|
93
|
+
<ul>
|
|
94
|
+
<xsl:for-each select="@*">
|
|
95
|
+
<li>
|
|
96
|
+
<var data-testid="section-attribute">@{local-name(.)}</var>
|
|
97
|
+
=
|
|
98
|
+
<code><xsl:value-of select='.'/></code>
|
|
99
|
+
</li>
|
|
100
|
+
</xsl:for-each>
|
|
101
|
+
</ul>
|
|
102
|
+
<xsl:apply-templates mode="display" select="*"></xsl:apply-templates>
|
|
103
|
+
</fieldset>
|
|
104
|
+
</xsl:template>
|
|
105
|
+
</template>
|
|
106
|
+
</custom-element>
|
|
120
107
|
</template>
|
|
121
108
|
</html-demo-element>
|
|
122
109
|
|
package/demo/local-storage.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
2
|
+
<html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
5
5
|
<title>custom-element Declarative Custom Element implementation demo</title>
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
<p>Has to produce 12🍒</p>
|
|
29
29
|
<template>
|
|
30
30
|
<custom-element tag="dce-1" hidden>
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
{//slice/fruits/text()}
|
|
32
|
+
<slot>🤔</slot>
|
|
33
33
|
<local-storage key="cherries" slice="fruits"></local-storage>
|
|
34
34
|
</custom-element>
|
|
35
35
|
<dce-1>🍒</dce-1>
|
|
@@ -41,21 +41,25 @@
|
|
|
41
41
|
<p>Click the fruits button to add into cart </p>
|
|
42
42
|
<template>
|
|
43
43
|
<custom-element tag="dce-2" hidden>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
<template>
|
|
45
|
+
<local-storage key="basket" slice="basket" live type="json"></local-storage>
|
|
46
|
+
<xhtml:table xmlns:xhtml="http://www.w3.org/1999/xhtml" >
|
|
47
|
+
<xhtml:tbody>
|
|
48
|
+
<xsl:for-each select="//basket/@*">
|
|
49
|
+
<xhtml:tr>
|
|
50
|
+
<xhtml:th> {name()} </xhtml:th>
|
|
51
|
+
<xhtml:td> {.} </xhtml:td>
|
|
52
|
+
</xhtml:tr>
|
|
53
|
+
</xsl:for-each>
|
|
54
|
+
</xhtml:tbody>
|
|
55
|
+
<xhtml:tfoot>
|
|
56
|
+
<xhtml:tr>
|
|
57
|
+
<xhtml:td><slot>🤔</slot></xhtml:td>
|
|
58
|
+
<xhtml:th> {sum(//slice/basket/@*)} </xhtml:th>
|
|
59
|
+
</xhtml:tr>
|
|
60
|
+
</xhtml:tfoot>
|
|
61
|
+
</xhtml:table>
|
|
62
|
+
</template>
|
|
59
63
|
</custom-element>
|
|
60
64
|
<dce-2>🛒total</dce-2>
|
|
61
65
|
</template>
|
|
@@ -90,6 +94,7 @@
|
|
|
90
94
|
basket[k] || (basket[k] = 1);
|
|
91
95
|
localStorage.setItem( k, basket[k] = 1+1*localStorage[k] )
|
|
92
96
|
localStorage.setItem( 'basket', JSON.stringify(basket) );
|
|
97
|
+
renderStorage();
|
|
93
98
|
} );
|
|
94
99
|
|
|
95
100
|
const renderStorage = () =>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
2
|
+
<html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
3
|
+
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
|
3
4
|
<head>
|
|
4
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
5
6
|
<title>custom-element Declarative Custom Element implementation demo</title>
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
<html-demo-element legend="Change window URL">
|
|
25
26
|
<template>
|
|
26
27
|
<a href="#dce2">#dce2</a>
|
|
27
|
-
<form >
|
|
28
|
+
<form method="get">
|
|
28
29
|
<input name="p1" value="abc"/>
|
|
29
30
|
<input name="p2" value="def"/>
|
|
30
31
|
<input type="submit" value="params"/>
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
</html-demo-element>
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
<html-demo-element legend="
|
|
42
|
+
<html-demo-element legend="1. window.location live update"
|
|
42
43
|
description="In the page beginning change the window URL via link or by history change"
|
|
43
44
|
id="dce2"
|
|
44
45
|
>
|
|
@@ -49,24 +50,20 @@
|
|
|
49
50
|
|
|
50
51
|
<location-element slice="window-url" live></location-element>
|
|
51
52
|
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<html:td><xsl:value-of select="."/></html:td>
|
|
67
|
-
</html:tr>
|
|
68
|
-
</xsl:for-each>
|
|
69
|
-
</html:table>
|
|
53
|
+
<xhtml:table>
|
|
54
|
+
<tr><th><h3> URL properties </h3></th></tr>
|
|
55
|
+
<xsl:apply-templates mode="attrs" select="//slice/window-url/@*"></xsl:apply-templates>
|
|
56
|
+
</xhtml:table>
|
|
57
|
+
<xhtml:table>
|
|
58
|
+
<tr><th><h3> URL parameters </h3></th></tr>
|
|
59
|
+
<xsl:apply-templates mode="attrs" select="//slice/window-url/params/*"></xsl:apply-templates>
|
|
60
|
+
</xhtml:table>
|
|
61
|
+
<xsl:template mode="attrs" match="*|@*">
|
|
62
|
+
<xhtml:tr>
|
|
63
|
+
<xhtml:th>{name()}</xhtml:th>
|
|
64
|
+
<xhtml:td>{.}</xhtml:td>
|
|
65
|
+
</xhtml:tr>
|
|
66
|
+
</xsl:template>
|
|
70
67
|
</template>
|
|
71
68
|
</custom-element>
|
|
72
69
|
<dce-2>?</dce-2>
|
|
@@ -74,7 +71,7 @@
|
|
|
74
71
|
</html-demo-element>
|
|
75
72
|
|
|
76
73
|
|
|
77
|
-
<html-demo-element legend="
|
|
74
|
+
<html-demo-element legend="2. window.location simplest"
|
|
78
75
|
description="location read only during initial and only render, does not track the changes."
|
|
79
76
|
id="dce1">
|
|
80
77
|
<p>Has to produce URL properties</p>
|
|
@@ -84,24 +81,26 @@
|
|
|
84
81
|
|
|
85
82
|
<location-element slice="window-url"></location-element>
|
|
86
83
|
|
|
87
|
-
<
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
84
|
+
<xhtml:table>
|
|
85
|
+
<xhtml:tbody>
|
|
86
|
+
<xhtml:tr><xhtml:th><h3>URL properties</h3></xhtml:th></xhtml:tr>
|
|
87
|
+
<xsl:for-each select="//slice/window-url/@*">
|
|
88
|
+
<xhtml:tr>
|
|
89
|
+
<xhtml:th>{name()}</xhtml:th>
|
|
90
|
+
<xhtml:td>{.}</xhtml:td>
|
|
91
|
+
</xhtml:tr>
|
|
92
|
+
</xsl:for-each>
|
|
93
|
+
</xhtml:tbody>
|
|
94
|
+
<xhtml:tbody>
|
|
95
|
+
<xhtml:tr><xhtml:th><h3>URL parameters</h3></xhtml:th></xhtml:tr>
|
|
96
|
+
<xsl:for-each select="//slice/window-url/params/*">
|
|
97
|
+
<xhtml:tr>
|
|
98
|
+
<xhtml:th>{name()}</xhtml:th>
|
|
99
|
+
<xhtml:td>{.}</xhtml:td>
|
|
100
|
+
</xhtml:tr>
|
|
101
|
+
</xsl:for-each>
|
|
102
|
+
</xhtml:tbody>
|
|
103
|
+
</xhtml:table>
|
|
105
104
|
</template>
|
|
106
105
|
</custom-element>
|
|
107
106
|
<dce-1>?</dce-1>
|
|
@@ -119,24 +118,26 @@
|
|
|
119
118
|
|
|
120
119
|
<location-element slice="src-url" src="https://my.example?a=1&b=2#3"></location-element>
|
|
121
120
|
|
|
122
|
-
<
|
|
123
|
-
<
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
121
|
+
<xhtml:table>
|
|
122
|
+
<xhtml:tbody>
|
|
123
|
+
<xhtml:tr><xhtml:th><h3>URL properties</h3></xhtml:th></xhtml:tr>
|
|
124
|
+
<xsl:for-each select="//slice/src-url/@*">
|
|
125
|
+
<xhtml:tr>
|
|
126
|
+
<xhtml:th>{name()}</xhtml:th>
|
|
127
|
+
<xhtml:td>{.}</xhtml:td>
|
|
128
|
+
</xhtml:tr>
|
|
129
|
+
</xsl:for-each>
|
|
130
|
+
</xhtml:tbody>
|
|
131
|
+
<xhtml:tbody>
|
|
132
|
+
<xhtml:tr><xhtml:th><h3>URL parameters</h3></xhtml:th></xhtml:tr>
|
|
133
|
+
<xsl:for-each select="//slice/src-url/params/*">
|
|
134
|
+
<xhtml:tr>
|
|
135
|
+
<xhtml:th>{name()}</xhtml:th>
|
|
136
|
+
<xhtml:td>{.}</xhtml:td>
|
|
137
|
+
</xhtml:tr>
|
|
138
|
+
</xsl:for-each>
|
|
139
|
+
</xhtml:tbody>
|
|
140
|
+
</xhtml:table>
|
|
140
141
|
</template>
|
|
141
142
|
</custom-element>
|
|
142
143
|
<dce-3>?</dce-3>
|
package/demo/s.xml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<datadom><payload><i xmlns="http://www.w3.org/1999/xhtml" slot="">loading from HTML file ...</i></payload><attributes><src>/src/demo/html-template.html</src><tag/><data-smile>👼</data-smile><attr-1>a1</attr-1><attr-2>a2</attr-2></attributes><dataset><smile>👼</smile></dataset><slice/></datadom>
|
package/demo/s.xslt
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dce="urn:schemas-epa-wg:dce"
|
|
2
|
+
xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl">
|
|
3
|
+
<xsl:template mode="payload" match="attributes">
|
|
4
|
+
<dce-root xmlns:xhtml="http://www.w3.org/1999/xhtml" data-dce-id="1">
|
|
5
|
+
<head data-dce-id="2">
|
|
6
|
+
|
|
7
|
+
<title data-dce-id="4">template based on HTML file</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body data-dce-id="5">
|
|
10
|
+
<b id="wave" data-dce-id="6">👋</b>
|
|
11
|
+
<b id="ok" data-dce-id="7">👌</b>
|
|
12
|
+
<svg xmlns="http://www.w3.org/2000/svg" id="dwc-logo" viewBox="0 0 216 209.18" data-dce-id="8">
|
|
13
|
+
<defs data-dce-id="9">
|
|
14
|
+
<style data-dce-id="10">
|
|
15
|
+
.cls-1{fill:#c2e6f1;}.cls-2{fill:#dcf1f7;}.cls-3{fill:#2d4554;}.cls-4{fill:#60cae5;}
|
|
16
|
+
</style>
|
|
17
|
+
</defs>
|
|
18
|
+
<polygon class="cls-3"
|
|
19
|
+
points="0 82.47 0 126.71 34.84 146.83 34.84 187.06 73.16 209.18 108 189.07 142.84 209.18 181.16 187.06 181.16 146.83 216 126.71 216 82.47 181.16 62.35 181.16 22.12 142.84 0 108 20.12 73.16 0 34.84 22.12 34.84 62.35 0 82.47"
|
|
20
|
+
data-dce-id="11"/>
|
|
21
|
+
<path class="cls-2"
|
|
22
|
+
d="m114.33,56.69l20.64-11.92c.47-.27.47-.79,0-1.06l-20.65-11.92h0c-4.44-2.57-8.22-2.57-12.67,0l-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0Z"
|
|
23
|
+
data-dce-id="12"/>
|
|
24
|
+
<path class="cls-2"
|
|
25
|
+
d="m98.19,62.71h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"
|
|
26
|
+
data-dce-id="13"/>
|
|
27
|
+
<path class="cls-1"
|
|
28
|
+
d="m48.12,66.01l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97Z"
|
|
29
|
+
data-dce-id="14"/>
|
|
30
|
+
<path class="cls-2"
|
|
31
|
+
d="m46.18,24.66l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0s20.64-11.92,20.64-11.92c.47-.27.47-.79,0-1.06l-20.65-11.92h0c-4.44-2.57-8.22-2.57-12.67,0l-20.65,11.92c-.47.27-.47.79,0,1.06Z"
|
|
32
|
+
data-dce-id="15"/>
|
|
33
|
+
<path class="cls-2"
|
|
34
|
+
d="m115.87,24.66l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0s20.64-11.92,20.64-11.92c.47-.27.47-.79,0-1.06l-20.65-11.92h0c-4.44-2.57-8.22-2.57-12.67,0l-20.65,11.92c-.47.27-.47.79,0,1.06Z"
|
|
35
|
+
data-dce-id="16"/>
|
|
36
|
+
<path class="cls-2"
|
|
37
|
+
d="m152.65,42.59c-4.44,2.56-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0Z"
|
|
38
|
+
data-dce-id="17"/>
|
|
39
|
+
<path class="cls-2"
|
|
40
|
+
d="m77.55,158.4l20.65-11.92h0c4.44-2.57,6.33-5.84,6.33-10.97v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92c-4.44,2.57-6.33,5.84-6.33,10.97h0s0,23.84,0,23.84c0,.54.45.8.92.54Z"
|
|
41
|
+
data-dce-id="18"/>
|
|
42
|
+
<path class="cls-4"
|
|
43
|
+
d="m146.31,134.03v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0s0-23.84,0-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97Z"
|
|
44
|
+
data-dce-id="19"/>
|
|
45
|
+
<path class="cls-4"
|
|
46
|
+
d="m63.35,123.06h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"
|
|
47
|
+
data-dce-id="20"/>
|
|
48
|
+
<path class="cls-4"
|
|
49
|
+
d="m103.61,151.37l-20.64,11.92c-4.44,2.57-6.33,5.84-6.33,10.97h0s0,23.84,0,23.84c0,.54.45.8.92.54l20.65-11.92h0c4.44-2.57,6.33-5.84,6.33-10.97v-23.84c0-.54-.45-.8-.92-.53Z"
|
|
50
|
+
data-dce-id="21"/>
|
|
51
|
+
<path class="cls-4"
|
|
52
|
+
d="m63.35,163.29h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"
|
|
53
|
+
data-dce-id="22"/>
|
|
54
|
+
<path class="cls-4"
|
|
55
|
+
d="m28.51,102.94h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"
|
|
56
|
+
data-dce-id="23"/>
|
|
57
|
+
<path class="cls-4"
|
|
58
|
+
d="m133.04,163.29l-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84c0,5.13,1.89,8.4,6.33,10.97h0s20.65,11.92,20.65,11.92c.47.27.92,0,.92-.54v-23.84s0,0,0,0c0-5.13-1.89-8.4-6.33-10.97Z"
|
|
59
|
+
data-dce-id="24"/>
|
|
60
|
+
<path class="cls-4"
|
|
61
|
+
d="m173.29,151.37l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0s0-23.84,0-23.84c0-.54-.45-.8-.92-.53Z"
|
|
62
|
+
data-dce-id="25"/>
|
|
63
|
+
<path class="cls-4"
|
|
64
|
+
d="m209.06,91.55c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84Z"
|
|
65
|
+
data-dce-id="26"/>
|
|
66
|
+
<path class="cls-2"
|
|
67
|
+
d="m149.18,117.04l20.64-11.92c.47-.27.47-.79,0-1.06l-20.65-11.92h0c-4.44-2.57-8.22-2.57-12.67,0l-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0Z"
|
|
68
|
+
data-dce-id="27"/>
|
|
69
|
+
<path class="cls-1"
|
|
70
|
+
d="m112.39,98.05l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54Z"
|
|
71
|
+
data-dce-id="28"/>
|
|
72
|
+
<path class="cls-1"
|
|
73
|
+
d="m100.13,105.12c.47-.27.47-.79,0-1.06l-20.65-11.92c-4.44-2.57-8.22-2.57-12.67,0h0s-20.65,11.92-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92h0c4.44,2.57,8.22,2.57,12.67,0l20.64-11.92Z"
|
|
74
|
+
data-dce-id="29"/>
|
|
75
|
+
<path class="cls-2"
|
|
76
|
+
d="m65.29,85.01c.47-.27.47-.79,0-1.06l-20.65-11.92c-4.44-2.57-8.22-2.57-12.67,0h0s-20.65,11.92-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92h0c4.44,2.57,8.22,2.57,12.67,0l20.64-11.92Z"
|
|
77
|
+
data-dce-id="30"/>
|
|
78
|
+
<path class="cls-1"
|
|
79
|
+
d="m133.04,123.06l-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84c0,5.13,1.89,8.4,6.33,10.97h0s20.65,11.92,20.65,11.92c.47.27.92,0,.92-.54v-23.84s0,0,0,0c0-5.13-1.89-8.4-6.33-10.97Z"
|
|
80
|
+
data-dce-id="31"/>
|
|
81
|
+
<path class="cls-1"
|
|
82
|
+
d="m184.02,96.93l20.64-11.92c.47-.27.47-.79,0-1.06l-20.65-11.92h0c-4.44-2.57-8.22-2.57-12.67,0l-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0Z"
|
|
83
|
+
data-dce-id="32"/>
|
|
84
|
+
</svg>
|
|
85
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML" id="sophomores-dream" display="block" data-dce-id="33">
|
|
86
|
+
<mrow data-dce-id="34">
|
|
87
|
+
<msubsup data-dce-id="35">
|
|
88
|
+
<mo data-dce-id="36">∫</mo>
|
|
89
|
+
<mn data-dce-id="37">0</mn>
|
|
90
|
+
<mn data-dce-id="38">1</mn>
|
|
91
|
+
</msubsup>
|
|
92
|
+
<msup data-dce-id="39">
|
|
93
|
+
<mi data-dce-id="40">x</mi>
|
|
94
|
+
<mi data-dce-id="41">x</mi>
|
|
95
|
+
</msup>
|
|
96
|
+
<mo rspace="0.22em" data-dce-id="42"></mo>
|
|
97
|
+
<mo rspace="0" data-dce-id="43">ⅆ</mo>
|
|
98
|
+
<mi data-dce-id="44">x</mi>
|
|
99
|
+
<mo data-dce-id="45">=</mo>
|
|
100
|
+
<munderover data-dce-id="46">
|
|
101
|
+
<mo data-dce-id="47">∑</mo>
|
|
102
|
+
<mrow data-dce-id="48">
|
|
103
|
+
<mi data-dce-id="49">n</mi>
|
|
104
|
+
<mo data-dce-id="50">=</mo>
|
|
105
|
+
<mn data-dce-id="51">1</mn>
|
|
106
|
+
</mrow>
|
|
107
|
+
<mn data-dce-id="52">∞</mn>
|
|
108
|
+
</munderover>
|
|
109
|
+
<msup data-dce-id="53">
|
|
110
|
+
<mrow data-dce-id="54">
|
|
111
|
+
<mo data-dce-id="55">(</mo>
|
|
112
|
+
<mrow data-dce-id="56">
|
|
113
|
+
<mo form="prefix" data-dce-id="57">−</mo>
|
|
114
|
+
<mn data-dce-id="58">1</mn>
|
|
115
|
+
</mrow>
|
|
116
|
+
<mo data-dce-id="59">)</mo>
|
|
117
|
+
</mrow>
|
|
118
|
+
<mrow data-dce-id="60">
|
|
119
|
+
<mi data-dce-id="61">n</mi>
|
|
120
|
+
<mo data-dce-id="62">+</mo>
|
|
121
|
+
<mn data-dce-id="63">1</mn>
|
|
122
|
+
</mrow>
|
|
123
|
+
</msup>
|
|
124
|
+
<mo data-dce-id="64"></mo>
|
|
125
|
+
<msup data-dce-id="65">
|
|
126
|
+
<mi data-dce-id="66">n</mi>
|
|
127
|
+
<mrow data-dce-id="67">
|
|
128
|
+
<mo form="prefix" data-dce-id="68">−</mo>
|
|
129
|
+
<mi data-dce-id="69">n</mi>
|
|
130
|
+
</mrow>
|
|
131
|
+
</msup>
|
|
132
|
+
</mrow>
|
|
133
|
+
</math>
|
|
134
|
+
<script type="module" src="/__web-dev-server__web-socket.js?wds-import-map=0" data-dce-id="70"/>
|
|
135
|
+
</body>
|
|
136
|
+
</dce-root>
|
|
137
|
+
</xsl:template>
|
|
138
|
+
<xsl:template match="/">
|
|
139
|
+
<xsl:apply-templates mode="payload" select="/datadom/attributes"/>
|
|
140
|
+
</xsl:template>
|
|
141
|
+
<xsl:template name="slot">
|
|
142
|
+
<xsl:param name="slotname"/>
|
|
143
|
+
<xsl:param name="defaultvalue"/>
|
|
144
|
+
<xsl:choose>
|
|
145
|
+
<xsl:when test="//payload/*[@slot=$slotname]">
|
|
146
|
+
<xsl:copy-of select="//payload/*[@slot=$slotname]"/>
|
|
147
|
+
</xsl:when>
|
|
148
|
+
<xsl:otherwise>
|
|
149
|
+
<xsl:copy-of select="$defaultvalue"/>
|
|
150
|
+
</xsl:otherwise>
|
|
151
|
+
</xsl:choose>
|
|
152
|
+
</xsl:template>
|
|
153
|
+
<xsl:variable name="js-injected-body">
|
|
154
|
+
<xsl:call-template name="slot">
|
|
155
|
+
<xsl:with-param name="slotname" select="''"/>
|
|
156
|
+
<xsl:with-param name="defaultvalue"/>
|
|
157
|
+
</xsl:call-template>
|
|
158
|
+
</xsl:variable>
|
|
159
|
+
</xsl:stylesheet>
|
package/demo/table.xml
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<?xml-stylesheet type="text/xsl" href="table.xsl"?>
|
|
3
|
-
<div xmlns="http://www.w3.org/1999/xhtml">
|
|
4
|
-
<payload>
|
|
5
|
-
<span slot=""></span>
|
|
6
|
-
<p slot="description">Bulbasaur is a cute Pokémon born with a large seed firmly affixed to its back;
|
|
7
|
-
the seed grows in size as the Pokémon does.
|
|
8
|
-
</p>
|
|
9
|
-
<span slot=""></span>
|
|
10
|
-
<ul slot="">
|
|
11
|
-
<li pokemon-id="2">ivysaur</li>
|
|
12
|
-
<li pokemon-id="3">venusaur</li>
|
|
13
|
-
</ul>
|
|
14
|
-
<span slot=""></span>
|
|
15
|
-
</payload>
|
|
16
|
-
<attributes>
|
|
17
|
-
<title>bulbasaur</title>
|
|
18
|
-
<data-smile>👼</data-smile>
|
|
19
|
-
<pokemon-id>1</pokemon-id>
|
|
20
|
-
</attributes>
|
|
21
|
-
<dataset>
|
|
22
|
-
<smile>👼</smile>
|
|
23
|
-
</dataset>
|
|
24
|
-
<slice></slice>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<?xml-stylesheet type="text/xsl" href="table.xsl"?>
|
|
3
|
+
<div xmlns="http://www.w3.org/1999/xhtml">
|
|
4
|
+
<payload>
|
|
5
|
+
<span slot=""></span>
|
|
6
|
+
<p slot="description">Bulbasaur is a cute Pokémon born with a large seed firmly affixed to its back;
|
|
7
|
+
the seed grows in size as the Pokémon does.
|
|
8
|
+
</p>
|
|
9
|
+
<span slot=""></span>
|
|
10
|
+
<ul slot="">
|
|
11
|
+
<li pokemon-id="2">ivysaur</li>
|
|
12
|
+
<li pokemon-id="3">venusaur</li>
|
|
13
|
+
</ul>
|
|
14
|
+
<span slot=""></span>
|
|
15
|
+
</payload>
|
|
16
|
+
<attributes>
|
|
17
|
+
<title>bulbasaur</title>
|
|
18
|
+
<data-smile>👼</data-smile>
|
|
19
|
+
<pokemon-id>1</pokemon-id>
|
|
20
|
+
</attributes>
|
|
21
|
+
<dataset>
|
|
22
|
+
<smile>👼</smile>
|
|
23
|
+
</dataset>
|
|
24
|
+
<slice></slice>
|
|
25
25
|
</div>
|