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
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 embed_values optional,
45 record of String attr optional,
46 record of String elem_list
49 variant "XSD:anyType";
50 variant "embedValues";
51 variant (attr) "anyAttributes";
52 variant (elem_list) "anyElement";
56 type XMLCompatibleString String
61 type XMLStringWithNoCRLFHT NormalizedString
63 variant "XSD:normalizedString";
66 type NormalizedString Token
71 type XMLStringWithNoWhitespace Name
76 type XMLStringWithNoWhitespace NMTOKEN
78 variant "XSD:NMTOKEN";
101 type octetstring HexBinary
103 variant "XSD:hexBinary";
106 type octetstring Base64Binary
108 variant "XSD:base64Binary";
111 type XMLStringWithNoCRLFHT AnyURI
113 variant "XSD:anyURI";
116 type charstring Language (pattern "[a-zA-Z]#(1,8)(-\w#(1,8))#(0,)")
118 variant "XSD:language";
124 variant "XSD:integer";
127 type integer PositiveInteger (1 .. infinity)
129 variant "XSD:positiveInteger";
132 type integer NonPositiveInteger (-infinity .. 0)
134 variant "XSD:nonPositiveInteger";
137 type integer NegativeInteger (-infinity .. -1)
139 variant "XSD:negativeInteger";
142 type integer NonNegativeInteger (0 .. infinity)
144 variant "XSD:nonNegativeInteger";
152 type unsignedlonglong UnsignedLong
154 variant "XSD:unsignedLong";
162 type unsignedlong UnsignedInt
164 variant "XSD:unsignedInt";
172 type unsignedshort UnsignedShort
174 variant "XSD:unsignedShort";
182 type unsignedbyte UnsignedByte
184 variant "XSD:unsignedByte";
191 variant "XSD:decimal";
194 type IEEE754float Float
199 type IEEE754double Double
201 variant "XSD:double";
206 type 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})")
210 variant "XSD:duration";
213 type charstring DateTime (pattern
214 "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}T({hour}{cln}{minute}{cln}{second}" &
215 "{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" )
217 variant "XSD:dateTime";
220 type charstring Time (pattern
221 "({hour}{cln}{minute}{cln}{second}{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" )
226 type charstring Date (pattern
227 "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
232 type charstring GYearMonth (pattern
233 "{yearExpansion}{year}{dash}{month}{ZorTimeZoneExt}" )
235 variant "XSD:gYearMonth";
238 type charstring GYear (pattern
239 "{yearExpansion}{year}{ZorTimeZoneExt}" )
244 type charstring GMonthDay (pattern
245 "{dash}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
247 variant "XSD:gMonthDay";
250 type charstring GDay (pattern
251 "{dash}{dash}{dash}{dayOfMonth}{ZorTimeZoneExt}" )
256 type charstring GMonth (pattern
257 "{dash}{dash}{month}{ZorTimeZoneExt}" )
259 variant "XSD:gMonth";
264 type record of NMTOKEN NMTOKENS
266 variant "XSD:NMTOKENS";
269 type record of IDREF IDREFS
271 variant "XSD:IDREFS";
274 type record of ENTITY ENTITIES
276 variant "XSD:ENTITIES";
292 variant "XSD:boolean";
295 //TTCN-3 type definitions supporting the mapping of W3C XML Schema built-in datatypes
297 type utf8string XMLCompatibleString
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)
307 type utf8string XMLStringWithNoWhitespace
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)
314 type utf8string XMLStringWithNoCRLFHT
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)