1 /******************************************************************************
2 * Copyright (c) 2000-2015 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 ******************************************************************************/
10 import from UsefulTtcn3Types all;
12 //These constants are used in the XSD date/time type definitions
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)",
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)|"&
35 type XMLCompatibleString AnySimpleType
37 variant "XSD:anySimpleType";
44 record of String attr,
45 record of String elem_list
48 variant "XSD:anyType";
49 variant (attr) "anyAttributes";
50 variant (elem_list) "anyElement";
54 type XMLCompatibleString String
59 type XMLStringWithNoCRLFHT NormalizedString
61 variant "XSD:normalizedString";
64 type NormalizedString Token
69 type XMLStringWithNoWhitespace Name
74 type XMLStringWithNoWhitespace NMTOKEN
76 variant "XSD:NMTOKEN";
99 type octetstring HexBinary
101 variant "XSD:hexBinary";
104 type octetstring Base64Binary
106 variant "XSD:base64Binary";
109 type XMLStringWithNoCRLFHT AnyURI
111 variant "XSD:anyURI";
114 type charstring Language (pattern "[a-zA-Z]#(1,8)(-\w#(1,8))#(0,)")
116 variant "XSD:language";
122 variant "XSD:integer";
125 type integer PositiveInteger (1 .. infinity)
127 variant "XSD:positiveInteger";
130 type integer NonPositiveInteger (-infinity .. 0)
132 variant "XSD:nonPositiveInteger";
135 type integer NegativeInteger (-infinity .. -1)
137 variant "XSD:negativeInteger";
140 type integer NonNegativeInteger (0 .. infinity)
142 variant "XSD:nonNegativeInteger";
150 type unsignedlonglong UnsignedLong
152 variant "XSD:unsignedLong";
160 type unsignedlong UnsignedInt
162 variant "XSD:unsignedInt";
170 type unsignedshort UnsignedShort
172 variant "XSD:unsignedShort";
180 type unsignedbyte UnsignedByte
182 variant "XSD:unsignedByte";
189 variant "XSD:decimal";
192 type IEEE754float Float
197 type IEEE754double Double
199 variant "XSD:double";
204 type 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})")
208 variant "XSD:duration";
211 type charstring DateTime (pattern
212 "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}T({hour}{cln}{minute}{cln}{second}" &
213 "{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" )
215 variant "XSD:dateTime";
218 type charstring Time (pattern
219 "({hour}{cln}{minute}{cln}{second}{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" )
224 type charstring Date (pattern
225 "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
230 type charstring GYearMonth (pattern
231 "{yearExpansion}{year}{dash}{month}{ZorTimeZoneExt}" )
233 variant "XSD:gYearMonth";
236 type charstring GYear (pattern
237 "{yearExpansion}{year}{ZorTimeZoneExt}" )
242 type charstring GMonthDay (pattern
243 "{dash}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
245 variant "XSD:gMonthDay";
248 type charstring GDay (pattern
249 "{dash}{dash}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
254 type charstring GMonth (pattern
255 "{dash}{dash}{month}{ZorTimeZoneExt}" )
257 variant "XSD:gMonth";
262 type record of NMTOKEN NMTOKENS
264 variant "XSD:NMTOKENS";
267 type record of IDREF IDREFS
269 variant "XSD:IDREFS";
272 type record of ENTITY ENTITIES
274 variant "XSD:ENTITIES";
290 variant "XSD:boolean";
293 //TTCN-3 type definitions supporting the mapping of W3C XML Schema built-in datatypes
295 type utf8string XMLCompatibleString
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)
305 type utf8string XMLStringWithNoWhitespace
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)
312 type utf8string XMLStringWithNoCRLFHT
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)