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