Commit | Line | Data |
---|---|---|
970ed795 | 1 | /****************************************************************************** |
3abe9331 | 2 | * Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
3 | * All rights reserved. This program and the accompanying materials |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | ******************************************************************************/ | |
8 | // | |
9 | // File: jabber_x_data.ttcn | |
10 | // Description: | |
11 | // References: | |
12 | // Rev: | |
13 | // Prodnr: | |
14 | // Updated: Sun Jan 6 13:51:49 2013 | |
15 | // Contact: http://ttcn.ericsson.se | |
16 | // | |
17 | //////////////////////////////////////////////////////////////////////////////// | |
18 | // | |
19 | // Generated from file(s): | |
20 | // | |
21 | // - x-data.xsd | |
22 | // /* xml version = "1.0" encoding = "UTF-8" */ | |
23 | // /* targetnamespace = "jabber:x:data" */ | |
24 | // | |
25 | //////////////////////////////////////////////////////////////////////////////// | |
26 | ||
27 | //////////////////////////////////////////////////////////////////////////////// | |
28 | // | |
29 | // | |
30 | //XEP-0004: Data Forms | |
31 | // | |
32 | // | |
33 | //////////////////////////////////////////////////////////////////////////////// | |
34 | ||
35 | ||
36 | ||
37 | ||
38 | module jabber_x_data { | |
39 | ||
40 | ||
41 | import from XSD all; | |
42 | ||
43 | ||
44 | /* The protocol documented by this schema is defined in | |
45 | XEP-0004: http://www.xmpp.org/extensions/xep-0004.html */ | |
46 | ||
47 | ||
48 | type record X | |
49 | { | |
50 | enumerated { | |
51 | cancel, | |
52 | form, | |
53 | result, | |
54 | submit | |
55 | } type_, | |
56 | //record of XSD.String instructions_list, Openfire pubsub sends title first | |
57 | //XSD.String title optional, | |
58 | XSD.String title optional, | |
59 | record of XSD.String instructions_list, | |
60 | record of Field field_list, | |
61 | Reported reported optional, | |
62 | record of Item item_list | |
63 | } | |
64 | with { | |
65 | variant "name as uncapitalized"; | |
66 | variant "element"; | |
67 | variant (type_) "name as 'type'"; | |
68 | variant (type_) "attribute"; | |
69 | variant (instructions_list) "untagged"; | |
70 | variant (instructions_list[-]) "name as 'instructions'"; | |
71 | variant (field_list) "untagged"; | |
72 | variant (item_list) "untagged"; | |
73 | }; | |
74 | ||
75 | ||
76 | type record Field | |
77 | { | |
78 | XSD.String label_ optional, | |
79 | enumerated { | |
80 | boolean_, | |
81 | fixed, | |
82 | hidden, | |
83 | jid_multi, | |
84 | jid_single, | |
85 | list_multi, | |
86 | list_single, | |
87 | text_multi, | |
88 | text_private, | |
89 | text_single | |
90 | } type_ optional, | |
91 | XSD.String var_ optional, | |
92 | XSD.String desc optional, | |
93 | Empty required optional, | |
94 | record of Value value_list, | |
95 | record of Option option_list | |
96 | } | |
97 | with { | |
98 | variant "name as uncapitalized"; | |
99 | variant "element"; | |
100 | variant (label_) "name as 'label'"; | |
101 | variant (label_) "attribute"; | |
102 | variant (type_) "text 'boolean_' as 'boolean'"; | |
103 | variant (type_) "text 'jid_multi' as 'jid-multi'"; | |
104 | variant (type_) "text 'jid_single' as 'jid-single'"; | |
105 | variant (type_) "text 'list_multi' as 'list-multi'"; | |
106 | variant (type_) "text 'list_single' as 'list-single'"; | |
107 | variant (type_) "text 'text_multi' as 'text-multi'"; | |
108 | variant (type_) "text 'text_private' as 'text-private'"; | |
109 | variant (type_) "text 'text_single' as 'text-single'"; | |
110 | variant (type_) "name as 'type'"; | |
111 | variant (type_) "defaultForEmpty as 'text-single'"; | |
112 | variant (type_) "attribute"; | |
113 | variant (var_) "name as 'var'"; | |
114 | variant (var_) "attribute"; | |
115 | variant (value_list) "untagged"; | |
116 | variant (option_list) "untagged"; | |
117 | }; | |
118 | ||
119 | ||
120 | type record Option | |
121 | { | |
122 | XSD.String label_ optional, | |
123 | Value value_ | |
124 | } | |
125 | with { | |
126 | variant "name as uncapitalized"; | |
127 | variant "element"; | |
128 | variant (label_) "name as 'label'"; | |
129 | variant (label_) "attribute"; | |
130 | variant (value_) "name as 'value'"; | |
131 | }; | |
132 | ||
133 | ||
134 | type XSD.String Value | |
135 | with { | |
136 | variant "name as uncapitalized"; | |
137 | variant "element"; | |
138 | }; | |
139 | ||
140 | ||
141 | /* When contained in a "reported" element, the "field" element | |
142 | SHOULD NOT contain a "value" child. */ | |
143 | type record Reported | |
144 | { | |
145 | record length(1 .. infinity) of Field field_list | |
146 | } | |
147 | with { | |
148 | variant "name as uncapitalized"; | |
149 | variant "element"; | |
150 | variant (field_list) "untagged"; | |
151 | }; | |
152 | ||
153 | ||
154 | type record Item | |
155 | { | |
156 | record length(1 .. infinity) of Field field_list | |
157 | } | |
158 | with { | |
159 | variant "name as uncapitalized"; | |
160 | variant "element"; | |
161 | variant (field_list) "untagged"; | |
162 | }; | |
163 | ||
164 | ||
165 | type enumerated Empty | |
166 | { | |
167 | x | |
168 | } | |
169 | with { | |
170 | variant "text 'x' as ''"; | |
171 | variant "name as uncapitalized"; | |
172 | }; | |
173 | ||
174 | ||
175 | } | |
176 | with { | |
177 | encode "XML"; | |
178 | variant "namespace as 'jabber:x:data'"; | |
179 | variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; | |
180 | variant "elementFormQualified"; | |
181 | } |