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