3abe9331 |
1 | /******************************************************************************* |
2 | * Copyright (c) 2000-2015 Ericsson Telecom AB |
3 | * |
4 | * XSD to TTCN-3 Translator version: CRL 113 200/5 R2A |
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: www_example_org_substitutiongroup_e.ttcn |
13 | // Description: |
14 | // References: |
15 | // Rev: |
16 | // Prodnr: |
17 | // Updated: Wed Oct 14 16:10:14 2014 |
18 | // Contact: http://ttcn.ericsson.se |
19 | // |
20 | //////////////////////////////////////////////////////////////////////////////// |
21 | // Generated from file(s): |
22 | // - substitutiongroup_e.xsd |
23 | // /* xml version = "1.0" encoding = "UTF-8" */ |
24 | // /* targetnamespace = "www.example.org/substitutiongroup/e" */ |
25 | //////////////////////////////////////////////////////////////////////////////// |
26 | // Modification header(s): |
27 | //----------------------------------------------------------------------------- |
28 | // Modified by: |
29 | // Modification date: |
30 | // Description: |
31 | // Modification contact: |
32 | //------------------------------------------------------------------------------ |
33 | //////////////////////////////////////////////////////////////////////////////// |
34 | |
35 | |
36 | module www_example_org_substitutiongroup { |
37 | |
38 | |
39 | import from XSD all; |
40 | |
41 | |
42 | /* THE HEAD ELEMENT */ |
43 | |
44 | |
45 | /* SUBSTITUTION ELEMENT OF THE SAME TYPE AS THE HEAD */ |
46 | |
47 | |
48 | type XSD.String Member1 |
49 | with { |
3f84031e |
50 | variant "name as uncapitalized"; |
51 | variant "element"; |
3abe9331 |
52 | }; |
53 | |
54 | |
55 | /* SUBSTITUTION ELEMENT OF A TYPE RESTRICTING THE TYPE OF THE HEAD */ |
56 | |
57 | |
58 | type enumerated StringEnum |
59 | { |
60 | else_, |
61 | something |
62 | } |
63 | with { |
3f84031e |
64 | variant "text 'else_' as 'else'"; |
65 | variant "name as uncapitalized"; |
3abe9331 |
66 | }; |
67 | |
68 | |
69 | type StringEnum Member2 |
70 | with { |
3f84031e |
71 | variant "name as uncapitalized"; |
72 | variant "element"; |
3abe9331 |
73 | }; |
74 | |
75 | |
76 | /* SUBSTITUTION ELEMENT OF A TYPE EXTENDING THE TYPE OF THE HEAD */ |
77 | |
78 | |
79 | type record ComplexEnum |
80 | { |
81 | XSD.Integer bar optional, |
82 | XSD.Float foo optional, |
83 | XSD.String base |
84 | } |
85 | with { |
3f84031e |
86 | variant "name as uncapitalized"; |
87 | variant (bar) "attribute"; |
88 | variant (foo) "attribute"; |
89 | variant (base) "untagged"; |
3abe9331 |
90 | }; |
91 | |
92 | |
93 | type ComplexEnum Member3 |
94 | with { |
3f84031e |
95 | variant "name as uncapitalized"; |
96 | variant "element"; |
3abe9331 |
97 | }; |
98 | |
99 | |
100 | /* TOP LEVEL ELEMENT TO DEMONSTRATE SUBSTITUTION */ |
101 | |
102 | |
103 | type record Ize |
104 | { |
105 | record of Head_group head_list |
106 | } |
107 | with { |
3f84031e |
108 | variant "name as uncapitalized"; |
109 | variant "element"; |
110 | variant (head_list) "untagged"; |
111 | variant (head_list[-]) "name as 'head'"; |
3abe9331 |
112 | }; |
113 | |
114 | |
115 | type union Head_group |
116 | { |
117 | XSD.String head, |
118 | Member1 member1, |
119 | Member2 member2, |
120 | Member3 member3 |
121 | } |
122 | with { |
3f84031e |
123 | variant "untagged"; |
124 | variant (head) "form as qualified"; |
3abe9331 |
125 | }; |
126 | |
127 | |
128 | } |
129 | with { |
3f84031e |
130 | encode "XML"; |
131 | variant "namespace as 'www.example.org/substitutiongroup' prefix 'subs'"; |
132 | variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; |
3abe9331 |
133 | } |