Titan Core Initial Contribution
[deliverable/titan.core.git] / regression_test / XML / XmlWorkflow / Tgc / XSD.ttcn
CommitLineData
970ed795
EL
1/******************************************************************************
2 * Copyright (c) 2000-2014 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 ******************************************************************************/
8module XSD {
9
10import from UsefulTtcn3Types all;
11
12//These constants are used in the XSD date/time type definitions
13const charstring
14 dash := "-",
15 cln := ":",
16 year := "(0(0(0[1-9]|[1-9][0-9])|[1-9][0-9][0-9])|[1-9][0-9][0-9][0-9])",
17 yearExpansion := "(-([1-9][0-9]#(0,))#(,1))#(,1)",
18 month := "(0[1-9]|1[0-2])",
19 dayOfMonth := "(0[1-9]|[12][0-9]|3[01])",
20 hour := "([01][0-9]|2[0-3])",
21 minute := "([0-5][0-9])",
22 second := "([0-5][0-9])",
23 sFraction := "(.[0-9]#(1,))#(,1)",
24 endOfDayExt := "24:00:00(.0#(1,))#(,1)",
25 nums := "[0-9]#(1,)",
26 ZorTimeZoneExt := "(Z|[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00))#(,1)",
27 durTime := "(T[0-9]#(1,)"&
28 "(H([0-9]#(1,)(M([0-9]#(1,)(S|.[0-9]#(1,)S))#(,1)|.[0-9]#(1,)S|S))#(,1)|"&
29 "M([0-9]#(1,)(S|.[0-9]#(1,)S)|.[0-9]#(1,)M)#(,1)|"&
30 "S|"&
31 ".[0-9]#(1,)S))"
32
33//anySimpleType
34
35type XMLCompatibleString AnySimpleType
36with {
37variant "XSD:anySimpleType";
38};
39
40//anyType;
41
42type record AnyType
43{
44 record of String attr,
45 record of String elem_list
46}
47with {
48variant "XSD:anyType";
49variant (attr) "anyAttributes";
50variant (elem_list) "anyElement";
51};
52// String types
53
54type XMLCompatibleString String
55with {
56variant "XSD:string";
57};
58
59type XMLStringWithNoCRLFHT NormalizedString
60with {
61variant "XSD:normalizedString";
62};
63
64type NormalizedString Token
65with {
66variant "XSD:token";
67};
68
69type XMLStringWithNoWhitespace Name
70with {
71variant "XSD:Name";
72};
73
74type XMLStringWithNoWhitespace NMTOKEN
75with {
76variant "XSD:NMTOKEN";
77};
78
79type Name NCName
80with {
81variant "XSD:NCName";
82};
83
84type NCName ID
85with {
86variant "XSD:ID";
87};
88
89type NCName IDREF
90with {
91variant "XSD:IDREF";
92};
93
94type NCName ENTITY
95with {
96variant "XSD:ENTITY";
97};
98
99type octetstring HexBinary
100with {
101variant "XSD:hexBinary";
102};
103
104type octetstring Base64Binary
105with {
106variant "XSD:base64Binary";
107};
108
109type XMLStringWithNoCRLFHT AnyURI
110with {
111variant "XSD:anyURI";
112};
113
114type charstring Language (pattern "[a-zA-Z]#(1,8)(-\w#(1,8))#(0,)")
115with {
116variant "XSD:language";
117};
118// Integer types
119
120type integer Integer
121with {
122variant "XSD:integer";
123};
124
125type integer PositiveInteger (1 .. infinity)
126with {
127variant "XSD:positiveInteger";
128};
129
130type integer NonPositiveInteger (-infinity .. 0)
131with {
132variant "XSD:nonPositiveInteger";
133};
134
135type integer NegativeInteger (-infinity .. -1)
136with {
137variant "XSD:negativeInteger";
138};
139
140type integer NonNegativeInteger (0 .. infinity)
141with {
142variant "XSD:nonNegativeInteger";
143};
144
145type longlong Long
146with {
147variant "XSD:long";
148};
149
150type unsignedlonglong UnsignedLong
151with {
152variant "XSD:unsignedLong";
153};
154
155type long Int
156with {
157variant "XSD:int";
158};
159
160type unsignedlong UnsignedInt
161with {
162variant "XSD:unsignedInt";
163};
164
165type short Short
166with {
167variant "XSD:short";
168};
169
170type unsignedshort UnsignedShort
171with {
172variant "XSD:unsignedShort";
173};
174
175type byte Byte
176with {
177variant "XSD:byte";
178};
179
180type unsignedbyte UnsignedByte
181with {
182variant "XSD:unsignedByte";
183};
184
185// Float types
186
187type float Decimal
188with {
189variant "XSD:decimal";
190};
191
192type IEEE754float Float
193with {
194variant "XSD:float";
195};
196
197type IEEE754double Double
198with {
199variant "XSD:double";
200};
201
202// Time types
203
204type charstring Duration (pattern
205 "{dash}#(,1)P({nums}(Y({nums}(M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|" &
206 "{durTime}#(,1))|M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|{durTime})")
207with {
208variant "XSD:duration";
209};
210
211type charstring DateTime (pattern
212 "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}T({hour}{cln}{minute}{cln}{second}" &
213 "{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" )
214with {
215variant "XSD:dateTime";
216};
217
218type charstring Time (pattern
219 "({hour}{cln}{minute}{cln}{second}{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" )
220with {
221variant "XSD:time";
222};
223
224type charstring Date (pattern
225 "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
226with {
227variant "XSD:date";
228};
229
230type charstring GYearMonth (pattern
231 "{yearExpansion}{year}{dash}{month}{ZorTimeZoneExt}" )
232with {
233variant "XSD:gYearMonth";
234};
235
236type charstring GYear (pattern
237 "{yearExpansion}{year}{ZorTimeZoneExt}" )
238with {
239variant "XSD:gYear";
240};
241
242type charstring GMonthDay (pattern
243 "{dash}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
244with {
245variant "XSD:gMonthDay";
246};
247
248type charstring GDay (pattern
249 "{dash}{dash}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
250with {
251variant "XSD:gDay";
252};
253
254type charstring GMonth (pattern
255 "{dash}{dash}{month}{ZorTimeZoneExt}" )
256with {
257variant "XSD:gMonth";
258};
259
260// Sequence types
261
262type record of NMTOKEN NMTOKENS
263with {
264variant "XSD:NMTOKENS";
265};
266
267type record of IDREF IDREFS
268with {
269variant "XSD:IDREFS";
270};
271
272type record of ENTITY ENTITIES
273with {
274variant "XSD:ENTITIES";
275};
276
277type record QName
278{
279 AnyURI uri optional,
280 NCName name
281}
282with {
283variant "XSD:QName";
284};
285
286// Boolean type
287
288type boolean Boolean
289with {
290variant "XSD:boolean";
291};
292
293//TTCN-3 type definitions supporting the mapping of W3C XML Schema built-in datatypes
294
295type utf8string XMLCompatibleString
296(
297 char(0,0,0,9)..char(0,0,0,9),
298 char(0,0,0,10)..char(0,0,0,10),
299 char(0,0,0,12)..char(0,0,0,12),
300 char(0,0,0,32)..char(0,0,215,255),
301 char(0,0,224,0)..char(0,0,255,253),
302 char(0,1,0,0)..char(0,16,255,253)
303)
304
305type utf8string XMLStringWithNoWhitespace
306(
307 char(0,0,0,33)..char(0,0,215,255),
308 char(0,0,224,0)..char(0,0,255,253),
309 char(0,1,0,0)..char(0,16,255,253)
310)
311
312type utf8string XMLStringWithNoCRLFHT
313(
314 char(0,0,0,32)..char(0,0,215,255),
315 char(0,0,224,0)..char(0,0,255,253),
316 char(0,1,0,0)..char(0,16,255,253)
317)
318
319}
320with{
321encode "XML"
322}
This page took 0.03614 seconds and 5 git commands to generate.