Last sync 2016.04.01
[deliverable/titan.core.git] / regression_test / XML / TTCNandXML / AnnexB2.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
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 * Contributors:
9 * Balasko, Jeno
10 * Raduly, Csaba
11 *
12 ******************************************************************************/
13 /* Annex B Example 2
14
15 XML Schema:
16
17 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
18 <xs:simpleType name="S1">
19 <xs:restriction base="xs:integer">
20 <xs:maxInclusive value="2"/>
21 </xs:restriction>
22 </xs:simpleType>
23
24 <xs:simpleType name="S2">
25 <xs:restriction base="S1">
26 <xs:minInclusive value="-23"/>
27 <xs:maxInclusive value="1"/>
28 </xs:restriction>
29 </xs:simpleType>
30
31 <xs:simpleType name="S3">
32 <xs:restriction base="S2">
33 <xs:minInclusive value="-3"/>
34 <xs:maxExclusive value="1"/>
35 </xs:restriction>
36 </xs:simpleType>
37
38 <xs:complexType name="C1">
39 <xs:simpleContent>
40 <xs:extension base="S3">
41 <xs:attribute name="A1" type="xs:integer"/>
42 <xs:attribute name="A2" type="xs:float"/>
43 </xs:extension>
44 </xs:simpleContent>
45 </xs:complexType>
46 </xs:schema>
47
48 TTCN-3 Module:
49
50 */
51 module AnnexB2 {
52 //import from XSD language "XML" all;
53
54 type integer S1 (-infinity .. 2);
55 type S1 S2 (-23 .. 1);
56 type S2 S3 (-3 .. 0);
57
58 type record C0 {
59 integer a1 optional,
60 float a2 optional,
61 S3 base
62 } with {
63 variant(a1,a2) "name as capitalized";
64 variant(a1,a2) "attribute";
65 variant (base) "untagged "
66 }
67
68 type record Cu {
69 charstring one
70 } with {
71 variant (one) "untagged"
72 }
73
74 type record Cru {
75 record of S1 smalls
76 } with {
77 variant (smalls) "untagged"
78 }
79
80 /* * * * * */
81 type record C0container {
82 C0 fld1
83 }
84
85
86 type record strings {
87 record of charstring inner
88 }
89 with { variant (inner) "untagged" }
90
91 } with {
92 encode "XML";
93 }
94
This page took 0.037102 seconds and 5 git commands to generate.