-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaker.xml
More file actions
137 lines (123 loc) · 3.17 KB
/
maker.xml
File metadata and controls
137 lines (123 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?xml
version="1.0"
encoding="UTF-8"?>
<?xml-stylesheet
href="xsltforms-1.7/xsltforms.xsl"
type="text/xsl"?>
<?xsltforms-options
debug="no"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ht="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:mq="http://example.org/mqtt"
lang="en">
<head>
<style type="text/css">
<![CDATA[
body > xforms-form > xforms-body > form > pre > code.xml > xforms-output > xforms-body { font-weight: bold }
]]>
</style>
<xf:model>
<xf:instance id="result">
<data xmlns="">
<output/>
<download/>
</data>
</xf:instance>
<xf:bind
ref="output"
calculate="transform(instance('select1')/select1, serialize(instance('xsl')), 'true')"
type="xs:string"/>
<xf:bind
ref="download"
calculate="concat('data:application/xml,', ../output)"/>
<xf:instance id="xsl">
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events">
<xsl:output
method="xml"
indent="yes"
omit-xml-declaration="yes"/>
<xsl:template match="*">
<xsl:element name="{local-name(.)}" namespace="http://www.w3.org/2002/xforms">
<xsl:copy-of select="@*|text()"/>
<xsl:apply-templates select="*"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
</xf:instance>
<xf:instance id="select1">
<data xmlns="">
<select1 ref="selected" appearance="minimal">
<item>
<label>APPLE</label>
<value>apple</value>
</item>
</select1>
</data>
</xf:instance>
</xf:model>
</head>
<body>
<xf:group ref="instance('select1')/select1">
<fieldset>
<legend><xf:label>select1</xf:label></legend>
<xf:input ref="@ref">
<xf:label>ref</xf:label>
</xf:input>
<xf:select1 ref="@appearance">
<xf:label>appearance</xf:label>
<xf:item>
<xf:label>minimal</xf:label>
<xf:value>minimal</xf:value>
</xf:item>
<xf:item>
<xf:label>compact</xf:label>
<xf:value>compact</xf:value>
</xf:item>
<xf:item>
<xf:label>full</xf:label>
<xf:value>full</xf:value>
</xf:item>
</xf:select1>
<table>
<thead><tr><th>value</th><th>label</th></tr></thead>
<tbody>
<xf:repeat id="r1" ref="item">
<tr>
<td><xf:input ref="label"/></td>
<td><xf:input ref="value"/></td>
<td>
<xf:trigger ref=".[count(../item) > 1]">
<xf:label>x</xf:label>
<xf:hint>Remove item</xf:hint>
<xf:delete ev:event="DOMActivate" ref="."/>
</xf:trigger>
</td>
</tr>
</xf:repeat>
</tbody>
</table>
<xf:trigger>
<xf:label>+</xf:label>
<xf:hint>Add new item</xf:hint>
<xf:insert ev:event="DOMActivate" ref="item[index('r1')]"/>
</xf:trigger>
</fieldset>
</xf:group>
<fieldset>
<legend><xf:label>output</xf:label></legend>
<pre>
<code class="xml">
<xf:output value="output"/>
</code>
</pre>
<a href="{download}" download="fragment.xml">DOWNLOAD</a>
</fieldset>
</body>
</html>