Commit | Line | Data |
---|---|---|
970ed795 EL |
1 | /******************************************************************************* |
2 | * Copyright Ericsson Telecom AB | |
3 | * | |
4 | * XSD to TTCN-3 Translator | |
5 | * | |
6 | * All rights reserved. This program and the accompanying materials | |
7 | * are made available under the terms of the Eclipse Public License v1.0 | |
8 | * which accompanies this distribution, and is available at | |
9 | * http://www.eclipse.org/legal/epl-v10.html | |
10 | *******************************************************************************/ | |
11 | // | |
12 | // File: NoTargetNamespace_XML_RPC_e.ttcn | |
13 | // Description: | |
14 | // References: | |
15 | // Rev: | |
16 | // Prodnr: | |
17 | // Updated: | |
18 | // Contact: http://ttcn.ericsson.se | |
19 | // | |
20 | //////////////////////////////////////////////////////////////////////////////// | |
21 | // | |
22 | // Generated from file(s): | |
23 | // | |
24 | // - XML_RPC.xsd | |
25 | // /* xml version = "1.0" */ | |
26 | // /* targetnamespace = "NoTargetNamespace" */ | |
27 | // | |
28 | //////////////////////////////////////////////////////////////////////////////// | |
29 | ||
30 | ||
31 | module NoTargetNamespace_XML_RPC_e { | |
32 | ||
33 | ||
34 | import from XSD all; | |
35 | ||
36 | ||
37 | /* The only two possible root elements are methodResponse and | |
38 | methodCall so these are the only two I use a top-level | |
39 | declaration for. */ | |
40 | ||
41 | ||
42 | type record MethodCall | |
43 | { | |
44 | record of enumerated { | |
45 | methodName, | |
46 | params | |
47 | } order, | |
48 | ASCIIString methodName, | |
49 | record { | |
50 | record of ParamType param_list | |
51 | } params optional | |
52 | } | |
53 | with { | |
54 | variant "name as uncapitalized"; | |
55 | variant "useOrder"; | |
56 | variant "element"; | |
57 | variant (params.param_list) "untagged"; | |
58 | variant (params.param_list[-]) "name as 'param'"; | |
59 | }; | |
60 | ||
61 | ||
62 | /* What can appear inside a fault is very restricted */ | |
63 | type record MethodResponse | |
64 | { | |
65 | union { | |
66 | record { | |
67 | ParamType param_ | |
68 | } params, | |
69 | record { | |
70 | record { | |
71 | record { | |
72 | MemberType member, | |
73 | MemberType member_1 | |
74 | } struct | |
75 | } value_ | |
76 | } fault | |
77 | } choice | |
78 | } | |
79 | with { | |
80 | variant "name as uncapitalized"; | |
81 | variant "element"; | |
82 | variant (choice) "untagged"; | |
83 | variant (choice.params.param_) "name as 'param'"; | |
84 | variant (choice.fault.value_) "name as 'value'"; | |
85 | variant (choice.fault.value_.struct.member_1) "name as 'member'"; | |
86 | }; | |
87 | ||
88 | ||
89 | type record ParamType | |
90 | { | |
91 | ValueType value_ | |
92 | } | |
93 | with { | |
94 | variant (value_) "name as 'value'"; | |
95 | }; | |
96 | ||
97 | ||
98 | /* I need to figure out how to say that this | |
99 | is either a simple xsd:string type or that | |
100 | it contains one of these elements; but that otherwise | |
101 | it does not have mixed content */ | |
102 | type record ValueType | |
103 | { | |
104 | record of XSD.String embed_values, | |
105 | union { | |
106 | XSD.Int i4, | |
107 | XSD.Int int, | |
108 | ASCIIString string, | |
109 | XSD.Decimal double, | |
110 | XSD.Base64Binary base64, | |
111 | NumericBoolean boolean_, | |
112 | XSD.DateTime dateTime_iso8601, | |
113 | ArrayType array, | |
114 | StructType struct | |
115 | } choice | |
116 | } | |
117 | with { | |
118 | variant "embedValues"; | |
119 | variant (choice) "untagged"; | |
120 | variant (choice.base64) "name as capitalized"; | |
121 | variant (choice.boolean_) "name as 'boolean'"; | |
122 | variant (choice.dateTime_iso8601) "name as 'dateTime.iso8601'"; | |
123 | }; | |
124 | ||
125 | ||
126 | type record StructType | |
127 | { | |
128 | record length(1 .. infinity) of MemberType member_list | |
129 | } | |
130 | with { | |
131 | variant (member_list) "untagged"; | |
132 | variant (member_list[-]) "name as 'member'"; | |
133 | }; | |
134 | ||
135 | ||
136 | type record MemberType | |
137 | { | |
138 | XSD.String name, | |
139 | ValueType value_ | |
140 | } | |
141 | with { | |
142 | variant (value_) "name as 'value'"; | |
143 | }; | |
144 | ||
145 | ||
146 | type record ArrayType | |
147 | { | |
148 | record { | |
149 | record of ValueType value_list | |
150 | } data | |
151 | } | |
152 | with { | |
153 | variant (data.value_list) "untagged"; | |
154 | variant (data.value_list[-]) "name as 'value'"; | |
155 | }; | |
156 | ||
157 | ||
158 | type XSD.String ASCIIString (pattern "([ -~]|\n|\r|\t)*"); | |
159 | ||
160 | ||
161 | type XSD.Boolean NumericBoolean; | |
162 | ||
163 | ||
164 | } | |
165 | with { | |
166 | encode "XML"; | |
167 | variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; | |
168 | } |